htt.h 763 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707
  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. */
  215. #define HTT_CURRENT_VERSION_MAJOR 3
  216. #define HTT_CURRENT_VERSION_MINOR 95
  217. #define HTT_NUM_TX_FRAG_DESC 1024
  218. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  219. #define HTT_CHECK_SET_VAL(field, val) \
  220. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  221. /* macros to assist in sign-extending fields from HTT messages */
  222. #define HTT_SIGN_BIT_MASK(field) \
  223. ((field ## _M + (1 << field ## _S)) >> 1)
  224. #define HTT_SIGN_BIT(_val, field) \
  225. (_val & HTT_SIGN_BIT_MASK(field))
  226. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  227. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  228. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  229. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  230. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  231. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  232. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  233. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  234. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  235. /*
  236. * TEMPORARY:
  237. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  238. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  239. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  240. * updated.
  241. */
  242. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  243. /*
  244. * TEMPORARY:
  245. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  246. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  247. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  248. * updated.
  249. */
  250. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  251. /*
  252. * htt_dbg_stats_type -
  253. * bit positions for each stats type within a stats type bitmask
  254. * The bitmask contains 24 bits.
  255. */
  256. enum htt_dbg_stats_type {
  257. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  258. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  259. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  260. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  261. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  262. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  263. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  264. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  265. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  266. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  267. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  268. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  269. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  270. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  271. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  272. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  273. /* bits 16-23 currently reserved */
  274. /* keep this last */
  275. HTT_DBG_NUM_STATS
  276. };
  277. /*=== HTT option selection TLVs ===
  278. * Certain HTT messages have alternatives or options.
  279. * For such cases, the host and target need to agree on which option to use.
  280. * Option specification TLVs can be appended to the VERSION_REQ and
  281. * VERSION_CONF messages to select options other than the default.
  282. * These TLVs are entirely optional - if they are not provided, there is a
  283. * well-defined default for each option. If they are provided, they can be
  284. * provided in any order. Each TLV can be present or absent independent of
  285. * the presence / absence of other TLVs.
  286. *
  287. * The HTT option selection TLVs use the following format:
  288. * |31 16|15 8|7 0|
  289. * |---------------------------------+----------------+----------------|
  290. * | value (payload) | length | tag |
  291. * |-------------------------------------------------------------------|
  292. * The value portion need not be only 2 bytes; it can be extended by any
  293. * integer number of 4-byte units. The total length of the TLV, including
  294. * the tag and length fields, must be a multiple of 4 bytes. The length
  295. * field specifies the total TLV size in 4-byte units. Thus, the typical
  296. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  297. * field, would store 0x1 in its length field, to show that the TLV occupies
  298. * a single 4-byte unit.
  299. */
  300. /*--- TLV header format - applies to all HTT option TLVs ---*/
  301. enum HTT_OPTION_TLV_TAGS {
  302. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  303. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  304. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  305. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  306. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  307. };
  308. PREPACK struct htt_option_tlv_header_t {
  309. A_UINT8 tag;
  310. A_UINT8 length;
  311. } POSTPACK;
  312. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  313. #define HTT_OPTION_TLV_TAG_S 0
  314. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  315. #define HTT_OPTION_TLV_LENGTH_S 8
  316. /*
  317. * value0 - 16 bit value field stored in word0
  318. * The TLV's value field may be longer than 2 bytes, in which case
  319. * the remainder of the value is stored in word1, word2, etc.
  320. */
  321. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  322. #define HTT_OPTION_TLV_VALUE0_S 16
  323. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  324. do { \
  325. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  326. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  327. } while (0)
  328. #define HTT_OPTION_TLV_TAG_GET(word) \
  329. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  330. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  331. do { \
  332. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  333. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  334. } while (0)
  335. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  336. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  337. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  338. do { \
  339. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  340. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  341. } while (0)
  342. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  343. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  344. /*--- format of specific HTT option TLVs ---*/
  345. /*
  346. * HTT option TLV for specifying LL bus address size
  347. * Some chips require bus addresses used by the target to access buffers
  348. * within the host's memory to be 32 bits; others require bus addresses
  349. * used by the target to access buffers within the host's memory to be
  350. * 64 bits.
  351. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  352. * a suffix to the VERSION_CONF message to specify which bus address format
  353. * the target requires.
  354. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  355. * default to providing bus addresses to the target in 32-bit format.
  356. */
  357. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  358. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  359. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  360. };
  361. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  362. struct htt_option_tlv_header_t hdr;
  363. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  364. } POSTPACK;
  365. /*
  366. * HTT option TLV for specifying whether HL systems should indicate
  367. * over-the-air tx completion for individual frames, or should instead
  368. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  369. * requests an OTA tx completion for a particular tx frame.
  370. * This option does not apply to LL systems, where the TX_COMPL_IND
  371. * is mandatory.
  372. * This option is primarily intended for HL systems in which the tx frame
  373. * downloads over the host --> target bus are as slow as or slower than
  374. * the transmissions over the WLAN PHY. For cases where the bus is faster
  375. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  376. * and consquently will send one TX_COMPL_IND message that covers several
  377. * tx frames. For cases where the WLAN PHY is faster than the bus,
  378. * the target will end up transmitting very short A-MPDUs, and consequently
  379. * sending many TX_COMPL_IND messages, which each cover a very small number
  380. * of tx frames.
  381. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  382. * a suffix to the VERSION_REQ message to request whether the host desires to
  383. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  384. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  385. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  386. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  387. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  388. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  389. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  390. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  391. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  392. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  393. * TLV.
  394. */
  395. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  396. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  397. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  398. };
  399. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  400. struct htt_option_tlv_header_t hdr;
  401. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  402. } POSTPACK;
  403. /*
  404. * HTT option TLV for specifying how many tx queue groups the target
  405. * may establish.
  406. * This TLV specifies the maximum value the target may send in the
  407. * txq_group_id field of any TXQ_GROUP information elements sent by
  408. * the target to the host. This allows the host to pre-allocate an
  409. * appropriate number of tx queue group structs.
  410. *
  411. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  412. * a suffix to the VERSION_REQ message to specify whether the host supports
  413. * tx queue groups at all, and if so if there is any limit on the number of
  414. * tx queue groups that the host supports.
  415. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  416. * a suffix to the VERSION_CONF message. If the host has specified in the
  417. * VER_REQ message a limit on the number of tx queue groups the host can
  418. * supprt, the target shall limit its specification of the maximum tx groups
  419. * to be no larger than this host-specified limit.
  420. *
  421. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  422. * shall preallocate 4 tx queue group structs, and the target shall not
  423. * specify a txq_group_id larger than 3.
  424. */
  425. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  426. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  427. /*
  428. * values 1 through N specify the max number of tx queue groups
  429. * the sender supports
  430. */
  431. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  432. };
  433. /* TEMPORARY backwards-compatibility alias for a typo fix -
  434. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  435. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  436. * to support the old name (with the typo) until all references to the
  437. * old name are replaced with the new name.
  438. */
  439. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  440. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  441. struct htt_option_tlv_header_t hdr;
  442. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  443. } POSTPACK;
  444. /*
  445. * HTT option TLV for specifying whether the target supports an extended
  446. * version of the HTT tx descriptor. If the target provides this TLV
  447. * and specifies in the TLV that the target supports an extended version
  448. * of the HTT tx descriptor, the target must check the "extension" bit in
  449. * the HTT tx descriptor, and if the extension bit is set, to expect a
  450. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  451. * descriptor. Furthermore, the target must provide room for the HTT
  452. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  453. * This option is intended for systems where the host needs to explicitly
  454. * control the transmission parameters such as tx power for individual
  455. * tx frames.
  456. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  457. * as a suffix to the VERSION_CONF message to explicitly specify whether
  458. * the target supports the HTT tx MSDU extension descriptor.
  459. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  460. * by the host as lack of target support for the HTT tx MSDU extension
  461. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  462. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  463. * the HTT tx MSDU extension descriptor.
  464. * The host is not required to provide the HTT tx MSDU extension descriptor
  465. * just because the target supports it; the target must check the
  466. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  467. * extension descriptor is present.
  468. */
  469. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  470. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  471. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  472. };
  473. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  474. struct htt_option_tlv_header_t hdr;
  475. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  476. } POSTPACK;
  477. typedef struct {
  478. union {
  479. /* BIT [11 : 0] :- tag
  480. * BIT [23 : 12] :- length
  481. * BIT [31 : 24] :- reserved
  482. */
  483. A_UINT32 tag__length;
  484. /*
  485. * The following struct is not endian-portable.
  486. * It is suitable for use within the target, which is known to be
  487. * little-endian.
  488. * The host should use the above endian-portable macros to access
  489. * the tag and length bitfields in an endian-neutral manner.
  490. */
  491. struct {
  492. A_UINT32 tag : 12, /* BIT [11 : 0] */
  493. length : 12, /* BIT [23 : 12] */
  494. reserved : 8; /* BIT [31 : 24] */
  495. };
  496. };
  497. } htt_tlv_hdr_t;
  498. typedef enum {
  499. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  500. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  501. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  502. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  503. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  504. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  505. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  506. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  507. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  508. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  509. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  510. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  511. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  512. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  513. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  514. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  515. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  516. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  517. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  518. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  519. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  520. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  521. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  522. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  523. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  524. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  525. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  526. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  527. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  528. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  529. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  530. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  531. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  532. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  533. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  534. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  535. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  536. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  537. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  538. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  539. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  540. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  541. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  542. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  543. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  544. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  545. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  546. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  547. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  548. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  549. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  550. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  551. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  552. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  553. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  554. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  555. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  556. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  557. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  558. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  559. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  560. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  561. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  562. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  563. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  564. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  565. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  566. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  567. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  568. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  569. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  570. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  571. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  572. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  573. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  574. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  575. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  576. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  577. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  578. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  579. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  580. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  581. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  582. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  583. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  584. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  585. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  586. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  587. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  588. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  589. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  590. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  591. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  592. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  593. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  594. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  595. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  596. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  597. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  598. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  599. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  600. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  601. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  602. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  603. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  604. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  605. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  606. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  607. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  608. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  609. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  610. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  611. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  612. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  613. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  614. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  615. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  616. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  617. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  618. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  619. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  620. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  621. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  622. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  623. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  624. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  625. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  626. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  627. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  628. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  629. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  630. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  631. HTT_STATS_MAX_TAG,
  632. } htt_tlv_tag_t;
  633. #define HTT_STATS_TLV_TAG_M 0x00000fff
  634. #define HTT_STATS_TLV_TAG_S 0
  635. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  636. #define HTT_STATS_TLV_LENGTH_S 12
  637. #define HTT_STATS_TLV_TAG_GET(_var) \
  638. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  639. HTT_STATS_TLV_TAG_S)
  640. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  641. do { \
  642. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  643. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  644. } while (0)
  645. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  646. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  647. HTT_STATS_TLV_LENGTH_S)
  648. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  649. do { \
  650. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  651. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  652. } while (0)
  653. /*=== host -> target messages ===============================================*/
  654. enum htt_h2t_msg_type {
  655. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  656. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  657. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  658. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  659. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  660. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  661. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  662. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  663. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  664. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  665. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  666. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  667. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  668. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  669. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  670. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  671. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  672. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  673. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  674. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  675. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  676. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  677. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  678. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  679. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  680. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  681. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  682. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  683. /* keep this last */
  684. HTT_H2T_NUM_MSGS
  685. };
  686. /*
  687. * HTT host to target message type -
  688. * stored in bits 7:0 of the first word of the message
  689. */
  690. #define HTT_H2T_MSG_TYPE_M 0xff
  691. #define HTT_H2T_MSG_TYPE_S 0
  692. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  693. do { \
  694. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  695. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  696. } while (0)
  697. #define HTT_H2T_MSG_TYPE_GET(word) \
  698. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  699. /**
  700. * @brief host -> target version number request message definition
  701. *
  702. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  703. *
  704. *
  705. * |31 24|23 16|15 8|7 0|
  706. * |----------------+----------------+----------------+----------------|
  707. * | reserved | msg type |
  708. * |-------------------------------------------------------------------|
  709. * : option request TLV (optional) |
  710. * :...................................................................:
  711. *
  712. * The VER_REQ message may consist of a single 4-byte word, or may be
  713. * extended with TLVs that specify which HTT options the host is requesting
  714. * from the target.
  715. * The following option TLVs may be appended to the VER_REQ message:
  716. * - HL_SUPPRESS_TX_COMPL_IND
  717. * - HL_MAX_TX_QUEUE_GROUPS
  718. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  719. * may be appended to the VER_REQ message (but only one TLV of each type).
  720. *
  721. * Header fields:
  722. * - MSG_TYPE
  723. * Bits 7:0
  724. * Purpose: identifies this as a version number request message
  725. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  726. */
  727. #define HTT_VER_REQ_BYTES 4
  728. /* TBDXXX: figure out a reasonable number */
  729. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  730. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  731. /**
  732. * @brief HTT tx MSDU descriptor
  733. *
  734. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  735. *
  736. * @details
  737. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  738. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  739. * the target firmware needs for the FW's tx processing, particularly
  740. * for creating the HW msdu descriptor.
  741. * The same HTT tx descriptor is used for HL and LL systems, though
  742. * a few fields within the tx descriptor are used only by LL or
  743. * only by HL.
  744. * The HTT tx descriptor is defined in two manners: by a struct with
  745. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  746. * definitions.
  747. * The target should use the struct def, for simplicitly and clarity,
  748. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  749. * neutral. Specifically, the host shall use the get/set macros built
  750. * around the mask + shift defs.
  751. */
  752. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  753. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  754. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  755. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  756. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  757. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  758. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  759. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  760. #define HTT_TX_VDEV_ID_WORD 0
  761. #define HTT_TX_VDEV_ID_MASK 0x3f
  762. #define HTT_TX_VDEV_ID_SHIFT 16
  763. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  764. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  765. #define HTT_TX_MSDU_LEN_DWORD 1
  766. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  767. /*
  768. * HTT_VAR_PADDR macros
  769. * Allow physical / bus addresses to be either a single 32-bit value,
  770. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  771. */
  772. #define HTT_VAR_PADDR32(var_name) \
  773. A_UINT32 var_name
  774. #define HTT_VAR_PADDR64_LE(var_name) \
  775. struct { \
  776. /* little-endian: lo precedes hi */ \
  777. A_UINT32 lo; \
  778. A_UINT32 hi; \
  779. } var_name
  780. /*
  781. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  782. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  783. * addresses are stored in a XXX-bit field.
  784. * This macro is used to define both htt_tx_msdu_desc32_t and
  785. * htt_tx_msdu_desc64_t structs.
  786. */
  787. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  788. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  789. { \
  790. /* DWORD 0: flags and meta-data */ \
  791. A_UINT32 \
  792. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  793. \
  794. /* pkt_subtype - \
  795. * Detailed specification of the tx frame contents, extending the \
  796. * general specification provided by pkt_type. \
  797. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  798. * pkt_type | pkt_subtype \
  799. * ============================================================== \
  800. * 802.3 | bit 0:3 - Reserved \
  801. * | bit 4: 0x0 - Copy-Engine Classification Results \
  802. * | not appended to the HTT message \
  803. * | 0x1 - Copy-Engine Classification Results \
  804. * | appended to the HTT message in the \
  805. * | format: \
  806. * | [HTT tx desc, frame header, \
  807. * | CE classification results] \
  808. * | The CE classification results begin \
  809. * | at the next 4-byte boundary after \
  810. * | the frame header. \
  811. * ------------+------------------------------------------------- \
  812. * Eth2 | bit 0:3 - Reserved \
  813. * | bit 4: 0x0 - Copy-Engine Classification Results \
  814. * | not appended to the HTT message \
  815. * | 0x1 - Copy-Engine Classification Results \
  816. * | appended to the HTT message. \
  817. * | See the above specification of the \
  818. * | CE classification results location. \
  819. * ------------+------------------------------------------------- \
  820. * native WiFi | bit 0:3 - Reserved \
  821. * | bit 4: 0x0 - Copy-Engine Classification Results \
  822. * | not appended to the HTT message \
  823. * | 0x1 - Copy-Engine Classification Results \
  824. * | appended to the HTT message. \
  825. * | See the above specification of the \
  826. * | CE classification results location. \
  827. * ------------+------------------------------------------------- \
  828. * mgmt | 0x0 - 802.11 MAC header absent \
  829. * | 0x1 - 802.11 MAC header present \
  830. * ------------+------------------------------------------------- \
  831. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  832. * | 0x1 - 802.11 MAC header present \
  833. * | bit 1: 0x0 - allow aggregation \
  834. * | 0x1 - don't allow aggregation \
  835. * | bit 2: 0x0 - perform encryption \
  836. * | 0x1 - don't perform encryption \
  837. * | bit 3: 0x0 - perform tx classification / queuing \
  838. * | 0x1 - don't perform tx classification; \
  839. * | insert the frame into the "misc" \
  840. * | tx queue \
  841. * | bit 4: 0x0 - Copy-Engine Classification Results \
  842. * | not appended to the HTT message \
  843. * | 0x1 - Copy-Engine Classification Results \
  844. * | appended to the HTT message. \
  845. * | See the above specification of the \
  846. * | CE classification results location. \
  847. */ \
  848. pkt_subtype: 5, \
  849. \
  850. /* pkt_type - \
  851. * General specification of the tx frame contents. \
  852. * The htt_pkt_type enum should be used to specify and check the \
  853. * value of this field. \
  854. */ \
  855. pkt_type: 3, \
  856. \
  857. /* vdev_id - \
  858. * ID for the vdev that is sending this tx frame. \
  859. * For certain non-standard packet types, e.g. pkt_type == raw \
  860. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  861. * This field is used primarily for determining where to queue \
  862. * broadcast and multicast frames. \
  863. */ \
  864. vdev_id: 6, \
  865. /* ext_tid - \
  866. * The extended traffic ID. \
  867. * If the TID is unknown, the extended TID is set to \
  868. * HTT_TX_EXT_TID_INVALID. \
  869. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  870. * value of the QoS TID. \
  871. * If the tx frame is non-QoS data, then the extended TID is set to \
  872. * HTT_TX_EXT_TID_NON_QOS. \
  873. * If the tx frame is multicast or broadcast, then the extended TID \
  874. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  875. */ \
  876. ext_tid: 5, \
  877. \
  878. /* postponed - \
  879. * This flag indicates whether the tx frame has been downloaded to \
  880. * the target before but discarded by the target, and now is being \
  881. * downloaded again; or if this is a new frame that is being \
  882. * downloaded for the first time. \
  883. * This flag allows the target to determine the correct order for \
  884. * transmitting new vs. old frames. \
  885. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  886. * This flag only applies to HL systems, since in LL systems, \
  887. * the tx flow control is handled entirely within the target. \
  888. */ \
  889. postponed: 1, \
  890. \
  891. /* extension - \
  892. * This flag indicates whether a HTT tx MSDU extension descriptor \
  893. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  894. * \
  895. * 0x0 - no extension MSDU descriptor is present \
  896. * 0x1 - an extension MSDU descriptor immediately follows the \
  897. * regular MSDU descriptor \
  898. */ \
  899. extension: 1, \
  900. \
  901. /* cksum_offload - \
  902. * This flag indicates whether checksum offload is enabled or not \
  903. * for this frame. Target FW use this flag to turn on HW checksumming \
  904. * 0x0 - No checksum offload \
  905. * 0x1 - L3 header checksum only \
  906. * 0x2 - L4 checksum only \
  907. * 0x3 - L3 header checksum + L4 checksum \
  908. */ \
  909. cksum_offload: 2, \
  910. \
  911. /* tx_comp_req - \
  912. * This flag indicates whether Tx Completion \
  913. * from fw is required or not. \
  914. * This flag is only relevant if tx completion is not \
  915. * universally enabled. \
  916. * For all LL systems, tx completion is mandatory, \
  917. * so this flag will be irrelevant. \
  918. * For HL systems tx completion is optional, but HL systems in which \
  919. * the bus throughput exceeds the WLAN throughput will \
  920. * probably want to always use tx completion, and thus \
  921. * would not check this flag. \
  922. * This flag is required when tx completions are not used universally, \
  923. * but are still required for certain tx frames for which \
  924. * an OTA delivery acknowledgment is needed by the host. \
  925. * In practice, this would be for HL systems in which the \
  926. * bus throughput is less than the WLAN throughput. \
  927. * \
  928. * 0x0 - Tx Completion Indication from Fw not required \
  929. * 0x1 - Tx Completion Indication from Fw is required \
  930. */ \
  931. tx_compl_req: 1; \
  932. \
  933. \
  934. /* DWORD 1: MSDU length and ID */ \
  935. A_UINT32 \
  936. len: 16, /* MSDU length, in bytes */ \
  937. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  938. * and this id is used to calculate fragmentation \
  939. * descriptor pointer inside the target based on \
  940. * the base address, configured inside the target. \
  941. */ \
  942. \
  943. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  944. /* frags_desc_ptr - \
  945. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  946. * where the tx frame's fragments reside in memory. \
  947. * This field only applies to LL systems, since in HL systems the \
  948. * (degenerate single-fragment) fragmentation descriptor is created \
  949. * within the target. \
  950. */ \
  951. _paddr__frags_desc_ptr_; \
  952. \
  953. /* DWORD 3 (or 4): peerid, chanfreq */ \
  954. /* \
  955. * Peer ID : Target can use this value to know which peer-id packet \
  956. * destined to. \
  957. * It's intended to be specified by host in case of NAWDS. \
  958. */ \
  959. A_UINT16 peerid; \
  960. \
  961. /* \
  962. * Channel frequency: This identifies the desired channel \
  963. * frequency (in mhz) for tx frames. This is used by FW to help \
  964. * determine when it is safe to transmit or drop frames for \
  965. * off-channel operation. \
  966. * The default value of zero indicates to FW that the corresponding \
  967. * VDEV's home channel (if there is one) is the desired channel \
  968. * frequency. \
  969. */ \
  970. A_UINT16 chanfreq; \
  971. \
  972. /* Reason reserved is commented is increasing the htt structure size \
  973. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  974. * A_UINT32 reserved_dword3_bits0_31; \
  975. */ \
  976. } POSTPACK
  977. /* define a htt_tx_msdu_desc32_t type */
  978. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  979. /* define a htt_tx_msdu_desc64_t type */
  980. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  981. /*
  982. * Make htt_tx_msdu_desc_t be an alias for either
  983. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  984. */
  985. #if HTT_PADDR64
  986. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  987. #else
  988. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  989. #endif
  990. /* decriptor information for Management frame*/
  991. /*
  992. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  993. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  994. */
  995. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  996. extern A_UINT32 mgmt_hdr_len;
  997. PREPACK struct htt_mgmt_tx_desc_t {
  998. A_UINT32 msg_type;
  999. #if HTT_PADDR64
  1000. A_UINT64 frag_paddr; /* DMAble address of the data */
  1001. #else
  1002. A_UINT32 frag_paddr; /* DMAble address of the data */
  1003. #endif
  1004. A_UINT32 desc_id; /* returned to host during completion
  1005. * to free the meory*/
  1006. A_UINT32 len; /* Fragment length */
  1007. A_UINT32 vdev_id; /* virtual device ID*/
  1008. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1009. } POSTPACK;
  1010. PREPACK struct htt_mgmt_tx_compl_ind {
  1011. A_UINT32 desc_id;
  1012. A_UINT32 status;
  1013. } POSTPACK;
  1014. /*
  1015. * This SDU header size comes from the summation of the following:
  1016. * 1. Max of:
  1017. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1018. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1019. * b. 802.11 header, for raw frames: 36 bytes
  1020. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1021. * QoS header, HT header)
  1022. * c. 802.3 header, for ethernet frames: 14 bytes
  1023. * (destination address, source address, ethertype / length)
  1024. * 2. Max of:
  1025. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1026. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1027. * 3. 802.1Q VLAN header: 4 bytes
  1028. * 4. LLC/SNAP header: 8 bytes
  1029. */
  1030. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1031. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1032. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1033. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1034. A_COMPILE_TIME_ASSERT(
  1035. htt_encap_hdr_size_max_check_nwifi,
  1036. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1037. A_COMPILE_TIME_ASSERT(
  1038. htt_encap_hdr_size_max_check_enet,
  1039. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1040. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1041. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1042. #define HTT_TX_HDR_SIZE_802_1Q 4
  1043. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1044. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1045. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1046. HTT_TX_HDR_SIZE_802_1Q + \
  1047. HTT_TX_HDR_SIZE_LLC_SNAP)
  1048. #define HTT_HL_TX_FRM_HDR_LEN \
  1049. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1050. #define HTT_LL_TX_FRM_HDR_LEN \
  1051. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1052. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1053. /* dword 0 */
  1054. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1055. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1056. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1057. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1058. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1059. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1060. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1061. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1062. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1063. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1064. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1065. #define HTT_TX_DESC_PKT_TYPE_S 13
  1066. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1067. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1068. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1069. #define HTT_TX_DESC_VDEV_ID_S 16
  1070. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1071. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1072. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1073. #define HTT_TX_DESC_EXT_TID_S 22
  1074. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1075. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1076. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1077. #define HTT_TX_DESC_POSTPONED_S 27
  1078. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1079. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1080. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1081. #define HTT_TX_DESC_EXTENSION_S 28
  1082. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1083. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1084. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1085. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1086. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1087. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1088. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1089. #define HTT_TX_DESC_TX_COMP_S 31
  1090. /* dword 1 */
  1091. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1092. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1093. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1094. #define HTT_TX_DESC_FRM_LEN_S 0
  1095. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1096. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1097. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1098. #define HTT_TX_DESC_FRM_ID_S 16
  1099. /* dword 2 */
  1100. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1101. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1102. /* for systems using 64-bit format for bus addresses */
  1103. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1104. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1105. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1106. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1107. /* for systems using 32-bit format for bus addresses */
  1108. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1109. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1110. /* dword 3 */
  1111. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1112. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1113. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1114. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1115. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1116. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1117. #if HTT_PADDR64
  1118. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1119. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1120. #else
  1121. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1122. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1123. #endif
  1124. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1125. #define HTT_TX_DESC_PEER_ID_S 0
  1126. /*
  1127. * TEMPORARY:
  1128. * The original definitions for the PEER_ID fields contained typos
  1129. * (with _DESC_PADDR appended to this PEER_ID field name).
  1130. * Retain deprecated original names for PEER_ID fields until all code that
  1131. * refers to them has been updated.
  1132. */
  1133. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1134. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1135. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1136. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1137. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1138. HTT_TX_DESC_PEER_ID_M
  1139. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1140. HTT_TX_DESC_PEER_ID_S
  1141. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1142. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1143. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1144. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1145. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1146. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1147. #if HTT_PADDR64
  1148. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1149. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1150. #else
  1151. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1152. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1153. #endif
  1154. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1155. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1156. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1157. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1158. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1159. do { \
  1160. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1161. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1162. } while (0)
  1163. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1164. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1165. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1166. do { \
  1167. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1168. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1169. } while (0)
  1170. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1171. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1172. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1173. do { \
  1174. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1175. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1176. } while (0)
  1177. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1178. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1179. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1180. do { \
  1181. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1182. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1183. } while (0)
  1184. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1185. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1186. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1187. do { \
  1188. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1189. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1190. } while (0)
  1191. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1192. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1193. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1194. do { \
  1195. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1196. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1197. } while (0)
  1198. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1199. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1200. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1201. do { \
  1202. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1203. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1204. } while (0)
  1205. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1206. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1207. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1208. do { \
  1209. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1210. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1211. } while (0)
  1212. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1213. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1214. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1215. do { \
  1216. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1217. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1218. } while (0)
  1219. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1220. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1221. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1222. do { \
  1223. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1224. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1225. } while (0)
  1226. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1227. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1228. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1229. do { \
  1230. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1231. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1232. } while (0)
  1233. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1234. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1235. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1236. do { \
  1237. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1238. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1239. } while (0)
  1240. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1241. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1242. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1243. do { \
  1244. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1245. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1246. } while (0)
  1247. /* enums used in the HTT tx MSDU extension descriptor */
  1248. enum {
  1249. htt_tx_guard_interval_regular = 0,
  1250. htt_tx_guard_interval_short = 1,
  1251. };
  1252. enum {
  1253. htt_tx_preamble_type_ofdm = 0,
  1254. htt_tx_preamble_type_cck = 1,
  1255. htt_tx_preamble_type_ht = 2,
  1256. htt_tx_preamble_type_vht = 3,
  1257. };
  1258. enum {
  1259. htt_tx_bandwidth_5MHz = 0,
  1260. htt_tx_bandwidth_10MHz = 1,
  1261. htt_tx_bandwidth_20MHz = 2,
  1262. htt_tx_bandwidth_40MHz = 3,
  1263. htt_tx_bandwidth_80MHz = 4,
  1264. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1265. };
  1266. /**
  1267. * @brief HTT tx MSDU extension descriptor
  1268. * @details
  1269. * If the target supports HTT tx MSDU extension descriptors, the host has
  1270. * the option of appending the following struct following the regular
  1271. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1272. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1273. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1274. * tx specs for each frame.
  1275. */
  1276. PREPACK struct htt_tx_msdu_desc_ext_t {
  1277. /* DWORD 0: flags */
  1278. A_UINT32
  1279. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1280. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1281. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1282. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1283. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1284. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1285. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1286. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1287. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1288. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1289. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1290. /* DWORD 1: tx power, tx rate, tx BW */
  1291. A_UINT32
  1292. /* pwr -
  1293. * Specify what power the tx frame needs to be transmitted at.
  1294. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1295. * The value needs to be appropriately sign-extended when extracting
  1296. * the value from the message and storing it in a variable that is
  1297. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1298. * automatically handles this sign-extension.)
  1299. * If the transmission uses multiple tx chains, this power spec is
  1300. * the total transmit power, assuming incoherent combination of
  1301. * per-chain power to produce the total power.
  1302. */
  1303. pwr: 8,
  1304. /* mcs_mask -
  1305. * Specify the allowable values for MCS index (modulation and coding)
  1306. * to use for transmitting the frame.
  1307. *
  1308. * For HT / VHT preamble types, this mask directly corresponds to
  1309. * the HT or VHT MCS indices that are allowed. For each bit N set
  1310. * within the mask, MCS index N is allowed for transmitting the frame.
  1311. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1312. * rates versus OFDM rates, so the host has the option of specifying
  1313. * that the target must transmit the frame with CCK or OFDM rates
  1314. * (not HT or VHT), but leaving the decision to the target whether
  1315. * to use CCK or OFDM.
  1316. *
  1317. * For CCK and OFDM, the bits within this mask are interpreted as
  1318. * follows:
  1319. * bit 0 -> CCK 1 Mbps rate is allowed
  1320. * bit 1 -> CCK 2 Mbps rate is allowed
  1321. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1322. * bit 3 -> CCK 11 Mbps rate is allowed
  1323. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1324. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1325. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1326. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1327. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1328. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1329. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1330. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1331. *
  1332. * The MCS index specification needs to be compatible with the
  1333. * bandwidth mask specification. For example, a MCS index == 9
  1334. * specification is inconsistent with a preamble type == VHT,
  1335. * Nss == 1, and channel bandwidth == 20 MHz.
  1336. *
  1337. * Furthermore, the host has only a limited ability to specify to
  1338. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1339. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1340. */
  1341. mcs_mask: 12,
  1342. /* nss_mask -
  1343. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1344. * Each bit in this mask corresponds to a Nss value:
  1345. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1346. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1347. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1348. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1349. * The values in the Nss mask must be suitable for the recipient, e.g.
  1350. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1351. * recipient which only supports 2x2 MIMO.
  1352. */
  1353. nss_mask: 4,
  1354. /* guard_interval -
  1355. * Specify a htt_tx_guard_interval enum value to indicate whether
  1356. * the transmission should use a regular guard interval or a
  1357. * short guard interval.
  1358. */
  1359. guard_interval: 1,
  1360. /* preamble_type_mask -
  1361. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1362. * may choose from for transmitting this frame.
  1363. * The bits in this mask correspond to the values in the
  1364. * htt_tx_preamble_type enum. For example, to allow the target
  1365. * to transmit the frame as either CCK or OFDM, this field would
  1366. * be set to
  1367. * (1 << htt_tx_preamble_type_ofdm) |
  1368. * (1 << htt_tx_preamble_type_cck)
  1369. */
  1370. preamble_type_mask: 4,
  1371. reserved1_31_29: 3; /* unused, set to 0x0 */
  1372. /* DWORD 2: tx chain mask, tx retries */
  1373. A_UINT32
  1374. /* chain_mask - specify which chains to transmit from */
  1375. chain_mask: 4,
  1376. /* retry_limit -
  1377. * Specify the maximum number of transmissions, including the
  1378. * initial transmission, to attempt before giving up if no ack
  1379. * is received.
  1380. * If the tx rate is specified, then all retries shall use the
  1381. * same rate as the initial transmission.
  1382. * If no tx rate is specified, the target can choose whether to
  1383. * retain the original rate during the retransmissions, or to
  1384. * fall back to a more robust rate.
  1385. */
  1386. retry_limit: 4,
  1387. /* bandwidth_mask -
  1388. * Specify what channel widths may be used for the transmission.
  1389. * A value of zero indicates "don't care" - the target may choose
  1390. * the transmission bandwidth.
  1391. * The bits within this mask correspond to the htt_tx_bandwidth
  1392. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1393. * The bandwidth_mask must be consistent with the preamble_type_mask
  1394. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1395. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1396. */
  1397. bandwidth_mask: 6,
  1398. reserved2_31_14: 18; /* unused, set to 0x0 */
  1399. /* DWORD 3: tx expiry time (TSF) LSBs */
  1400. A_UINT32 expire_tsf_lo;
  1401. /* DWORD 4: tx expiry time (TSF) MSBs */
  1402. A_UINT32 expire_tsf_hi;
  1403. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1404. } POSTPACK;
  1405. /* DWORD 0 */
  1406. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1407. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1408. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1409. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1410. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1411. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1412. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1413. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1414. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1415. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1416. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1417. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1418. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1419. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1420. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1421. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1422. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1423. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1424. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1425. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1426. /* DWORD 1 */
  1427. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1428. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1429. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1430. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1431. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1432. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1433. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1434. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1435. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1436. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1437. /* DWORD 2 */
  1438. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1439. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1440. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1441. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1442. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1443. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1444. /* DWORD 0 */
  1445. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1446. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1447. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1448. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1449. do { \
  1450. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1451. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1452. } while (0)
  1453. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1454. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1455. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1456. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1457. do { \
  1458. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1459. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1460. } while (0)
  1461. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1462. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1463. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1464. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1465. do { \
  1466. HTT_CHECK_SET_VAL( \
  1467. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1468. ((_var) |= ((_val) \
  1469. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1470. } while (0)
  1471. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1472. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1473. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1474. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1475. do { \
  1476. HTT_CHECK_SET_VAL( \
  1477. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1478. ((_var) |= ((_val) \
  1479. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1480. } while (0)
  1481. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1482. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1483. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1484. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1485. do { \
  1486. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1487. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1488. } while (0)
  1489. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1490. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1491. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1492. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1493. do { \
  1494. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1495. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1496. } while (0)
  1497. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1498. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1499. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1500. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1501. do { \
  1502. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1503. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1504. } while (0)
  1505. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1506. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1507. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1508. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1509. do { \
  1510. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1511. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1512. } while (0)
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1514. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1515. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1517. do { \
  1518. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1519. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1520. } while (0)
  1521. /* DWORD 1 */
  1522. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1523. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1524. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1525. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1526. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1527. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1528. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1529. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1530. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1531. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1532. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1533. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1534. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1535. do { \
  1536. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1537. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1538. } while (0)
  1539. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1540. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1541. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1542. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1543. do { \
  1544. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1545. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1546. } while (0)
  1547. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1548. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1549. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1550. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1551. do { \
  1552. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1553. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1554. } while (0)
  1555. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1556. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1557. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1558. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1559. do { \
  1560. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1561. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1562. } while (0)
  1563. /* DWORD 2 */
  1564. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1565. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1566. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1567. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1568. do { \
  1569. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1570. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1571. } while (0)
  1572. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1573. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1574. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1575. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1576. do { \
  1577. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1578. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1579. } while (0)
  1580. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1581. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1582. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1583. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1584. do { \
  1585. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1586. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1587. } while (0)
  1588. typedef enum {
  1589. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1590. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1591. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1592. } htt_11ax_ltf_subtype_t;
  1593. typedef enum {
  1594. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1595. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1596. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1597. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1598. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1599. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1600. } htt_tx_ext2_preamble_type_t;
  1601. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1602. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1603. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1604. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1605. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1606. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1607. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1608. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1609. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1610. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1611. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1612. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1613. /**
  1614. * @brief HTT tx MSDU extension descriptor v2
  1615. * @details
  1616. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1617. * is received as tcl_exit_base->host_meta_info in firmware.
  1618. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1619. * are already part of tcl_exit_base.
  1620. */
  1621. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1622. /* DWORD 0: flags */
  1623. A_UINT32
  1624. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1625. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1626. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1627. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1628. valid_retries : 1, /* if set, tx retries spec is valid */
  1629. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1630. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1631. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1632. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1633. valid_key_flags : 1, /* if set, key flags is valid */
  1634. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1635. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1636. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1637. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1638. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1639. 1 = ENCRYPT,
  1640. 2 ~ 3 - Reserved */
  1641. /* retry_limit -
  1642. * Specify the maximum number of transmissions, including the
  1643. * initial transmission, to attempt before giving up if no ack
  1644. * is received.
  1645. * If the tx rate is specified, then all retries shall use the
  1646. * same rate as the initial transmission.
  1647. * If no tx rate is specified, the target can choose whether to
  1648. * retain the original rate during the retransmissions, or to
  1649. * fall back to a more robust rate.
  1650. */
  1651. retry_limit : 4,
  1652. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1653. * Valid only for 11ax preamble types HE_SU
  1654. * and HE_EXT_SU
  1655. */
  1656. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1657. * Valid only for 11ax preamble types HE_SU
  1658. * and HE_EXT_SU
  1659. */
  1660. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1661. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1662. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1663. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1664. */
  1665. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1666. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1667. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1668. * Use cases:
  1669. * Any time firmware uses TQM-BYPASS for Data
  1670. * TID, firmware expect host to set this bit.
  1671. */
  1672. /* DWORD 1: tx power, tx rate */
  1673. A_UINT32
  1674. power : 8, /* unit of the power field is 0.5 dbm
  1675. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1676. * signed value ranging from -64dbm to 63.5 dbm
  1677. */
  1678. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1679. * Setting more than one MCS isn't currently
  1680. * supported by the target (but is supported
  1681. * in the interface in case in the future
  1682. * the target supports specifications of
  1683. * a limited set of MCS values.
  1684. */
  1685. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1686. * Setting more than one Nss isn't currently
  1687. * supported by the target (but is supported
  1688. * in the interface in case in the future
  1689. * the target supports specifications of
  1690. * a limited set of Nss values.
  1691. */
  1692. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1693. update_peer_cache : 1; /* When set these custom values will be
  1694. * used for all packets, until the next
  1695. * update via this ext header.
  1696. * This is to make sure not all packets
  1697. * need to include this header.
  1698. */
  1699. /* DWORD 2: tx chain mask, tx retries */
  1700. A_UINT32
  1701. /* chain_mask - specify which chains to transmit from */
  1702. chain_mask : 8,
  1703. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1704. * TODO: Update Enum values for key_flags
  1705. */
  1706. /*
  1707. * Channel frequency: This identifies the desired channel
  1708. * frequency (in MHz) for tx frames. This is used by FW to help
  1709. * determine when it is safe to transmit or drop frames for
  1710. * off-channel operation.
  1711. * The default value of zero indicates to FW that the corresponding
  1712. * VDEV's home channel (if there is one) is the desired channel
  1713. * frequency.
  1714. */
  1715. chanfreq : 16;
  1716. /* DWORD 3: tx expiry time (TSF) LSBs */
  1717. A_UINT32 expire_tsf_lo;
  1718. /* DWORD 4: tx expiry time (TSF) MSBs */
  1719. A_UINT32 expire_tsf_hi;
  1720. /* DWORD 5: flags to control routing / processing of the MSDU */
  1721. A_UINT32
  1722. /* learning_frame
  1723. * When this flag is set, this frame will be dropped by FW
  1724. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1725. */
  1726. learning_frame : 1,
  1727. /* send_as_standalone
  1728. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1729. * i.e. with no A-MSDU or A-MPDU aggregation.
  1730. * The scope is extended to other use-cases.
  1731. */
  1732. send_as_standalone : 1,
  1733. /* is_host_opaque_valid
  1734. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1735. * with valid information.
  1736. */
  1737. is_host_opaque_valid : 1,
  1738. rsvd0 : 29;
  1739. /* DWORD 6 : Host opaque cookie for special frames */
  1740. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1741. rsvd1 : 16;
  1742. /*
  1743. * This structure can be expanded further up to 40 bytes
  1744. * by adding further DWORDs as needed.
  1745. */
  1746. } POSTPACK;
  1747. /* DWORD 0 */
  1748. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1749. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1750. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1751. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1752. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1753. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1754. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1755. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1756. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1757. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1758. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1759. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1760. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1761. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1762. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1763. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1764. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1765. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1766. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1767. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1768. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1769. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1770. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1771. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1772. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1773. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1774. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1775. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1776. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1777. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1778. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1779. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1780. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1781. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1782. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1783. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1784. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1785. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1786. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1787. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1788. /* DWORD 1 */
  1789. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1790. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1791. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1792. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1793. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1794. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1795. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1796. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1797. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1798. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1799. /* DWORD 2 */
  1800. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1801. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1802. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1803. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1804. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1805. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1806. /* DWORD 5 */
  1807. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1808. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1809. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1810. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1811. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1812. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1813. /* DWORD 6 */
  1814. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1815. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1816. /* DWORD 0 */
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1818. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1819. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1821. do { \
  1822. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1823. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1824. } while (0)
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1826. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1827. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1828. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1829. do { \
  1830. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1831. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1832. } while (0)
  1833. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1834. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1835. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1836. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1837. do { \
  1838. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1839. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1840. } while (0)
  1841. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1842. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1843. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1844. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1845. do { \
  1846. HTT_CHECK_SET_VAL( \
  1847. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1848. ((_var) |= ((_val) \
  1849. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1850. } while (0)
  1851. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1852. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1853. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1854. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1855. do { \
  1856. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1857. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1858. } while (0)
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1860. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1861. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1863. do { \
  1864. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1865. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1866. } while (0)
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1868. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1869. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1871. do { \
  1872. HTT_CHECK_SET_VAL( \
  1873. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1874. ((_var) |= ((_val) \
  1875. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1876. } while (0)
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1878. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1879. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1881. do { \
  1882. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1883. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1884. } while (0)
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1886. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1887. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1889. do { \
  1890. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1891. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1892. } while (0)
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1894. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1895. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1897. do { \
  1898. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1899. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1900. } while (0)
  1901. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1902. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1903. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1904. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1905. do { \
  1906. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1907. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1908. } while (0)
  1909. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1910. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1911. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1912. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1913. do { \
  1914. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1915. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1916. } while (0)
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1918. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1919. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1920. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1921. do { \
  1922. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1923. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1924. } while (0)
  1925. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1926. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1927. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1928. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1929. do { \
  1930. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1931. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1932. } while (0)
  1933. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1934. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1935. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1936. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1937. do { \
  1938. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1939. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1940. } while (0)
  1941. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1942. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1943. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1944. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1945. do { \
  1946. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1947. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1948. } while (0)
  1949. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1950. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1951. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1952. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1953. do { \
  1954. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1955. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1956. } while (0)
  1957. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1958. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1959. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1960. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1961. do { \
  1962. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1963. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1964. } while (0)
  1965. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1966. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1967. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1968. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1969. do { \
  1970. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1971. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1972. } while (0)
  1973. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1974. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1975. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1976. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1977. do { \
  1978. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1979. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1980. } while (0)
  1981. /* DWORD 1 */
  1982. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1983. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1984. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1985. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1986. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1987. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1988. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1989. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1990. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1991. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1992. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1993. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1994. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  1995. do { \
  1996. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  1997. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  1998. } while (0)
  1999. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2000. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2001. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2002. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2003. do { \
  2004. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2005. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2006. } while (0)
  2007. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2008. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2009. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2010. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2011. do { \
  2012. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2013. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2014. } while (0)
  2015. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2016. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2017. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2018. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2019. do { \
  2020. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2021. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2022. } while (0)
  2023. /* DWORD 2 */
  2024. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2025. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2026. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2027. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2028. do { \
  2029. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2030. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2031. } while (0)
  2032. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2033. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2034. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2035. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2036. do { \
  2037. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2038. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2039. } while (0)
  2040. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2041. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2042. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2043. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2044. do { \
  2045. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2046. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2047. } while (0)
  2048. /* DWORD 5 */
  2049. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2050. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2051. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2052. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2053. do { \
  2054. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2055. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2056. } while (0)
  2057. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2058. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2059. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2060. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2061. do { \
  2062. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2063. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2064. } while (0)
  2065. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2066. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2067. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2068. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2069. do { \
  2070. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2071. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2072. } while (0)
  2073. /* DWORD 6 */
  2074. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2075. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2076. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2077. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2078. do { \
  2079. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2080. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2081. } while (0)
  2082. typedef enum {
  2083. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2084. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2085. } htt_tcl_metadata_type;
  2086. /**
  2087. * @brief HTT TCL command number format
  2088. * @details
  2089. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2090. * available to firmware as tcl_exit_base->tcl_status_number.
  2091. * For regular / multicast packets host will send vdev and mac id and for
  2092. * NAWDS packets, host will send peer id.
  2093. * A_UINT32 is used to avoid endianness conversion problems.
  2094. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2095. */
  2096. typedef struct {
  2097. A_UINT32
  2098. type: 1, /* vdev_id based or peer_id based */
  2099. rsvd: 31;
  2100. } htt_tx_tcl_vdev_or_peer_t;
  2101. typedef struct {
  2102. A_UINT32
  2103. type: 1, /* vdev_id based or peer_id based */
  2104. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2105. vdev_id: 8,
  2106. pdev_id: 2,
  2107. host_inspected:1,
  2108. rsvd: 19;
  2109. } htt_tx_tcl_vdev_metadata;
  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. peer_id: 14,
  2115. rsvd: 16;
  2116. } htt_tx_tcl_peer_metadata;
  2117. PREPACK struct htt_tx_tcl_metadata {
  2118. union {
  2119. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2120. htt_tx_tcl_vdev_metadata vdev_meta;
  2121. htt_tx_tcl_peer_metadata peer_meta;
  2122. };
  2123. } POSTPACK;
  2124. /* DWORD 0 */
  2125. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2126. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2127. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2128. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2129. /* VDEV metadata */
  2130. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2131. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2132. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2133. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2134. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2135. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2136. /* PEER metadata */
  2137. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2138. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2139. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2140. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2141. HTT_TX_TCL_METADATA_TYPE_S)
  2142. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2143. do { \
  2144. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2145. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2146. } while (0)
  2147. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2148. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2149. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2150. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2151. do { \
  2152. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2153. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2154. } while (0)
  2155. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2156. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2157. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2158. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2159. do { \
  2160. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2161. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2162. } while (0)
  2163. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2164. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2165. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2166. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2167. do { \
  2168. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2169. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2170. } while (0)
  2171. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2172. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2173. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2174. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2175. do { \
  2176. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2177. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2178. } while (0)
  2179. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2180. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2181. HTT_TX_TCL_METADATA_PEER_ID_S)
  2182. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2183. do { \
  2184. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2185. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2186. } while (0)
  2187. typedef enum {
  2188. HTT_TX_FW2WBM_TX_STATUS_OK,
  2189. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2190. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2191. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2192. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2193. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2194. HTT_TX_FW2WBM_TX_STATUS_MAX
  2195. } htt_tx_fw2wbm_tx_status_t;
  2196. typedef enum {
  2197. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2198. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2199. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2200. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2201. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2202. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2203. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2204. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2205. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2206. } htt_tx_fw2wbm_reinject_reason_t;
  2207. /**
  2208. * @brief HTT TX WBM Completion from firmware to host
  2209. * @details
  2210. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2211. * DWORD 3 and 4 for software based completions (Exception frames and
  2212. * TQM bypass frames)
  2213. * For software based completions, wbm_release_ring->release_source_module will
  2214. * be set to release_source_fw
  2215. */
  2216. PREPACK struct htt_tx_wbm_completion {
  2217. A_UINT32
  2218. sch_cmd_id: 24,
  2219. exception_frame: 1, /* If set, this packet was queued via exception path */
  2220. rsvd0_31_25: 7;
  2221. A_UINT32
  2222. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2223. * reception of an ACK or BA, this field indicates
  2224. * the RSSI of the received ACK or BA frame.
  2225. * When the frame is removed as result of a direct
  2226. * remove command from the SW, this field is set
  2227. * to 0x0 (which is never a valid value when real
  2228. * RSSI is available).
  2229. * Units: dB w.r.t noise floor
  2230. */
  2231. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2232. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2233. rsvd1_31_16: 16;
  2234. } POSTPACK;
  2235. /* DWORD 0 */
  2236. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2237. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2238. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2239. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2240. /* DWORD 1 */
  2241. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2242. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2243. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2244. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2245. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2246. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2247. /* DWORD 0 */
  2248. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2249. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2250. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2251. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2252. do { \
  2253. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2254. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2255. } while (0)
  2256. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2257. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2258. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2259. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2260. do { \
  2261. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2262. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2263. } while (0)
  2264. /* DWORD 1 */
  2265. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2266. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2267. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2268. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2269. do { \
  2270. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2271. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2272. } while (0)
  2273. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2274. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2275. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2276. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2277. do { \
  2278. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2279. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2280. } while (0)
  2281. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2282. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2283. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2284. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2285. do { \
  2286. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2287. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2288. } while (0)
  2289. /**
  2290. * @brief HTT TX WBM Completion from firmware to host
  2291. * @details
  2292. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2293. * (WBM) offload HW.
  2294. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2295. * For software based completions, release_source_module will
  2296. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2297. * struct wbm_release_ring and then switch to this after looking at
  2298. * release_source_module.
  2299. */
  2300. PREPACK struct htt_tx_wbm_completion_v2 {
  2301. A_UINT32
  2302. used_by_hw0; /* Refer to struct wbm_release_ring */
  2303. A_UINT32
  2304. used_by_hw1; /* Refer to struct wbm_release_ring */
  2305. A_UINT32
  2306. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2307. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2308. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2309. exception_frame: 1,
  2310. rsvd0: 12, /* For future use */
  2311. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2312. rsvd1: 1; /* For future use */
  2313. A_UINT32
  2314. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2315. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2316. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2317. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2318. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2319. */
  2320. A_UINT32
  2321. data1: 32;
  2322. A_UINT32
  2323. data2: 32;
  2324. A_UINT32
  2325. used_by_hw3; /* Refer to struct wbm_release_ring */
  2326. } POSTPACK;
  2327. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2328. /* DWORD 3 */
  2329. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2330. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2331. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2332. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2333. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2334. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2335. /* DWORD 3 */
  2336. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2337. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2338. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2339. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2340. do { \
  2341. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2342. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2343. } while (0)
  2344. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2345. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2346. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2347. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2348. do { \
  2349. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2350. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2351. } while (0)
  2352. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2353. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2354. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2355. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2356. do { \
  2357. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2358. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2359. } while (0)
  2360. /**
  2361. * @brief HTT TX WBM transmit status from firmware to host
  2362. * @details
  2363. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2364. * (WBM) offload HW.
  2365. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2366. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2367. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2368. */
  2369. PREPACK struct htt_tx_wbm_transmit_status {
  2370. A_UINT32
  2371. sch_cmd_id: 24,
  2372. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2373. * reception of an ACK or BA, this field indicates
  2374. * the RSSI of the received ACK or BA frame.
  2375. * When the frame is removed as result of a direct
  2376. * remove command from the SW, this field is set
  2377. * to 0x0 (which is never a valid value when real
  2378. * RSSI is available).
  2379. * Units: dB w.r.t noise floor
  2380. */
  2381. A_UINT32
  2382. sw_peer_id: 16,
  2383. tid_num: 5,
  2384. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2385. * and tid_num fields contain valid data.
  2386. * If this "valid" flag is not set, the
  2387. * sw_peer_id and tid_num fields must be ignored.
  2388. */
  2389. mcast: 1,
  2390. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2391. * contains valid data.
  2392. */
  2393. reserved0: 8;
  2394. A_UINT32
  2395. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2396. * packets in the wbm completion path
  2397. */
  2398. } POSTPACK;
  2399. /* DWORD 4 */
  2400. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2401. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2402. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2403. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2404. /* DWORD 5 */
  2405. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2406. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2407. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2408. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2409. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2410. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2411. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2412. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2413. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2414. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2415. /* DWORD 4 */
  2416. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2417. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2418. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2419. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2420. do { \
  2421. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2422. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2423. } while (0)
  2424. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2425. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2426. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2427. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2428. do { \
  2429. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2430. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2431. } while (0)
  2432. /* DWORD 5 */
  2433. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2434. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2435. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2436. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2437. do { \
  2438. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2439. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2440. } while (0)
  2441. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2442. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2443. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2444. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2445. do { \
  2446. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2447. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2448. } while (0)
  2449. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2450. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2451. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2452. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2453. do { \
  2454. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2455. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2456. } while (0)
  2457. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2458. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2459. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2460. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2461. do { \
  2462. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2463. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2464. } while (0)
  2465. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2466. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2467. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2468. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2469. do { \
  2470. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2471. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2472. } while (0)
  2473. /**
  2474. * @brief HTT TX WBM reinject status from firmware to host
  2475. * @details
  2476. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2477. * (WBM) offload HW.
  2478. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2479. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2480. */
  2481. PREPACK struct htt_tx_wbm_reinject_status {
  2482. A_UINT32
  2483. reserved0: 32;
  2484. A_UINT32
  2485. reserved1: 32;
  2486. A_UINT32
  2487. reserved2: 32;
  2488. } POSTPACK;
  2489. /**
  2490. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2491. * @details
  2492. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2493. * (WBM) offload HW.
  2494. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2495. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2496. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2497. * STA side.
  2498. */
  2499. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2500. A_UINT32
  2501. mec_sa_addr_31_0;
  2502. A_UINT32
  2503. mec_sa_addr_47_32: 16,
  2504. sa_ast_index: 16;
  2505. A_UINT32
  2506. vdev_id: 8,
  2507. reserved0: 24;
  2508. } POSTPACK;
  2509. /* DWORD 4 - mec_sa_addr_31_0 */
  2510. /* DWORD 5 */
  2511. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2512. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2513. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2514. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2515. /* DWORD 6 */
  2516. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2517. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2518. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2519. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2520. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2521. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2522. do { \
  2523. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2524. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2525. } while (0)
  2526. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2527. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2528. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2529. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2530. do { \
  2531. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2532. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2533. } while (0)
  2534. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2535. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2536. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2537. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2538. do { \
  2539. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2540. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2541. } while (0)
  2542. typedef enum {
  2543. TX_FLOW_PRIORITY_BE,
  2544. TX_FLOW_PRIORITY_HIGH,
  2545. TX_FLOW_PRIORITY_LOW,
  2546. } htt_tx_flow_priority_t;
  2547. typedef enum {
  2548. TX_FLOW_LATENCY_SENSITIVE,
  2549. TX_FLOW_LATENCY_INSENSITIVE,
  2550. } htt_tx_flow_latency_t;
  2551. typedef enum {
  2552. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2553. TX_FLOW_INTERACTIVE_TRAFFIC,
  2554. TX_FLOW_PERIODIC_TRAFFIC,
  2555. TX_FLOW_BURSTY_TRAFFIC,
  2556. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2557. } htt_tx_flow_traffic_pattern_t;
  2558. /**
  2559. * @brief HTT TX Flow search metadata format
  2560. * @details
  2561. * Host will set this metadata in flow table's flow search entry along with
  2562. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2563. * firmware and TQM ring if the flow search entry wins.
  2564. * This metadata is available to firmware in that first MSDU's
  2565. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2566. * to one of the available flows for specific tid and returns the tqm flow
  2567. * pointer as part of htt_tx_map_flow_info message.
  2568. */
  2569. PREPACK struct htt_tx_flow_metadata {
  2570. A_UINT32
  2571. rsvd0_1_0: 2,
  2572. tid: 4,
  2573. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2574. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2575. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2576. * Else choose final tid based on latency, priority.
  2577. */
  2578. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2579. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2580. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2581. } POSTPACK;
  2582. /* DWORD 0 */
  2583. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2584. #define HTT_TX_FLOW_METADATA_TID_S 2
  2585. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2586. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2587. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2588. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2589. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2590. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2591. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2592. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2593. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2594. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2595. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2596. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2597. /* DWORD 0 */
  2598. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2599. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2600. HTT_TX_FLOW_METADATA_TID_S)
  2601. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2602. do { \
  2603. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2604. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2605. } while (0)
  2606. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2607. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2608. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2609. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2610. do { \
  2611. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2612. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2613. } while (0)
  2614. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2615. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2616. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2617. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2618. do { \
  2619. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2620. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2621. } while (0)
  2622. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2623. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2624. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2625. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2626. do { \
  2627. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2628. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2629. } while (0)
  2630. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2631. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2632. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2633. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2634. do { \
  2635. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2636. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2637. } while (0)
  2638. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2639. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2640. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2641. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2642. do { \
  2643. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2644. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2645. } while (0)
  2646. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2647. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2648. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2649. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2650. do { \
  2651. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2652. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2653. } while (0)
  2654. /**
  2655. * @brief host -> target ADD WDS Entry
  2656. *
  2657. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2658. *
  2659. * @brief host -> target DELETE WDS Entry
  2660. *
  2661. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2662. *
  2663. * @details
  2664. * HTT wds entry from source port learning
  2665. * Host will learn wds entries from rx and send this message to firmware
  2666. * to enable firmware to configure/delete AST entries for wds clients.
  2667. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2668. * and when SA's entry is deleted, firmware removes this AST entry
  2669. *
  2670. * The message would appear as follows:
  2671. *
  2672. * |31 30|29 |17 16|15 8|7 0|
  2673. * |----------------+----------------+----------------+----------------|
  2674. * | rsvd0 |PDVID| vdev_id | msg_type |
  2675. * |-------------------------------------------------------------------|
  2676. * | sa_addr_31_0 |
  2677. * |-------------------------------------------------------------------|
  2678. * | | ta_peer_id | sa_addr_47_32 |
  2679. * |-------------------------------------------------------------------|
  2680. * Where PDVID = pdev_id
  2681. *
  2682. * The message is interpreted as follows:
  2683. *
  2684. * dword0 - b'0:7 - msg_type: This will be set to
  2685. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2686. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2687. *
  2688. * dword0 - b'8:15 - vdev_id
  2689. *
  2690. * dword0 - b'16:17 - pdev_id
  2691. *
  2692. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2693. *
  2694. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2695. *
  2696. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2697. *
  2698. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2699. */
  2700. PREPACK struct htt_wds_entry {
  2701. A_UINT32
  2702. msg_type: 8,
  2703. vdev_id: 8,
  2704. pdev_id: 2,
  2705. rsvd0: 14;
  2706. A_UINT32 sa_addr_31_0;
  2707. A_UINT32
  2708. sa_addr_47_32: 16,
  2709. ta_peer_id: 14,
  2710. rsvd2: 2;
  2711. } POSTPACK;
  2712. /* DWORD 0 */
  2713. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2714. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2715. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2716. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2717. /* DWORD 2 */
  2718. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2719. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2720. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2721. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2722. /* DWORD 0 */
  2723. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2724. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2725. HTT_WDS_ENTRY_VDEV_ID_S)
  2726. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2727. do { \
  2728. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2729. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2730. } while (0)
  2731. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2732. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2733. HTT_WDS_ENTRY_PDEV_ID_S)
  2734. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2735. do { \
  2736. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2737. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2738. } while (0)
  2739. /* DWORD 2 */
  2740. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2741. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2742. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2743. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2744. do { \
  2745. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2746. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2747. } while (0)
  2748. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2749. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2750. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2751. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2752. do { \
  2753. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2754. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2755. } while (0)
  2756. /**
  2757. * @brief MAC DMA rx ring setup specification
  2758. *
  2759. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2760. *
  2761. * @details
  2762. * To allow for dynamic rx ring reconfiguration and to avoid race
  2763. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2764. * it uses. Instead, it sends this message to the target, indicating how
  2765. * the rx ring used by the host should be set up and maintained.
  2766. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2767. * specifications.
  2768. *
  2769. * |31 16|15 8|7 0|
  2770. * |---------------------------------------------------------------|
  2771. * header: | reserved | num rings | msg type |
  2772. * |---------------------------------------------------------------|
  2773. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2774. #if HTT_PADDR64
  2775. * | FW_IDX shadow register physical address (bits 63:32) |
  2776. #endif
  2777. * |---------------------------------------------------------------|
  2778. * | rx ring base physical address (bits 31:0) |
  2779. #if HTT_PADDR64
  2780. * | rx ring base physical address (bits 63:32) |
  2781. #endif
  2782. * |---------------------------------------------------------------|
  2783. * | rx ring buffer size | rx ring length |
  2784. * |---------------------------------------------------------------|
  2785. * | FW_IDX initial value | enabled flags |
  2786. * |---------------------------------------------------------------|
  2787. * | MSDU payload offset | 802.11 header offset |
  2788. * |---------------------------------------------------------------|
  2789. * | PPDU end offset | PPDU start offset |
  2790. * |---------------------------------------------------------------|
  2791. * | MPDU end offset | MPDU start offset |
  2792. * |---------------------------------------------------------------|
  2793. * | MSDU end offset | MSDU start offset |
  2794. * |---------------------------------------------------------------|
  2795. * | frag info offset | rx attention offset |
  2796. * |---------------------------------------------------------------|
  2797. * payload 2, if present, has the same format as payload 1
  2798. * Header fields:
  2799. * - MSG_TYPE
  2800. * Bits 7:0
  2801. * Purpose: identifies this as an rx ring configuration message
  2802. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2803. * - NUM_RINGS
  2804. * Bits 15:8
  2805. * Purpose: indicates whether the host is setting up one rx ring or two
  2806. * Value: 1 or 2
  2807. * Payload:
  2808. * for systems using 64-bit format for bus addresses:
  2809. * - IDX_SHADOW_REG_PADDR_LO
  2810. * Bits 31:0
  2811. * Value: lower 4 bytes of physical address of the host's
  2812. * FW_IDX shadow register
  2813. * - IDX_SHADOW_REG_PADDR_HI
  2814. * Bits 31:0
  2815. * Value: upper 4 bytes of physical address of the host's
  2816. * FW_IDX shadow register
  2817. * - RING_BASE_PADDR_LO
  2818. * Bits 31:0
  2819. * Value: lower 4 bytes of physical address of the host's rx ring
  2820. * - RING_BASE_PADDR_HI
  2821. * Bits 31:0
  2822. * Value: uppper 4 bytes of physical address of the host's rx ring
  2823. * for systems using 32-bit format for bus addresses:
  2824. * - IDX_SHADOW_REG_PADDR
  2825. * Bits 31:0
  2826. * Value: physical address of the host's FW_IDX shadow register
  2827. * - RING_BASE_PADDR
  2828. * Bits 31:0
  2829. * Value: physical address of the host's rx ring
  2830. * - RING_LEN
  2831. * Bits 15:0
  2832. * Value: number of elements in the rx ring
  2833. * - RING_BUF_SZ
  2834. * Bits 31:16
  2835. * Value: size of the buffers referenced by the rx ring, in byte units
  2836. * - ENABLED_FLAGS
  2837. * Bits 15:0
  2838. * Value: 1-bit flags to show whether different rx fields are enabled
  2839. * bit 0: 802.11 header enabled (1) or disabled (0)
  2840. * bit 1: MSDU payload enabled (1) or disabled (0)
  2841. * bit 2: PPDU start enabled (1) or disabled (0)
  2842. * bit 3: PPDU end enabled (1) or disabled (0)
  2843. * bit 4: MPDU start enabled (1) or disabled (0)
  2844. * bit 5: MPDU end enabled (1) or disabled (0)
  2845. * bit 6: MSDU start enabled (1) or disabled (0)
  2846. * bit 7: MSDU end enabled (1) or disabled (0)
  2847. * bit 8: rx attention enabled (1) or disabled (0)
  2848. * bit 9: frag info enabled (1) or disabled (0)
  2849. * bit 10: unicast rx enabled (1) or disabled (0)
  2850. * bit 11: multicast rx enabled (1) or disabled (0)
  2851. * bit 12: ctrl rx enabled (1) or disabled (0)
  2852. * bit 13: mgmt rx enabled (1) or disabled (0)
  2853. * bit 14: null rx enabled (1) or disabled (0)
  2854. * bit 15: phy data rx enabled (1) or disabled (0)
  2855. * - IDX_INIT_VAL
  2856. * Bits 31:16
  2857. * Purpose: Specify the initial value for the FW_IDX.
  2858. * Value: the number of buffers initially present in the host's rx ring
  2859. * - OFFSET_802_11_HDR
  2860. * Bits 15:0
  2861. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2862. * - OFFSET_MSDU_PAYLOAD
  2863. * Bits 31:16
  2864. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2865. * - OFFSET_PPDU_START
  2866. * Bits 15:0
  2867. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2868. * - OFFSET_PPDU_END
  2869. * Bits 31:16
  2870. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2871. * - OFFSET_MPDU_START
  2872. * Bits 15:0
  2873. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2874. * - OFFSET_MPDU_END
  2875. * Bits 31:16
  2876. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2877. * - OFFSET_MSDU_START
  2878. * Bits 15:0
  2879. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2880. * - OFFSET_MSDU_END
  2881. * Bits 31:16
  2882. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2883. * - OFFSET_RX_ATTN
  2884. * Bits 15:0
  2885. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2886. * - OFFSET_FRAG_INFO
  2887. * Bits 31:16
  2888. * Value: offset in QUAD-bytes of frag info table
  2889. */
  2890. /* header fields */
  2891. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2892. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2893. /* payload fields */
  2894. /* for systems using a 64-bit format for bus addresses */
  2895. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2896. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2897. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2898. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2899. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2900. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2901. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2902. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2903. /* for systems using a 32-bit format for bus addresses */
  2904. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2905. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2906. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2907. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2908. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2909. #define HTT_RX_RING_CFG_LEN_S 0
  2910. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2911. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2912. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2913. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2914. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2915. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2916. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2917. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2918. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2919. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2920. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2921. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2922. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2923. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2924. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2925. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2926. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2927. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2928. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2929. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2930. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2931. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2932. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2933. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2934. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2935. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2936. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2937. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2938. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2939. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2940. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2941. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2942. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2943. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2944. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2945. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2946. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2947. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2948. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2949. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2950. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2951. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2952. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2953. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2954. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2955. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2956. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2957. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2958. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2959. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2960. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2961. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2962. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2963. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2964. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2965. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2966. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2967. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2968. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2969. #if HTT_PADDR64
  2970. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2971. #else
  2972. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2973. #endif
  2974. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2975. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2976. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2977. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2978. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2979. do { \
  2980. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2981. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2982. } while (0)
  2983. /* degenerate case for 32-bit fields */
  2984. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2985. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2986. ((_var) = (_val))
  2987. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2988. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2989. ((_var) = (_val))
  2990. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2991. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2992. ((_var) = (_val))
  2993. /* degenerate case for 32-bit fields */
  2994. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  2995. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  2996. ((_var) = (_val))
  2997. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  2998. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  2999. ((_var) = (_val))
  3000. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3001. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3002. ((_var) = (_val))
  3003. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3004. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3005. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3006. do { \
  3007. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3008. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3009. } while (0)
  3010. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3011. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3012. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3013. do { \
  3014. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3015. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3016. } while (0)
  3017. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3018. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3019. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3020. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3021. do { \
  3022. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3023. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3024. } while (0)
  3025. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3026. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3027. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3028. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3029. do { \
  3030. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3031. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3032. } while (0)
  3033. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3034. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3035. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3036. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3037. do { \
  3038. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3039. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3040. } while (0)
  3041. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3042. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3043. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3044. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3045. do { \
  3046. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3047. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3048. } while (0)
  3049. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3050. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3051. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3052. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3053. do { \
  3054. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3055. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3056. } while (0)
  3057. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3058. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3059. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3060. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3061. do { \
  3062. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3063. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3064. } while (0)
  3065. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3066. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3067. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3068. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3069. do { \
  3070. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3071. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3072. } while (0)
  3073. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3074. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3075. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3076. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3077. do { \
  3078. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3079. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3080. } while (0)
  3081. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3082. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3083. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3084. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3085. do { \
  3086. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3087. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3088. } while (0)
  3089. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3090. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3091. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3092. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3093. do { \
  3094. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3095. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3096. } while (0)
  3097. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3098. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3099. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3100. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3101. do { \
  3102. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3103. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3104. } while (0)
  3105. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3106. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3107. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3108. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3109. do { \
  3110. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3111. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3112. } while (0)
  3113. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3114. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3115. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3116. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3117. do { \
  3118. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3119. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3120. } while (0)
  3121. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3122. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3123. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3124. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3125. do { \
  3126. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3127. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3128. } while (0)
  3129. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3130. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3131. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3132. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3133. do { \
  3134. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3135. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3136. } while (0)
  3137. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3138. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3139. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3140. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3141. do { \
  3142. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3143. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3144. } while (0)
  3145. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3146. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3147. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3148. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3149. do { \
  3150. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3151. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3152. } while (0)
  3153. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3154. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3155. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3156. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3157. do { \
  3158. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3159. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3160. } while (0)
  3161. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3162. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3163. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3164. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3165. do { \
  3166. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3167. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3168. } while (0)
  3169. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3170. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3171. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3172. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3173. do { \
  3174. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3175. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3176. } while (0)
  3177. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3178. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3179. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3180. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3181. do { \
  3182. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3183. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3184. } while (0)
  3185. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3186. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3187. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3188. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3189. do { \
  3190. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3191. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3192. } while (0)
  3193. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3194. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3195. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3196. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3197. do { \
  3198. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3199. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3200. } while (0)
  3201. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3202. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3203. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3204. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3205. do { \
  3206. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3207. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3208. } while (0)
  3209. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3210. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3211. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3212. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3213. do { \
  3214. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3215. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3216. } while (0)
  3217. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3218. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3219. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3220. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3221. do { \
  3222. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3223. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3224. } while (0)
  3225. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3226. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3227. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3228. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3229. do { \
  3230. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3231. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3232. } while (0)
  3233. /**
  3234. * @brief host -> target FW statistics retrieve
  3235. *
  3236. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3237. *
  3238. * @details
  3239. * The following field definitions describe the format of the HTT host
  3240. * to target FW stats retrieve message. The message specifies the type of
  3241. * stats host wants to retrieve.
  3242. *
  3243. * |31 24|23 16|15 8|7 0|
  3244. * |-----------------------------------------------------------|
  3245. * | stats types request bitmask | msg type |
  3246. * |-----------------------------------------------------------|
  3247. * | stats types reset bitmask | reserved |
  3248. * |-----------------------------------------------------------|
  3249. * | stats type | config value |
  3250. * |-----------------------------------------------------------|
  3251. * | cookie LSBs |
  3252. * |-----------------------------------------------------------|
  3253. * | cookie MSBs |
  3254. * |-----------------------------------------------------------|
  3255. * Header fields:
  3256. * - MSG_TYPE
  3257. * Bits 7:0
  3258. * Purpose: identifies this is a stats upload request message
  3259. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3260. * - UPLOAD_TYPES
  3261. * Bits 31:8
  3262. * Purpose: identifies which types of FW statistics to upload
  3263. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3264. * - RESET_TYPES
  3265. * Bits 31:8
  3266. * Purpose: identifies which types of FW statistics to reset
  3267. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3268. * - CFG_VAL
  3269. * Bits 23:0
  3270. * Purpose: give an opaque configuration value to the specified stats type
  3271. * Value: stats-type specific configuration value
  3272. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3273. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3274. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3275. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3276. * - CFG_STAT_TYPE
  3277. * Bits 31:24
  3278. * Purpose: specify which stats type (if any) the config value applies to
  3279. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3280. * a valid configuration specification
  3281. * - COOKIE_LSBS
  3282. * Bits 31:0
  3283. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3284. * message with its preceding host->target stats request message.
  3285. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3286. * - COOKIE_MSBS
  3287. * Bits 31:0
  3288. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3289. * message with its preceding host->target stats request message.
  3290. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3291. */
  3292. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3293. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3294. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3295. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3296. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3297. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3298. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3299. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3300. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3301. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3302. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3303. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3304. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3305. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3306. do { \
  3307. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3308. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3309. } while (0)
  3310. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3311. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3312. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3313. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3314. do { \
  3315. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3316. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3317. } while (0)
  3318. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3319. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3320. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3321. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3322. do { \
  3323. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3324. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3325. } while (0)
  3326. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3327. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3328. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3329. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3330. do { \
  3331. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3332. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3333. } while (0)
  3334. /**
  3335. * @brief host -> target HTT out-of-band sync request
  3336. *
  3337. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3338. *
  3339. * @details
  3340. * The HTT SYNC tells the target to suspend processing of subsequent
  3341. * HTT host-to-target messages until some other target agent locally
  3342. * informs the target HTT FW that the current sync counter is equal to
  3343. * or greater than (in a modulo sense) the sync counter specified in
  3344. * the SYNC message.
  3345. * This allows other host-target components to synchronize their operation
  3346. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3347. * security key has been downloaded to and activated by the target.
  3348. * In the absence of any explicit synchronization counter value
  3349. * specification, the target HTT FW will use zero as the default current
  3350. * sync value.
  3351. *
  3352. * |31 24|23 16|15 8|7 0|
  3353. * |-----------------------------------------------------------|
  3354. * | reserved | sync count | msg type |
  3355. * |-----------------------------------------------------------|
  3356. * Header fields:
  3357. * - MSG_TYPE
  3358. * Bits 7:0
  3359. * Purpose: identifies this as a sync message
  3360. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3361. * - SYNC_COUNT
  3362. * Bits 15:8
  3363. * Purpose: specifies what sync value the HTT FW will wait for from
  3364. * an out-of-band specification to resume its operation
  3365. * Value: in-band sync counter value to compare against the out-of-band
  3366. * counter spec.
  3367. * The HTT target FW will suspend its host->target message processing
  3368. * as long as
  3369. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3370. */
  3371. #define HTT_H2T_SYNC_MSG_SZ 4
  3372. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3373. #define HTT_H2T_SYNC_COUNT_S 8
  3374. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3375. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3376. HTT_H2T_SYNC_COUNT_S)
  3377. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3378. do { \
  3379. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3380. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3381. } while (0)
  3382. /**
  3383. * @brief host -> target HTT aggregation configuration
  3384. *
  3385. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3386. */
  3387. #define HTT_AGGR_CFG_MSG_SZ 4
  3388. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3389. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3390. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3391. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3392. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3393. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3394. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3395. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3396. do { \
  3397. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3398. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3399. } while (0)
  3400. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3401. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3402. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3403. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3404. do { \
  3405. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3406. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3407. } while (0)
  3408. /**
  3409. * @brief host -> target HTT configure max amsdu info per vdev
  3410. *
  3411. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3412. *
  3413. * @details
  3414. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3415. *
  3416. * |31 21|20 16|15 8|7 0|
  3417. * |-----------------------------------------------------------|
  3418. * | reserved | vdev id | max amsdu | msg type |
  3419. * |-----------------------------------------------------------|
  3420. * Header fields:
  3421. * - MSG_TYPE
  3422. * Bits 7:0
  3423. * Purpose: identifies this as a aggr cfg ex message
  3424. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3425. * - MAX_NUM_AMSDU_SUBFRM
  3426. * Bits 15:8
  3427. * Purpose: max MSDUs per A-MSDU
  3428. * - VDEV_ID
  3429. * Bits 20:16
  3430. * Purpose: ID of the vdev to which this limit is applied
  3431. */
  3432. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3433. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3434. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3435. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3436. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3437. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3438. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3439. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3440. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3441. do { \
  3442. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3443. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3444. } while (0)
  3445. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3446. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3447. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3448. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3449. do { \
  3450. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3451. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3452. } while (0)
  3453. /**
  3454. * @brief HTT WDI_IPA Config Message
  3455. *
  3456. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3457. *
  3458. * @details
  3459. * The HTT WDI_IPA config message is created/sent by host at driver
  3460. * init time. It contains information about data structures used on
  3461. * WDI_IPA TX and RX path.
  3462. * TX CE ring is used for pushing packet metadata from IPA uC
  3463. * to WLAN FW
  3464. * TX Completion ring is used for generating TX completions from
  3465. * WLAN FW to IPA uC
  3466. * RX Indication ring is used for indicating RX packets from FW
  3467. * to IPA uC
  3468. * RX Ring2 is used as either completion ring or as second
  3469. * indication ring. when Ring2 is used as completion ring, IPA uC
  3470. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3471. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3472. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3473. * indicated in RX Indication ring. Please see WDI_IPA specification
  3474. * for more details.
  3475. * |31 24|23 16|15 8|7 0|
  3476. * |----------------+----------------+----------------+----------------|
  3477. * | tx pkt pool size | Rsvd | msg_type |
  3478. * |-------------------------------------------------------------------|
  3479. * | tx comp ring base (bits 31:0) |
  3480. #if HTT_PADDR64
  3481. * | tx comp ring base (bits 63:32) |
  3482. #endif
  3483. * |-------------------------------------------------------------------|
  3484. * | tx comp ring size |
  3485. * |-------------------------------------------------------------------|
  3486. * | tx comp WR_IDX physical address (bits 31:0) |
  3487. #if HTT_PADDR64
  3488. * | tx comp WR_IDX physical address (bits 63:32) |
  3489. #endif
  3490. * |-------------------------------------------------------------------|
  3491. * | tx CE WR_IDX physical address (bits 31:0) |
  3492. #if HTT_PADDR64
  3493. * | tx CE WR_IDX physical address (bits 63:32) |
  3494. #endif
  3495. * |-------------------------------------------------------------------|
  3496. * | rx indication ring base (bits 31:0) |
  3497. #if HTT_PADDR64
  3498. * | rx indication ring base (bits 63:32) |
  3499. #endif
  3500. * |-------------------------------------------------------------------|
  3501. * | rx indication ring size |
  3502. * |-------------------------------------------------------------------|
  3503. * | rx ind RD_IDX physical address (bits 31:0) |
  3504. #if HTT_PADDR64
  3505. * | rx ind RD_IDX physical address (bits 63:32) |
  3506. #endif
  3507. * |-------------------------------------------------------------------|
  3508. * | rx ind WR_IDX physical address (bits 31:0) |
  3509. #if HTT_PADDR64
  3510. * | rx ind WR_IDX physical address (bits 63:32) |
  3511. #endif
  3512. * |-------------------------------------------------------------------|
  3513. * |-------------------------------------------------------------------|
  3514. * | rx ring2 base (bits 31:0) |
  3515. #if HTT_PADDR64
  3516. * | rx ring2 base (bits 63:32) |
  3517. #endif
  3518. * |-------------------------------------------------------------------|
  3519. * | rx ring2 size |
  3520. * |-------------------------------------------------------------------|
  3521. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3522. #if HTT_PADDR64
  3523. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3524. #endif
  3525. * |-------------------------------------------------------------------|
  3526. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3527. #if HTT_PADDR64
  3528. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3529. #endif
  3530. * |-------------------------------------------------------------------|
  3531. *
  3532. * Header fields:
  3533. * Header fields:
  3534. * - MSG_TYPE
  3535. * Bits 7:0
  3536. * Purpose: Identifies this as WDI_IPA config message
  3537. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3538. * - TX_PKT_POOL_SIZE
  3539. * Bits 15:0
  3540. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3541. * WDI_IPA TX path
  3542. * For systems using 32-bit format for bus addresses:
  3543. * - TX_COMP_RING_BASE_ADDR
  3544. * Bits 31:0
  3545. * Purpose: TX Completion Ring base address in DDR
  3546. * - TX_COMP_RING_SIZE
  3547. * Bits 31:0
  3548. * Purpose: TX Completion Ring size (must be power of 2)
  3549. * - TX_COMP_WR_IDX_ADDR
  3550. * Bits 31:0
  3551. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3552. * updates the Write Index for WDI_IPA TX completion ring
  3553. * - TX_CE_WR_IDX_ADDR
  3554. * Bits 31:0
  3555. * Purpose: DDR address where IPA uC
  3556. * updates the WR Index for TX CE ring
  3557. * (needed for fusion platforms)
  3558. * - RX_IND_RING_BASE_ADDR
  3559. * Bits 31:0
  3560. * Purpose: RX Indication Ring base address in DDR
  3561. * - RX_IND_RING_SIZE
  3562. * Bits 31:0
  3563. * Purpose: RX Indication Ring size
  3564. * - RX_IND_RD_IDX_ADDR
  3565. * Bits 31:0
  3566. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3567. * RX indication ring
  3568. * - RX_IND_WR_IDX_ADDR
  3569. * Bits 31:0
  3570. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3571. * updates the Write Index for WDI_IPA RX indication ring
  3572. * - RX_RING2_BASE_ADDR
  3573. * Bits 31:0
  3574. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3575. * - RX_RING2_SIZE
  3576. * Bits 31:0
  3577. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3578. * - RX_RING2_RD_IDX_ADDR
  3579. * Bits 31:0
  3580. * Purpose: If Second RX ring is Indication ring, DDR address where
  3581. * IPA uC updates the Read Index for Ring2.
  3582. * If Second RX ring is completion ring, this is NOT used
  3583. * - RX_RING2_WR_IDX_ADDR
  3584. * Bits 31:0
  3585. * Purpose: If Second RX ring is Indication ring, DDR address where
  3586. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3587. * If second RX ring is completion ring, DDR address where
  3588. * IPA uC updates the Write Index for Ring 2.
  3589. * For systems using 64-bit format for bus addresses:
  3590. * - TX_COMP_RING_BASE_ADDR_LO
  3591. * Bits 31:0
  3592. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3593. * - TX_COMP_RING_BASE_ADDR_HI
  3594. * Bits 31:0
  3595. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3596. * - TX_COMP_RING_SIZE
  3597. * Bits 31:0
  3598. * Purpose: TX Completion Ring size (must be power of 2)
  3599. * - TX_COMP_WR_IDX_ADDR_LO
  3600. * Bits 31:0
  3601. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3602. * Lower 4 bytes of DDR address where WIFI FW
  3603. * updates the Write Index for WDI_IPA TX completion ring
  3604. * - TX_COMP_WR_IDX_ADDR_HI
  3605. * Bits 31:0
  3606. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3607. * Higher 4 bytes of DDR address where WIFI FW
  3608. * updates the Write Index for WDI_IPA TX completion ring
  3609. * - TX_CE_WR_IDX_ADDR_LO
  3610. * Bits 31:0
  3611. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3612. * updates the WR Index for TX CE ring
  3613. * (needed for fusion platforms)
  3614. * - TX_CE_WR_IDX_ADDR_HI
  3615. * Bits 31:0
  3616. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3617. * updates the WR Index for TX CE ring
  3618. * (needed for fusion platforms)
  3619. * - RX_IND_RING_BASE_ADDR_LO
  3620. * Bits 31:0
  3621. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3622. * - RX_IND_RING_BASE_ADDR_HI
  3623. * Bits 31:0
  3624. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3625. * - RX_IND_RING_SIZE
  3626. * Bits 31:0
  3627. * Purpose: RX Indication Ring size
  3628. * - RX_IND_RD_IDX_ADDR_LO
  3629. * Bits 31:0
  3630. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3631. * for WDI_IPA RX indication ring
  3632. * - RX_IND_RD_IDX_ADDR_HI
  3633. * Bits 31:0
  3634. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3635. * for WDI_IPA RX indication ring
  3636. * - RX_IND_WR_IDX_ADDR_LO
  3637. * Bits 31:0
  3638. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3639. * Lower 4 bytes of DDR address where WIFI FW
  3640. * updates the Write Index for WDI_IPA RX indication ring
  3641. * - RX_IND_WR_IDX_ADDR_HI
  3642. * Bits 31:0
  3643. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3644. * Higher 4 bytes of DDR address where WIFI FW
  3645. * updates the Write Index for WDI_IPA RX indication ring
  3646. * - RX_RING2_BASE_ADDR_LO
  3647. * Bits 31:0
  3648. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3649. * - RX_RING2_BASE_ADDR_HI
  3650. * Bits 31:0
  3651. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3652. * - RX_RING2_SIZE
  3653. * Bits 31:0
  3654. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3655. * - RX_RING2_RD_IDX_ADDR_LO
  3656. * Bits 31:0
  3657. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3658. * DDR address where IPA uC updates the Read Index for Ring2.
  3659. * If Second RX ring is completion ring, this is NOT used
  3660. * - RX_RING2_RD_IDX_ADDR_HI
  3661. * Bits 31:0
  3662. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3663. * DDR address where IPA uC updates the Read Index for Ring2.
  3664. * If Second RX ring is completion ring, this is NOT used
  3665. * - RX_RING2_WR_IDX_ADDR_LO
  3666. * Bits 31:0
  3667. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3668. * DDR address where WIFI FW updates the Write Index
  3669. * for WDI_IPA RX ring2
  3670. * If second RX ring is completion ring, lower 4 bytes of
  3671. * DDR address where IPA uC updates the Write Index for Ring 2.
  3672. * - RX_RING2_WR_IDX_ADDR_HI
  3673. * Bits 31:0
  3674. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3675. * DDR address where WIFI FW updates the Write Index
  3676. * for WDI_IPA RX ring2
  3677. * If second RX ring is completion ring, higher 4 bytes of
  3678. * DDR address where IPA uC updates the Write Index for Ring 2.
  3679. */
  3680. #if HTT_PADDR64
  3681. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3682. #else
  3683. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3684. #endif
  3685. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3686. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3687. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3688. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3689. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3690. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3691. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3692. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3693. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3694. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3695. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3696. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3697. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3698. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3699. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3700. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3701. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3702. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3703. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3704. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3705. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3706. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3707. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3708. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3709. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3710. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3711. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3712. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3713. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3714. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3715. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3716. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3717. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3718. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3719. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3720. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3721. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3722. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3723. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3724. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3725. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3726. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3727. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3728. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3729. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3730. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3731. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3732. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3733. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3734. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3735. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3737. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3739. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3740. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3741. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3742. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3743. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3744. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3745. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3747. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3748. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3749. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3750. do { \
  3751. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3752. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3753. } while (0)
  3754. /* for systems using 32-bit format for bus addr */
  3755. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3756. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3757. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3758. do { \
  3759. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3760. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3761. } while (0)
  3762. /* for systems using 64-bit format for bus addr */
  3763. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3764. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3765. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3766. do { \
  3767. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3768. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3769. } while (0)
  3770. /* for systems using 64-bit format for bus addr */
  3771. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3772. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3773. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3774. do { \
  3775. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3776. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3777. } while (0)
  3778. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3779. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3780. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3781. do { \
  3782. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3783. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3784. } while (0)
  3785. /* for systems using 32-bit format for bus addr */
  3786. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3787. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3788. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3789. do { \
  3790. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3791. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3792. } while (0)
  3793. /* for systems using 64-bit format for bus addr */
  3794. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3795. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3796. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3797. do { \
  3798. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3799. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3800. } while (0)
  3801. /* for systems using 64-bit format for bus addr */
  3802. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3803. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3804. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3805. do { \
  3806. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3807. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3808. } while (0)
  3809. /* for systems using 32-bit format for bus addr */
  3810. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3811. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3812. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3813. do { \
  3814. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3815. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3816. } while (0)
  3817. /* for systems using 64-bit format for bus addr */
  3818. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3819. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3820. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3821. do { \
  3822. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3823. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3824. } while (0)
  3825. /* for systems using 64-bit format for bus addr */
  3826. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3827. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3828. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3829. do { \
  3830. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3831. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3832. } while (0)
  3833. /* for systems using 32-bit format for bus addr */
  3834. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3835. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3836. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3837. do { \
  3838. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3839. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3840. } while (0)
  3841. /* for systems using 64-bit format for bus addr */
  3842. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3843. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3844. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3845. do { \
  3846. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3847. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3848. } while (0)
  3849. /* for systems using 64-bit format for bus addr */
  3850. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3851. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3852. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3853. do { \
  3854. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3855. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3856. } while (0)
  3857. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3858. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3859. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3860. do { \
  3861. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3862. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3863. } while (0)
  3864. /* for systems using 32-bit format for bus addr */
  3865. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3866. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3867. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3868. do { \
  3869. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3870. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3871. } while (0)
  3872. /* for systems using 64-bit format for bus addr */
  3873. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3874. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3875. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3876. do { \
  3877. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3878. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3879. } while (0)
  3880. /* for systems using 64-bit format for bus addr */
  3881. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3882. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3883. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3884. do { \
  3885. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3886. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3887. } while (0)
  3888. /* for systems using 32-bit format for bus addr */
  3889. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3890. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3891. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3892. do { \
  3893. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3894. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3895. } while (0)
  3896. /* for systems using 64-bit format for bus addr */
  3897. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3898. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3899. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3900. do { \
  3901. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3902. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3903. } while (0)
  3904. /* for systems using 64-bit format for bus addr */
  3905. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3906. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3907. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3908. do { \
  3909. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3910. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3911. } while (0)
  3912. /* for systems using 32-bit format for bus addr */
  3913. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3914. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3915. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3916. do { \
  3917. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3918. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3919. } while (0)
  3920. /* for systems using 64-bit format for bus addr */
  3921. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3922. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3923. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3924. do { \
  3925. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3926. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3927. } while (0)
  3928. /* for systems using 64-bit format for bus addr */
  3929. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3930. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3931. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3932. do { \
  3933. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3934. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3935. } while (0)
  3936. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3937. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3938. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3939. do { \
  3940. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3941. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3942. } while (0)
  3943. /* for systems using 32-bit format for bus addr */
  3944. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3945. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3946. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3947. do { \
  3948. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3949. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3950. } while (0)
  3951. /* for systems using 64-bit format for bus addr */
  3952. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3953. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3954. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3955. do { \
  3956. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3957. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3958. } while (0)
  3959. /* for systems using 64-bit format for bus addr */
  3960. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3961. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3962. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3963. do { \
  3964. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3965. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3966. } while (0)
  3967. /* for systems using 32-bit format for bus addr */
  3968. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3969. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3970. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3971. do { \
  3972. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3973. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3974. } while (0)
  3975. /* for systems using 64-bit format for bus addr */
  3976. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3977. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3978. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3979. do { \
  3980. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3981. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3982. } while (0)
  3983. /* for systems using 64-bit format for bus addr */
  3984. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3985. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3986. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3987. do { \
  3988. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3989. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3990. } while (0)
  3991. /*
  3992. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3993. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3994. * addresses are stored in a XXX-bit field.
  3995. * This macro is used to define both htt_wdi_ipa_config32_t and
  3996. * htt_wdi_ipa_config64_t structs.
  3997. */
  3998. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  3999. _paddr__tx_comp_ring_base_addr_, \
  4000. _paddr__tx_comp_wr_idx_addr_, \
  4001. _paddr__tx_ce_wr_idx_addr_, \
  4002. _paddr__rx_ind_ring_base_addr_, \
  4003. _paddr__rx_ind_rd_idx_addr_, \
  4004. _paddr__rx_ind_wr_idx_addr_, \
  4005. _paddr__rx_ring2_base_addr_,\
  4006. _paddr__rx_ring2_rd_idx_addr_,\
  4007. _paddr__rx_ring2_wr_idx_addr_) \
  4008. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4009. { \
  4010. /* DWORD 0: flags and meta-data */ \
  4011. A_UINT32 \
  4012. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4013. reserved: 8, \
  4014. tx_pkt_pool_size: 16;\
  4015. /* DWORD 1 */\
  4016. _paddr__tx_comp_ring_base_addr_;\
  4017. /* DWORD 2 (or 3)*/\
  4018. A_UINT32 tx_comp_ring_size;\
  4019. /* DWORD 3 (or 4)*/\
  4020. _paddr__tx_comp_wr_idx_addr_;\
  4021. /* DWORD 4 (or 6)*/\
  4022. _paddr__tx_ce_wr_idx_addr_;\
  4023. /* DWORD 5 (or 8)*/\
  4024. _paddr__rx_ind_ring_base_addr_;\
  4025. /* DWORD 6 (or 10)*/\
  4026. A_UINT32 rx_ind_ring_size;\
  4027. /* DWORD 7 (or 11)*/\
  4028. _paddr__rx_ind_rd_idx_addr_;\
  4029. /* DWORD 8 (or 13)*/\
  4030. _paddr__rx_ind_wr_idx_addr_;\
  4031. /* DWORD 9 (or 15)*/\
  4032. _paddr__rx_ring2_base_addr_;\
  4033. /* DWORD 10 (or 17) */\
  4034. A_UINT32 rx_ring2_size;\
  4035. /* DWORD 11 (or 18) */\
  4036. _paddr__rx_ring2_rd_idx_addr_;\
  4037. /* DWORD 12 (or 20) */\
  4038. _paddr__rx_ring2_wr_idx_addr_;\
  4039. } POSTPACK
  4040. /* define a htt_wdi_ipa_config32_t type */
  4041. 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));
  4042. /* define a htt_wdi_ipa_config64_t type */
  4043. 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));
  4044. #if HTT_PADDR64
  4045. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4046. #else
  4047. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4048. #endif
  4049. enum htt_wdi_ipa_op_code {
  4050. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4051. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4052. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4053. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4054. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4055. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4056. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4057. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4058. /* keep this last */
  4059. HTT_WDI_IPA_OPCODE_MAX
  4060. };
  4061. /**
  4062. * @brief HTT WDI_IPA Operation Request Message
  4063. *
  4064. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4065. *
  4066. * @details
  4067. * HTT WDI_IPA Operation Request message is sent by host
  4068. * to either suspend or resume WDI_IPA TX or RX path.
  4069. * |31 24|23 16|15 8|7 0|
  4070. * |----------------+----------------+----------------+----------------|
  4071. * | op_code | Rsvd | msg_type |
  4072. * |-------------------------------------------------------------------|
  4073. *
  4074. * Header fields:
  4075. * - MSG_TYPE
  4076. * Bits 7:0
  4077. * Purpose: Identifies this as WDI_IPA Operation Request message
  4078. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4079. * - OP_CODE
  4080. * Bits 31:16
  4081. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4082. * value: = enum htt_wdi_ipa_op_code
  4083. */
  4084. PREPACK struct htt_wdi_ipa_op_request_t
  4085. {
  4086. /* DWORD 0: flags and meta-data */
  4087. A_UINT32
  4088. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4089. reserved: 8,
  4090. op_code: 16;
  4091. } POSTPACK;
  4092. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4093. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4094. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4095. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4096. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4097. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4098. do { \
  4099. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4100. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4101. } while (0)
  4102. /*
  4103. * @brief host -> target HTT_SRING_SETUP message
  4104. *
  4105. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4106. *
  4107. * @details
  4108. * After target is booted up, Host can send SRING setup message for
  4109. * each host facing LMAC SRING. Target setups up HW registers based
  4110. * on setup message and confirms back to Host if response_required is set.
  4111. * Host should wait for confirmation message before sending new SRING
  4112. * setup message
  4113. *
  4114. * The message would appear as follows:
  4115. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4116. * |--------------- +-----------------+-----------------+-----------------|
  4117. * | ring_type | ring_id | pdev_id | msg_type |
  4118. * |----------------------------------------------------------------------|
  4119. * | ring_base_addr_lo |
  4120. * |----------------------------------------------------------------------|
  4121. * | ring_base_addr_hi |
  4122. * |----------------------------------------------------------------------|
  4123. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4124. * |----------------------------------------------------------------------|
  4125. * | ring_head_offset32_remote_addr_lo |
  4126. * |----------------------------------------------------------------------|
  4127. * | ring_head_offset32_remote_addr_hi |
  4128. * |----------------------------------------------------------------------|
  4129. * | ring_tail_offset32_remote_addr_lo |
  4130. * |----------------------------------------------------------------------|
  4131. * | ring_tail_offset32_remote_addr_hi |
  4132. * |----------------------------------------------------------------------|
  4133. * | ring_msi_addr_lo |
  4134. * |----------------------------------------------------------------------|
  4135. * | ring_msi_addr_hi |
  4136. * |----------------------------------------------------------------------|
  4137. * | ring_msi_data |
  4138. * |----------------------------------------------------------------------|
  4139. * | intr_timer_th |IM| intr_batch_counter_th |
  4140. * |----------------------------------------------------------------------|
  4141. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4142. * |----------------------------------------------------------------------|
  4143. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4144. * |----------------------------------------------------------------------|
  4145. * Where
  4146. * IM = sw_intr_mode
  4147. * RR = response_required
  4148. * PTCF = prefetch_timer_cfg
  4149. * IP = IPA drop flag
  4150. *
  4151. * The message is interpreted as follows:
  4152. * dword0 - b'0:7 - msg_type: This will be set to
  4153. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4154. * b'8:15 - pdev_id:
  4155. * 0 (for rings at SOC/UMAC level),
  4156. * 1/2/3 mac id (for rings at LMAC level)
  4157. * b'16:23 - ring_id: identify which ring is to setup,
  4158. * more details can be got from enum htt_srng_ring_id
  4159. * b'24:31 - ring_type: identify type of host rings,
  4160. * more details can be got from enum htt_srng_ring_type
  4161. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4162. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4163. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4164. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4165. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4166. * SW_TO_HW_RING.
  4167. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4168. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4169. * Lower 32 bits of memory address of the remote variable
  4170. * storing the 4-byte word offset that identifies the head
  4171. * element within the ring.
  4172. * (The head offset variable has type A_UINT32.)
  4173. * Valid for HW_TO_SW and SW_TO_SW rings.
  4174. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4175. * Upper 32 bits of memory address of the remote variable
  4176. * storing the 4-byte word offset that identifies the head
  4177. * element within the ring.
  4178. * (The head offset variable has type A_UINT32.)
  4179. * Valid for HW_TO_SW and SW_TO_SW rings.
  4180. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4181. * Lower 32 bits of memory address of the remote variable
  4182. * storing the 4-byte word offset that identifies the tail
  4183. * element within the ring.
  4184. * (The tail offset variable has type A_UINT32.)
  4185. * Valid for HW_TO_SW and SW_TO_SW rings.
  4186. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4187. * Upper 32 bits of memory address of the remote variable
  4188. * storing the 4-byte word offset that identifies the tail
  4189. * element within the ring.
  4190. * (The tail offset variable has type A_UINT32.)
  4191. * Valid for HW_TO_SW and SW_TO_SW rings.
  4192. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4193. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4194. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4195. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4196. * dword10 - b'0:31 - ring_msi_data: MSI data
  4197. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4198. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4199. * dword11 - b'0:14 - intr_batch_counter_th:
  4200. * batch counter threshold is in units of 4-byte words.
  4201. * HW internally maintains and increments batch count.
  4202. * (see SRING spec for detail description).
  4203. * When batch count reaches threshold value, an interrupt
  4204. * is generated by HW.
  4205. * b'15 - sw_intr_mode:
  4206. * This configuration shall be static.
  4207. * Only programmed at power up.
  4208. * 0: generate pulse style sw interrupts
  4209. * 1: generate level style sw interrupts
  4210. * b'16:31 - intr_timer_th:
  4211. * The timer init value when timer is idle or is
  4212. * initialized to start downcounting.
  4213. * In 8us units (to cover a range of 0 to 524 ms)
  4214. * dword12 - b'0:15 - intr_low_threshold:
  4215. * Used only by Consumer ring to generate ring_sw_int_p.
  4216. * Ring entries low threshold water mark, that is used
  4217. * in combination with the interrupt timer as well as
  4218. * the the clearing of the level interrupt.
  4219. * b'16:18 - prefetch_timer_cfg:
  4220. * Used only by Consumer ring to set timer mode to
  4221. * support Application prefetch handling.
  4222. * The external tail offset/pointer will be updated
  4223. * at following intervals:
  4224. * 3'b000: (Prefetch feature disabled; used only for debug)
  4225. * 3'b001: 1 usec
  4226. * 3'b010: 4 usec
  4227. * 3'b011: 8 usec (default)
  4228. * 3'b100: 16 usec
  4229. * Others: Reserverd
  4230. * b'19 - response_required:
  4231. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4232. * b'20 - ipa_drop_flag:
  4233. Indicates that host will config ipa drop threshold percentage
  4234. * b'21:31 - reserved: reserved for future use
  4235. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4236. * b'8:15 - ipa drop high threshold percentage:
  4237. * b'16:31 - Reserved
  4238. */
  4239. PREPACK struct htt_sring_setup_t {
  4240. A_UINT32 msg_type: 8,
  4241. pdev_id: 8,
  4242. ring_id: 8,
  4243. ring_type: 8;
  4244. A_UINT32 ring_base_addr_lo;
  4245. A_UINT32 ring_base_addr_hi;
  4246. A_UINT32 ring_size: 16,
  4247. ring_entry_size: 8,
  4248. ring_misc_cfg_flag: 8;
  4249. A_UINT32 ring_head_offset32_remote_addr_lo;
  4250. A_UINT32 ring_head_offset32_remote_addr_hi;
  4251. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4252. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4253. A_UINT32 ring_msi_addr_lo;
  4254. A_UINT32 ring_msi_addr_hi;
  4255. A_UINT32 ring_msi_data;
  4256. A_UINT32 intr_batch_counter_th: 15,
  4257. sw_intr_mode: 1,
  4258. intr_timer_th: 16;
  4259. A_UINT32 intr_low_threshold: 16,
  4260. prefetch_timer_cfg: 3,
  4261. response_required: 1,
  4262. ipa_drop_flag: 1,
  4263. reserved1: 11;
  4264. A_UINT32 ipa_drop_low_threshold: 8,
  4265. ipa_drop_high_threshold: 8,
  4266. reserved: 16;
  4267. } POSTPACK;
  4268. enum htt_srng_ring_type {
  4269. HTT_HW_TO_SW_RING = 0,
  4270. HTT_SW_TO_HW_RING,
  4271. HTT_SW_TO_SW_RING,
  4272. /* Insert new ring types above this line */
  4273. };
  4274. enum htt_srng_ring_id {
  4275. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4276. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4277. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4278. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4279. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4280. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4281. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4282. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4283. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4284. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4285. HTT_TX_MON_MON2HOST_DEST_RING0, /* Used by monitor to fill status buffers and provide to host */
  4286. HTT_TX_MON_MON2HOST_DEST_RING1, /* Used by monitor to fill status buffers and provide to host */
  4287. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4288. HTT_RX_MON_MON2HOST_DEST_RING0, /* Used by monitor to fill status buffers and provide to host */
  4289. HTT_RX_MON_MON2HOST_DEST_RING1, /* Used by monitor to fill status buffers and provide to host */
  4290. /* Add Other SRING which can't be directly configured by host software above this line */
  4291. };
  4292. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4293. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4294. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4295. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4296. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4297. HTT_SRING_SETUP_PDEV_ID_S)
  4298. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4299. do { \
  4300. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4301. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4302. } while (0)
  4303. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4304. #define HTT_SRING_SETUP_RING_ID_S 16
  4305. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4306. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4307. HTT_SRING_SETUP_RING_ID_S)
  4308. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4309. do { \
  4310. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4311. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4312. } while (0)
  4313. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4314. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4315. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4316. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4317. HTT_SRING_SETUP_RING_TYPE_S)
  4318. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4319. do { \
  4320. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4321. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4322. } while (0)
  4323. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4324. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4325. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4326. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4327. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4328. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4329. do { \
  4330. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4331. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4332. } while (0)
  4333. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4334. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4335. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4336. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4337. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4338. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4339. do { \
  4340. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4341. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4342. } while (0)
  4343. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4344. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4345. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4346. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4347. HTT_SRING_SETUP_RING_SIZE_S)
  4348. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4349. do { \
  4350. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4351. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4352. } while (0)
  4353. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4354. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4355. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4356. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4357. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4358. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4359. do { \
  4360. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4361. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4362. } while (0)
  4363. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4364. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4365. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4366. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4367. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4368. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4369. do { \
  4370. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4371. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4372. } while (0)
  4373. /* This control bit is applicable to only Producer, which updates Ring ID field
  4374. * of each descriptor before pushing into the ring.
  4375. * 0: updates ring_id(default)
  4376. * 1: ring_id updating disabled */
  4377. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4378. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4379. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4380. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4381. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4382. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4383. do { \
  4384. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4385. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4386. } while (0)
  4387. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4388. * of each descriptor before pushing into the ring.
  4389. * 0: updates Loopcnt(default)
  4390. * 1: Loopcnt updating disabled */
  4391. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4392. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4393. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4394. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4395. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4396. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4397. do { \
  4398. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4399. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4400. } while (0)
  4401. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4402. * into security_id port of GXI/AXI. */
  4403. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4404. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4405. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4406. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4407. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4408. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4409. do { \
  4410. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4411. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4412. } while (0)
  4413. /* During MSI write operation, SRNG drives value of this register bit into
  4414. * swap bit of GXI/AXI. */
  4415. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4416. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4417. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4418. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4419. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4420. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4421. do { \
  4422. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4423. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4424. } while (0)
  4425. /* During Pointer write operation, SRNG drives value of this register bit into
  4426. * swap bit of GXI/AXI. */
  4427. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4428. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4429. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4430. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4431. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4432. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4433. do { \
  4434. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4435. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4436. } while (0)
  4437. /* During any data or TLV write operation, SRNG drives value of this register
  4438. * bit into swap bit of GXI/AXI. */
  4439. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4440. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4441. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4442. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4443. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4444. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4445. do { \
  4446. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4447. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4448. } while (0)
  4449. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4450. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4451. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4452. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4453. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4454. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4455. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4456. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4457. do { \
  4458. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4459. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4460. } while (0)
  4461. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4462. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4463. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4464. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4465. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4466. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4467. do { \
  4468. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4469. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4470. } while (0)
  4471. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4472. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4473. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4474. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4475. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4476. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4477. do { \
  4478. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4479. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4480. } while (0)
  4481. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4482. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4483. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4484. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4485. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4486. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4487. do { \
  4488. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4489. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4490. } while (0)
  4491. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4492. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4493. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4494. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4495. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4496. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4497. do { \
  4498. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4499. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4500. } while (0)
  4501. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4502. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4503. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4504. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4505. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4506. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4507. do { \
  4508. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4509. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4510. } while (0)
  4511. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4512. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4513. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4514. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4515. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4516. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4517. do { \
  4518. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4519. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4520. } while (0)
  4521. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4522. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4523. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4524. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4525. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4526. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4527. do { \
  4528. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4529. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4530. } while (0)
  4531. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4532. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4533. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4534. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4535. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4536. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4537. do { \
  4538. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4539. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4540. } while (0)
  4541. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4542. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4543. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4544. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4545. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4546. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4547. do { \
  4548. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4549. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4550. } while (0)
  4551. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4552. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4553. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4554. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4555. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4556. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4557. do { \
  4558. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4559. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4560. } while (0)
  4561. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4562. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4563. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4564. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4565. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4566. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4567. do { \
  4568. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4569. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4570. } while (0)
  4571. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4572. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4573. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4574. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4575. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4576. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4577. do { \
  4578. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4579. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4580. } while (0)
  4581. /**
  4582. * @brief host -> target RX ring selection config message
  4583. *
  4584. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4585. *
  4586. * @details
  4587. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4588. * configure RXDMA rings.
  4589. * The configuration is per ring based and includes both packet subtypes
  4590. * and PPDU/MPDU TLVs.
  4591. *
  4592. * The message would appear as follows:
  4593. *
  4594. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4595. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4596. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4597. * |-------------------------------------------------------------------|
  4598. * | rsvd2 | ring_buffer_size |
  4599. * |-------------------------------------------------------------------|
  4600. * | packet_type_enable_flags_0 |
  4601. * |-------------------------------------------------------------------|
  4602. * | packet_type_enable_flags_1 |
  4603. * |-------------------------------------------------------------------|
  4604. * | packet_type_enable_flags_2 |
  4605. * |-------------------------------------------------------------------|
  4606. * | packet_type_enable_flags_3 |
  4607. * |-------------------------------------------------------------------|
  4608. * | tlv_filter_in_flags |
  4609. * |-------------------------------------------------------------------|
  4610. * | rx_header_offset | rx_packet_offset |
  4611. * |-------------------------------------------------------------------|
  4612. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4613. * |-------------------------------------------------------------------|
  4614. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4615. * |-------------------------------------------------------------------|
  4616. * | rsvd3 | rx_attention_offset |
  4617. * |-------------------------------------------------------------------|
  4618. * | rsvd4 | mo| fp| rx_drop_threshold |
  4619. * | |ndp|ndp| |
  4620. * |-------------------------------------------------------------------|
  4621. * Where:
  4622. * PS = pkt_swap
  4623. * SS = status_swap
  4624. * OV = rx_offsets_valid
  4625. * DT = drop_thresh_valid
  4626. * The message is interpreted as follows:
  4627. * dword0 - b'0:7 - msg_type: This will be set to
  4628. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4629. * b'8:15 - pdev_id:
  4630. * 0 (for rings at SOC/UMAC level),
  4631. * 1/2/3 mac id (for rings at LMAC level)
  4632. * b'16:23 - ring_id : Identify the ring to configure.
  4633. * More details can be got from enum htt_srng_ring_id
  4634. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4635. * BUF_RING_CFG_0 defs within HW .h files,
  4636. * e.g. wmac_top_reg_seq_hwioreg.h
  4637. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4638. * BUF_RING_CFG_0 defs within HW .h files,
  4639. * e.g. wmac_top_reg_seq_hwioreg.h
  4640. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4641. * configuration fields are valid
  4642. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4643. * rx_drop_threshold field is valid
  4644. * b'28:31 - rsvd1: reserved for future use
  4645. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4646. * in byte units.
  4647. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4648. * - b'16:31 - rsvd2: Reserved for future use
  4649. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4650. * Enable MGMT packet from 0b0000 to 0b1001
  4651. * bits from low to high: FP, MD, MO - 3 bits
  4652. * FP: Filter_Pass
  4653. * MD: Monitor_Direct
  4654. * MO: Monitor_Other
  4655. * 10 mgmt subtypes * 3 bits -> 30 bits
  4656. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4657. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4658. * Enable MGMT packet from 0b1010 to 0b1111
  4659. * bits from low to high: FP, MD, MO - 3 bits
  4660. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4661. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4662. * Enable CTRL packet from 0b0000 to 0b1001
  4663. * bits from low to high: FP, MD, MO - 3 bits
  4664. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4665. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4666. * Enable CTRL packet from 0b1010 to 0b1111,
  4667. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4668. * bits from low to high: FP, MD, MO - 3 bits
  4669. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4670. * dword6 - b'0:31 - tlv_filter_in_flags:
  4671. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4672. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4673. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  4674. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4675. * A value of 0 will be considered as ignore this config.
  4676. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4677. * e.g. wmac_top_reg_seq_hwioreg.h
  4678. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  4679. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4680. * A value of 0 will be considered as ignore this config.
  4681. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  4682. * e.g. wmac_top_reg_seq_hwioreg.h
  4683. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  4684. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4685. * A value of 0 will be considered as ignore this config.
  4686. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4687. * e.g. wmac_top_reg_seq_hwioreg.h
  4688. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  4689. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4690. * A value of 0 will be considered as ignore this config.
  4691. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  4692. * e.g. wmac_top_reg_seq_hwioreg.h
  4693. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  4694. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4695. * A value of 0 will be considered as ignore this config.
  4696. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4697. * e.g. wmac_top_reg_seq_hwioreg.h
  4698. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  4699. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4700. * A value of 0 will be considered as ignore this config.
  4701. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  4702. * e.g. wmac_top_reg_seq_hwioreg.h
  4703. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4704. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4705. * A value of 0 will be considered as ignore this config.
  4706. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4707. * e.g. wmac_top_reg_seq_hwioreg.h
  4708. * - b'16:31 - rsvd3 for future use
  4709. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4710. * to source rings. Consumer drops packets if the available
  4711. * words in the ring falls below the configured threshold
  4712. * value.
  4713. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4714. * by host. 1 -> subscribed
  4715. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4716. * by host. 1 -> subscribed
  4717. */
  4718. PREPACK struct htt_rx_ring_selection_cfg_t {
  4719. A_UINT32 msg_type: 8,
  4720. pdev_id: 8,
  4721. ring_id: 8,
  4722. status_swap: 1,
  4723. pkt_swap: 1,
  4724. rx_offsets_valid: 1,
  4725. drop_thresh_valid: 1,
  4726. rsvd1: 4;
  4727. A_UINT32 ring_buffer_size: 16,
  4728. rsvd2: 16;
  4729. A_UINT32 packet_type_enable_flags_0;
  4730. A_UINT32 packet_type_enable_flags_1;
  4731. A_UINT32 packet_type_enable_flags_2;
  4732. A_UINT32 packet_type_enable_flags_3;
  4733. A_UINT32 tlv_filter_in_flags;
  4734. A_UINT32 rx_packet_offset: 16,
  4735. rx_header_offset: 16;
  4736. A_UINT32 rx_mpdu_end_offset: 16,
  4737. rx_mpdu_start_offset: 16;
  4738. A_UINT32 rx_msdu_end_offset: 16,
  4739. rx_msdu_start_offset: 16;
  4740. A_UINT32 rx_attn_offset: 16,
  4741. rsvd3: 16;
  4742. A_UINT32 rx_drop_threshold: 10,
  4743. fp_ndp: 1,
  4744. mo_ndp: 1,
  4745. rsvd4: 20;
  4746. } POSTPACK;
  4747. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4748. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4749. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4750. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4751. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4752. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4753. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4754. do { \
  4755. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4756. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4757. } while (0)
  4758. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4759. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4760. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4761. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4762. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4763. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4764. do { \
  4765. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4766. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4767. } while (0)
  4768. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4769. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4770. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4771. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4772. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4773. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4774. do { \
  4775. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4776. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4777. } while (0)
  4778. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4779. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4780. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4781. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4782. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4784. do { \
  4785. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4786. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4787. } while (0)
  4788. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4789. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4790. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4791. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4792. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4793. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4794. do { \
  4795. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4796. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4797. } while (0)
  4798. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4799. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4800. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4801. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4802. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4803. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4804. do { \
  4805. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4806. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4807. } while (0)
  4808. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4809. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4810. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4811. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4812. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4813. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4814. do { \
  4815. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4816. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4817. } while (0)
  4818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4821. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4822. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4824. do { \
  4825. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4826. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4827. } while (0)
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4831. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4832. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4834. do { \
  4835. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4836. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4837. } while (0)
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4841. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4842. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4844. do { \
  4845. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4846. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4847. } while (0)
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4851. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4852. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4854. do { \
  4855. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4856. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4857. } while (0)
  4858. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4859. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4860. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4861. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4862. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4863. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4864. do { \
  4865. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4866. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4867. } while (0)
  4868. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4869. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4870. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4871. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4872. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4873. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4874. do { \
  4875. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4876. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4877. } while (0)
  4878. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4879. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4880. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4881. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4882. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4883. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4884. do { \
  4885. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4886. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4887. } while (0)
  4888. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4889. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4890. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4891. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4892. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4893. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4894. do { \
  4895. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4896. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4897. } while (0)
  4898. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4899. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4900. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4901. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4902. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4903. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4904. do { \
  4905. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4906. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4907. } while (0)
  4908. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4909. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4910. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4911. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4912. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4913. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4914. do { \
  4915. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4916. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4917. } while (0)
  4918. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4919. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4920. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4921. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4922. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4923. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4924. do { \
  4925. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4926. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4927. } while (0)
  4928. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4929. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4930. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4931. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4932. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4933. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4934. do { \
  4935. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4936. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4937. } while (0)
  4938. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4939. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4940. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4941. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4942. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4943. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4944. do { \
  4945. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4946. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4947. } while (0)
  4948. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4949. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4950. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4951. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4952. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4953. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4954. do { \
  4955. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4956. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4957. } while (0)
  4958. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4959. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4960. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4961. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4962. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4963. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4964. do { \
  4965. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4966. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4967. } while (0)
  4968. /*
  4969. * Subtype based MGMT frames enable bits.
  4970. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4971. */
  4972. /* association request */
  4973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4979. /* association response */
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4986. /* Reassociation request */
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4991. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4993. /* Reassociation response */
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  4998. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5000. /* Probe request */
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5005. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5007. /* Probe response */
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5012. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5014. /* Timing Advertisement */
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5019. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5021. /* Reserved */
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5028. /* Beacon */
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5033. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5035. /* ATIM */
  5036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5040. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5042. /* Disassociation */
  5043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5047. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5049. /* Authentication */
  5050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5054. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5056. /* Deauthentication */
  5057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5061. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5063. /* Action */
  5064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5068. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5070. /* Action No Ack */
  5071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5075. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5077. /* Reserved */
  5078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5082. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5084. /*
  5085. * Subtype based CTRL frames enable bits.
  5086. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5087. */
  5088. /* Reserved */
  5089. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5090. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5091. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5092. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5093. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5095. /* Reserved */
  5096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5100. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5102. /* Reserved */
  5103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5107. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5109. /* Reserved */
  5110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5114. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5116. /* Reserved */
  5117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5121. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5123. /* Reserved */
  5124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5128. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5130. /* Reserved */
  5131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5135. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5137. /* Control Wrapper */
  5138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5142. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5144. /* Block Ack Request */
  5145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5149. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5151. /* Block Ack*/
  5152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5156. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5158. /* PS-POLL */
  5159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5163. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5165. /* RTS */
  5166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5170. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5172. /* CTS */
  5173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5177. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5179. /* ACK */
  5180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5184. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5186. /* CF-END */
  5187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5191. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5192. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5193. /* CF-END + CF-ACK */
  5194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5197. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5198. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5199. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5200. /* Multicast data */
  5201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5205. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5206. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5207. /* Unicast data */
  5208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5211. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5212. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5213. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5214. /* NULL data */
  5215. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5216. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5217. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5218. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5219. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5220. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5221. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5222. do { \
  5223. HTT_CHECK_SET_VAL(httsym, value); \
  5224. (word) |= (value) << httsym##_S; \
  5225. } while (0)
  5226. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5227. (((word) & httsym##_M) >> httsym##_S)
  5228. #define htt_rx_ring_pkt_enable_subtype_set( \
  5229. word, flag, mode, type, subtype, val) \
  5230. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5231. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5232. #define htt_rx_ring_pkt_enable_subtype_get( \
  5233. word, flag, mode, type, subtype) \
  5234. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5235. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5236. /* Definition to filter in TLVs */
  5237. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5238. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5239. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5240. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5241. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5242. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5243. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5244. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5245. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5246. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5247. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5248. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5249. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5250. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5251. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5252. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5253. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5254. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5255. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5256. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5257. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5258. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5259. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5260. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5261. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5262. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5263. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5264. do { \
  5265. HTT_CHECK_SET_VAL(httsym, enable); \
  5266. (word) |= (enable) << httsym##_S; \
  5267. } while (0)
  5268. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5269. (((word) & httsym##_M) >> httsym##_S)
  5270. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5271. HTT_RX_RING_TLV_ENABLE_SET( \
  5272. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5273. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5274. HTT_RX_RING_TLV_ENABLE_GET( \
  5275. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5276. /**
  5277. * @brief host -> target TX monitor config message
  5278. *
  5279. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5280. *
  5281. * @details
  5282. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5283. * configure RXDMA rings.
  5284. * The configuration is per ring based and includes both packet types
  5285. * and PPDU/MPDU TLVs.
  5286. *
  5287. * The message would appear as follows:
  5288. *
  5289. * |31 28|27|26|25|24|23 22|21 19|18 16|15 8|7 |2 0|
  5290. * |-----+-----+--+--+-----=-----+------+----------------+---------+-----|
  5291. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5292. * |-----+--------+--------+-----+------+--------------------------------|
  5293. * |rsvd2| DATA | CTRL | MGMT| PT | ring_buffer_size |
  5294. * |---------------------------------------------------------------+-----|
  5295. * | rsvd3 | E |
  5296. * |---------------------------------------------------------------------|
  5297. * | tlv_filter_mask_in0 |
  5298. * |---------------------------------------------------------------------|
  5299. * | tlv_filter_mask_in1 |
  5300. * |---------------------------------------------------------------------|
  5301. * | tlv_filter_mask_in2 |
  5302. * |---------------------------------------------------------------------|
  5303. * | tlv_filter_mask_in3 |
  5304. * |------------------------------------+--------------------------------|
  5305. * | tx_peer_entry_word_mask | tx_fes_setup_word_mask |
  5306. * |------------------------------------+--------------------------------|
  5307. * | tx_msdu_start_word_mask | tx_queue_ext_word_mask |
  5308. * |------------------------------------+--------------------------------|
  5309. * | pcu_ppdu_setup_word_mask | tx_mpdu_start_word_mask |
  5310. * |-----------------------+-----+------+--------------------------------|
  5311. * | rsvd4 | EMM | PT | rxpcu_user_setup_word_mask |
  5312. * |---------------------------------------------------------------------|
  5313. *
  5314. * Where:
  5315. * PS = pkt_swap
  5316. * SS = status_swap
  5317. * The message is interpreted as follows:
  5318. * dword0 - b'0:7 - msg_type: This will be set to
  5319. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5320. * b'8:15 - pdev_id:
  5321. * 0 (for rings at SOC/UMAC level),
  5322. * 1/2/3 mac id (for rings at LMAC level)
  5323. * b'16:23 - ring_id : Identify the ring to configure.
  5324. * More details can be got from enum htt_srng_ring_id
  5325. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5326. * BUF_RING_CFG_0 defs within HW .h files,
  5327. * e.g. wmac_top_reg_seq_hwioreg.h
  5328. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5329. * BUF_RING_CFG_0 defs within HW .h files,
  5330. * e.g. wmac_top_reg_seq_hwioreg.h
  5331. * b'26:31 - rsvd1: reserved for future use
  5332. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  5333. * in byte units.
  5334. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5335. * b'16:18 - pkt_type_config_length (PT): MGMT, CTRL, DATA
  5336. * Each bit out of 3 bits represents if configurable length
  5337. * is valid and needs to programmed.
  5338. * b'19:21 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5339. * 64, 128, 256.
  5340. * If all 3 bits are set config length is > 256
  5341. * b'22:24 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5342. * 64, 128, 256.
  5343. * If all 3 bits are set config length is > 256
  5344. * b'25:27 - config_length_data(DATA) for DATA: Each bit set represent
  5345. * 64, 128, 256.
  5346. * If all 3 bits are set config length is > 256
  5347. * - b'28:31 - rsvd2: Reserved for future use
  5348. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5349. * b'3:31 - rsvd3: Reserved for future use
  5350. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5351. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5352. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5353. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5354. * dword7 - b'0:15 - tx_fes_setup_word_mask:
  5355. * - b'16:31 - tx_peer_entry_word_mask:
  5356. * dword8 - b'0:15 - tx_queue_ext_word_mask:
  5357. * - b'16:31 - tx_msdu_start_word_mask:
  5358. * dword9 - b'0:15 - tx_mpdu_start_word_mask:
  5359. * - b'16:31 - pcu_ppdu_setup_word_mask:
  5360. * dword10- b'0:15 - rxpcu_user_setup_word_mask:
  5361. * - b'16:18 - pkt_type_msdu_or_mpdu_logging (PT): MGMT, CTRL, DATA
  5362. * Each bit out of 3 bits represents if MSDU/MPDU
  5363. * logging is enabled
  5364. * - b'19:21 - enable_msdu_or_mpdu_logging (EMM): For MGMT, CTRL, DATA
  5365. * 0 -> MSDU level logging is enabled
  5366. * (valid only if bit is set in
  5367. * pkt_type_msdu_or_mpdu_logging)
  5368. * 1 -> MPDU level logging is enabled
  5369. * (valid only if bit is set in
  5370. * pkt_type_msdu_or_mpdu_logging)
  5371. * - b'22:31 - rsvd4 for future use
  5372. */
  5373. PREPACK struct htt_tx_monitor_cfg_t {
  5374. A_UINT32 msg_type: 8,
  5375. pdev_id: 8,
  5376. ring_id: 8,
  5377. status_swap: 1,
  5378. pkt_swap: 1,
  5379. rsvd1: 6;
  5380. A_UINT32 ring_buffer_size: 16,
  5381. pkt_type_config_length: 3,
  5382. config_length_mgmt: 3,
  5383. config_length_ctrl: 3,
  5384. config_length_data: 3,
  5385. rsvd2: 4;
  5386. A_UINT32 pkt_type_enable_flags: 3,
  5387. rsvd3: 29;
  5388. A_UINT32 tlv_filter_mask_in0;
  5389. A_UINT32 tlv_filter_mask_in1;
  5390. A_UINT32 tlv_filter_mask_in2;
  5391. A_UINT32 tlv_filter_mask_in3;
  5392. A_UINT32 tx_fes_setup_word_mask: 16,
  5393. tx_peer_entry_word_mask: 16;
  5394. A_UINT32 tx_queue_ext_word_mask: 16,
  5395. tx_msdu_start_word_mask: 16;
  5396. A_UINT32 tx_mpdu_start_word_mask: 16,
  5397. pcu_ppdu_setup_word_mask: 16;
  5398. A_UINT32 rxpcu_user_setup_word_mask: 16,
  5399. pkt_type_msdu_or_mpdu_logging: 3,
  5400. enable_msdu_or_mpdu_logging: 3,
  5401. rsvd4: 10;
  5402. } POSTPACK;
  5403. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5404. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  5405. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  5406. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  5407. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  5408. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  5409. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  5410. do { \
  5411. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  5412. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  5413. } while (0)
  5414. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  5415. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  5416. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  5417. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  5418. HTT_TX_MONITOR_CFG_RING_ID_S)
  5419. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  5420. do { \
  5421. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  5422. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  5423. } while (0)
  5424. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  5425. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  5426. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  5427. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  5428. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  5429. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  5430. do { \
  5431. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  5432. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  5433. } while (0)
  5434. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  5435. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  5436. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  5437. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  5438. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  5439. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  5440. do { \
  5441. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  5442. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  5443. } while (0)
  5444. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5445. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  5446. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  5447. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  5448. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  5449. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5450. do { \
  5451. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  5452. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  5453. } while (0)
  5454. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_M 0x00070000
  5455. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S 16
  5456. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_GET(_var) \
  5457. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_M) >> \
  5458. HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S)
  5459. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_SET(_var, _val) \
  5460. do { \
  5461. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH, _val); \
  5462. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S)); \
  5463. } while (0)
  5464. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00380000
  5465. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 19
  5466. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5467. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5468. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  5469. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5470. do { \
  5471. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  5472. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5473. } while (0)
  5474. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x01C00000
  5475. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 22
  5476. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5477. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5478. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  5479. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5480. do { \
  5481. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  5482. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  5483. } while (0)
  5484. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x0E000000
  5485. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 25
  5486. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5487. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  5488. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  5489. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5490. do { \
  5491. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  5492. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  5493. } while (0)
  5494. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  5495. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  5496. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  5497. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  5498. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  5499. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  5500. do { \
  5501. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  5502. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  5503. } while (0)
  5504. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  5505. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  5506. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  5507. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  5508. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  5509. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  5510. do { \
  5511. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  5512. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  5513. } while (0)
  5514. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x0000ffff
  5515. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  5516. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  5517. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  5518. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  5519. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  5520. do { \
  5521. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  5522. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  5523. } while (0)
  5524. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0xffff0000
  5525. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 16
  5526. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  5527. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  5528. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  5529. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  5530. do { \
  5531. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  5532. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  5533. } while (0)
  5534. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x0000ffff
  5535. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 0
  5536. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  5537. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  5538. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  5539. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  5540. do { \
  5541. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  5542. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  5543. } while (0)
  5544. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xffff0000
  5545. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 16
  5546. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  5547. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  5548. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  5549. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  5550. do { \
  5551. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  5552. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  5553. } while (0)
  5554. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x0000ffff
  5555. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  5556. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  5557. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  5558. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  5559. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5560. do { \
  5561. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  5562. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  5563. } while (0)
  5564. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffff0000
  5565. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 16
  5566. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  5567. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  5568. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  5569. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  5570. do { \
  5571. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  5572. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  5573. } while (0)
  5574. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ffff
  5575. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 0
  5576. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  5577. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  5578. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  5579. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  5580. do { \
  5581. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  5582. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  5583. } while (0)
  5584. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  5585. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  5586. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5587. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5588. HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5589. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5590. do { \
  5591. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5592. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5593. } while (0)
  5594. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00380000
  5595. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 19
  5596. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5597. (((_var) & HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5598. HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5599. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5600. do { \
  5601. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5602. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5603. } while (0)
  5604. /*
  5605. * pkt_type_config_length
  5606. */
  5607. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_MGMT_M 0x00000001
  5608. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_MGMT_S 0
  5609. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_CTRL_M 0x00000002
  5610. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_CTRL_S 1
  5611. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_DATA_M 0x00000004
  5612. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_DATA_S 2
  5613. /*
  5614. * pkt_type_enable_flags
  5615. */
  5616. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00010000
  5617. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 16
  5618. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00020000
  5619. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 17
  5620. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00040000
  5621. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 18
  5622. /*
  5623. * pkt_type_msdu_or_mpdu_logging
  5624. * */
  5625. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  5626. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  5627. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  5628. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  5629. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  5630. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  5631. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  5632. do { \
  5633. HTT_CHECK_SET_VAL(httsym, value); \
  5634. (word) |= (value) << httsym##_S; \
  5635. } while (0)
  5636. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  5637. (((word) & httsym##_M) >> httsym##_S)
  5638. /* mode -> CONFIG_LENGTH, ENABLE_FLAGS, MSDU_OR_MPDU_LOGGING
  5639. * type -> MGMT, CTRL, DATA*/
  5640. #define htt_tx_ring_pkt_type_set( \
  5641. word, mode, type, val) \
  5642. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  5643. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  5644. #define htt_tx_ring_pkt_type_get( \
  5645. word, mode, type) \
  5646. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  5647. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  5648. /* Definition to filter in TLVs */
  5649. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  5650. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  5651. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  5652. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  5653. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  5654. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  5655. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  5656. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  5657. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  5658. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  5659. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  5660. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  5661. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  5662. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  5663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  5664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  5665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  5666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  5667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  5668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  5669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  5670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  5671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  5672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  5673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  5674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  5675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  5676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  5677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  5678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  5679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  5680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  5681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  5682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  5683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  5684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  5685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  5686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  5687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  5688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  5689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  5690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  5691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  5692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  5693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  5694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  5695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  5696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  5697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  5698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  5699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  5700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  5701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  5702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  5703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  5704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  5705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  5706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  5707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  5708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  5709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  5710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  5711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  5712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  5713. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  5714. do { \
  5715. HTT_CHECK_SET_VAL(httsym, enable); \
  5716. (word) |= (enable) << httsym##_S; \
  5717. } while (0)
  5718. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  5719. (((word) & httsym##_M) >> httsym##_S)
  5720. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  5721. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  5722. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  5723. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  5724. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  5725. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  5726. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  5727. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  5728. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  5729. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  5730. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  5731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  5732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  5733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  5734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  5735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  5736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  5737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  5738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  5739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  5740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  5741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  5742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  5743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  5744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  5745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  5746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  5747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  5748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  5749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  5750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  5751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  5752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  5753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  5754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  5755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  5756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  5757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  5758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  5759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  5760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  5761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  5762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  5763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  5764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  5765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  5766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  5767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  5768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  5769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  5770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  5771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  5772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  5773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  5774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  5775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  5776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  5777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  5778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  5779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  5780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  5781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  5782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  5783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  5784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  5785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  5786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_A_M 0x40000000
  5787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_A_S 30
  5788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_B_M 0x80000000
  5789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_B_S 31
  5790. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  5791. do { \
  5792. HTT_CHECK_SET_VAL(httsym, enable); \
  5793. (word) |= (enable) << httsym##_S; \
  5794. } while (0)
  5795. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  5796. (((word) & httsym##_M) >> httsym##_S)
  5797. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  5798. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  5799. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  5800. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  5801. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  5802. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  5803. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  5804. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  5805. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  5806. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  5807. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  5808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  5809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  5810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  5811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  5812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  5813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  5814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  5815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  5816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  5817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  5818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  5819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  5820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  5821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  5822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  5823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  5824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  5825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  5826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  5827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  5828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  5829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  5830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  5831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  5832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  5833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  5834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  5835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  5836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  5837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  5838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  5839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  5840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  5841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  5842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  5843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  5844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  5845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  5846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  5847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  5848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  5849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  5850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  5851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  5852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  5853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  5854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  5855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  5856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  5857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_BUFFER_STATUS_M 0x08000000
  5858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_BUFFER_STATUS_S 27
  5859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  5860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_USER_BUFFER_STATUS_S 28
  5861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXDMA_STOP_REQUEST_M 0x20000000
  5862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXDMA_STOP_REQUEST_S 29
  5863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_EXPECTED_RESPONSE_M 0x40000000
  5864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_EXPECTED_RESPONSE_S 30
  5865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  5866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_MPDU_COUNT_TRANSFER_END_S 31
  5867. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  5868. do { \
  5869. HTT_CHECK_SET_VAL(httsym, enable); \
  5870. (word) |= (enable) << httsym##_S; \
  5871. } while (0)
  5872. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  5873. (((word) & httsym##_M) >> httsym##_S)
  5874. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  5875. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  5876. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  5877. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  5878. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  5879. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  5880. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  5881. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  5882. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  5883. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  5884. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  5885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  5886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  5887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  5888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  5889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  5890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  5891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  5892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  5893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  5894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  5895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  5896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  5897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  5898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  5899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  5900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  5901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  5902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  5903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  5904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  5905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  5906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  5907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  5908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  5909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  5910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  5911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  5912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  5913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  5914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  5915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  5916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  5917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  5918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  5919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  5920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  5921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  5922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  5923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  5924. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  5925. do { \
  5926. HTT_CHECK_SET_VAL(httsym, enable); \
  5927. (word) |= (enable) << httsym##_S; \
  5928. } while (0)
  5929. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  5930. (((word) & httsym##_M) >> httsym##_S)
  5931. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  5932. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  5933. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  5934. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  5935. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  5936. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  5937. /**
  5938. * @brief host --> target Receive Flow Steering configuration message definition
  5939. *
  5940. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  5941. *
  5942. * host --> target Receive Flow Steering configuration message definition.
  5943. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5944. * The reason for this is we want RFS to be configured and ready before MAC
  5945. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5946. *
  5947. * |31 24|23 16|15 9|8|7 0|
  5948. * |----------------+----------------+----------------+----------------|
  5949. * | reserved |E| msg type |
  5950. * |-------------------------------------------------------------------|
  5951. * Where E = RFS enable flag
  5952. *
  5953. * The RFS_CONFIG message consists of a single 4-byte word.
  5954. *
  5955. * Header fields:
  5956. * - MSG_TYPE
  5957. * Bits 7:0
  5958. * Purpose: identifies this as a RFS config msg
  5959. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5960. * - RFS_CONFIG
  5961. * Bit 8
  5962. * Purpose: Tells target whether to enable (1) or disable (0)
  5963. * flow steering feature when sending rx indication messages to host
  5964. */
  5965. #define HTT_H2T_RFS_CONFIG_M 0x100
  5966. #define HTT_H2T_RFS_CONFIG_S 8
  5967. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5968. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5969. HTT_H2T_RFS_CONFIG_S)
  5970. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5971. do { \
  5972. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5973. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5974. } while (0)
  5975. #define HTT_RFS_CFG_REQ_BYTES 4
  5976. /**
  5977. * @brief host -> target FW extended statistics retrieve
  5978. *
  5979. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  5980. *
  5981. * @details
  5982. * The following field definitions describe the format of the HTT host
  5983. * to target FW extended stats retrieve message.
  5984. * The message specifies the type of stats the host wants to retrieve.
  5985. *
  5986. * |31 24|23 16|15 8|7 0|
  5987. * |-----------------------------------------------------------|
  5988. * | reserved | stats type | pdev_mask | msg type |
  5989. * |-----------------------------------------------------------|
  5990. * | config param [0] |
  5991. * |-----------------------------------------------------------|
  5992. * | config param [1] |
  5993. * |-----------------------------------------------------------|
  5994. * | config param [2] |
  5995. * |-----------------------------------------------------------|
  5996. * | config param [3] |
  5997. * |-----------------------------------------------------------|
  5998. * | reserved |
  5999. * |-----------------------------------------------------------|
  6000. * | cookie LSBs |
  6001. * |-----------------------------------------------------------|
  6002. * | cookie MSBs |
  6003. * |-----------------------------------------------------------|
  6004. * Header fields:
  6005. * - MSG_TYPE
  6006. * Bits 7:0
  6007. * Purpose: identifies this is a extended stats upload request message
  6008. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6009. * - PDEV_MASK
  6010. * Bits 8:15
  6011. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6012. * Value: This is a overloaded field, refer to usage and interpretation of
  6013. * PDEV in interface document.
  6014. * Bit 8 : Reserved for SOC stats
  6015. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6016. * Indicates MACID_MASK in DBS
  6017. * - STATS_TYPE
  6018. * Bits 23:16
  6019. * Purpose: identifies which FW statistics to upload
  6020. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6021. * - Reserved
  6022. * Bits 31:24
  6023. * - CONFIG_PARAM [0]
  6024. * Bits 31:0
  6025. * Purpose: give an opaque configuration value to the specified stats type
  6026. * Value: stats-type specific configuration value
  6027. * Refer to htt_stats.h for interpretation for each stats sub_type
  6028. * - CONFIG_PARAM [1]
  6029. * Bits 31:0
  6030. * Purpose: give an opaque configuration value to the specified stats type
  6031. * Value: stats-type specific configuration value
  6032. * Refer to htt_stats.h for interpretation for each stats sub_type
  6033. * - CONFIG_PARAM [2]
  6034. * Bits 31:0
  6035. * Purpose: give an opaque configuration value to the specified stats type
  6036. * Value: stats-type specific configuration value
  6037. * Refer to htt_stats.h for interpretation for each stats sub_type
  6038. * - CONFIG_PARAM [3]
  6039. * Bits 31:0
  6040. * Purpose: give an opaque configuration value to the specified stats type
  6041. * Value: stats-type specific configuration value
  6042. * Refer to htt_stats.h for interpretation for each stats sub_type
  6043. * - Reserved [31:0] for future use.
  6044. * - COOKIE_LSBS
  6045. * Bits 31:0
  6046. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6047. * message with its preceding host->target stats request message.
  6048. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6049. * - COOKIE_MSBS
  6050. * Bits 31:0
  6051. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6052. * message with its preceding host->target stats request message.
  6053. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6054. */
  6055. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6056. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6057. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6058. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6059. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6060. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6061. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6062. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6063. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6064. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6065. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6066. do { \
  6067. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6068. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6069. } while (0)
  6070. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6071. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6072. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6073. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6074. do { \
  6075. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6076. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6077. } while (0)
  6078. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6079. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6080. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6081. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6082. do { \
  6083. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6084. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6085. } while (0)
  6086. /**
  6087. * @brief host -> target FW PPDU_STATS request message
  6088. *
  6089. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6090. *
  6091. * @details
  6092. * The following field definitions describe the format of the HTT host
  6093. * to target FW for PPDU_STATS_CFG msg.
  6094. * The message allows the host to configure the PPDU_STATS_IND messages
  6095. * produced by the target.
  6096. *
  6097. * |31 24|23 16|15 8|7 0|
  6098. * |-----------------------------------------------------------|
  6099. * | REQ bit mask | pdev_mask | msg type |
  6100. * |-----------------------------------------------------------|
  6101. * Header fields:
  6102. * - MSG_TYPE
  6103. * Bits 7:0
  6104. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6105. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6106. * - PDEV_MASK
  6107. * Bits 8:15
  6108. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6109. * Value: This is a overloaded field, refer to usage and interpretation of
  6110. * PDEV in interface document.
  6111. * Bit 8 : Reserved for SOC stats
  6112. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6113. * Indicates MACID_MASK in DBS
  6114. * - REQ_TLV_BIT_MASK
  6115. * Bits 16:31
  6116. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6117. * needs to be included in the target's PPDU_STATS_IND messages.
  6118. * Value: refer htt_ppdu_stats_tlv_tag_t
  6119. *
  6120. */
  6121. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6122. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6123. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6124. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6125. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6126. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6127. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6128. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6129. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6130. do { \
  6131. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6132. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6133. } while (0)
  6134. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6135. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6136. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6137. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6138. do { \
  6139. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6140. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6141. } while (0)
  6142. /**
  6143. * @brief Host-->target HTT RX FSE setup message
  6144. *
  6145. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6146. *
  6147. * @details
  6148. * Through this message, the host will provide details of the flow tables
  6149. * in host DDR along with hash keys.
  6150. * This message can be sent per SOC or per PDEV, which is differentiated
  6151. * by pdev id values.
  6152. * The host will allocate flow search table and sends table size,
  6153. * physical DMA address of flow table, and hash keys to firmware to
  6154. * program into the RXOLE FSE HW block.
  6155. *
  6156. * The following field definitions describe the format of the RX FSE setup
  6157. * message sent from the host to target
  6158. *
  6159. * Header fields:
  6160. * dword0 - b'7:0 - msg_type: This will be set to
  6161. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6162. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6163. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6164. * pdev's LMAC ring.
  6165. * b'31:16 - reserved : Reserved for future use
  6166. * dword1 - b'19:0 - number of records: This field indicates the number of
  6167. * entries in the flow table. For example: 8k number of
  6168. * records is equivalent to
  6169. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6170. * b'27:20 - max search: This field specifies the skid length to FSE
  6171. * parser HW module whenever match is not found at the
  6172. * exact index pointed by hash.
  6173. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6174. * Refer htt_ip_da_sa_prefix below for more details.
  6175. * b'31:30 - reserved: Reserved for future use
  6176. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6177. * table allocated by host in DDR
  6178. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6179. * table allocated by host in DDR
  6180. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6181. * entry hashing
  6182. *
  6183. *
  6184. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6185. * |---------------------------------------------------------------|
  6186. * | reserved | pdev_id | MSG_TYPE |
  6187. * |---------------------------------------------------------------|
  6188. * |resvd|IPDSA| max_search | Number of records |
  6189. * |---------------------------------------------------------------|
  6190. * | base address lo |
  6191. * |---------------------------------------------------------------|
  6192. * | base address high |
  6193. * |---------------------------------------------------------------|
  6194. * | toeplitz key 31_0 |
  6195. * |---------------------------------------------------------------|
  6196. * | toeplitz key 63_32 |
  6197. * |---------------------------------------------------------------|
  6198. * | toeplitz key 95_64 |
  6199. * |---------------------------------------------------------------|
  6200. * | toeplitz key 127_96 |
  6201. * |---------------------------------------------------------------|
  6202. * | toeplitz key 159_128 |
  6203. * |---------------------------------------------------------------|
  6204. * | toeplitz key 191_160 |
  6205. * |---------------------------------------------------------------|
  6206. * | toeplitz key 223_192 |
  6207. * |---------------------------------------------------------------|
  6208. * | toeplitz key 255_224 |
  6209. * |---------------------------------------------------------------|
  6210. * | toeplitz key 287_256 |
  6211. * |---------------------------------------------------------------|
  6212. * | reserved | toeplitz key 314_288(26:0 bits) |
  6213. * |---------------------------------------------------------------|
  6214. * where:
  6215. * IPDSA = ip_da_sa
  6216. */
  6217. /**
  6218. * @brief: htt_ip_da_sa_prefix
  6219. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6220. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6221. * documentation per RFC3849
  6222. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6223. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6224. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6225. */
  6226. enum htt_ip_da_sa_prefix {
  6227. HTT_RX_IPV6_20010db8,
  6228. HTT_RX_IPV4_MAPPED_IPV6,
  6229. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6230. HTT_RX_IPV6_64FF9B,
  6231. };
  6232. /**
  6233. * @brief Host-->target HTT RX FISA configure and enable
  6234. *
  6235. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6236. *
  6237. * @details
  6238. * The host will send this command down to configure and enable the FISA
  6239. * operational params.
  6240. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6241. * register.
  6242. * Should configure both the MACs.
  6243. *
  6244. * dword0 - b'7:0 - msg_type:
  6245. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6246. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6247. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6248. * pdev's LMAC ring.
  6249. * b'31:16 - reserved : Reserved for future use
  6250. *
  6251. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6252. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6253. * packets. 1 flow search will be skipped
  6254. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6255. * tcp,udp packets
  6256. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6257. * calculation
  6258. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6259. * calculation
  6260. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6261. * calculation
  6262. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6263. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6264. * length
  6265. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6266. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6267. * length
  6268. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6269. * num jump
  6270. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6271. * num jump
  6272. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6273. * data type switch has happend for MPDU Sequence num jump
  6274. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6275. * for MPDU Sequence num jump
  6276. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6277. * for decrypt errors
  6278. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6279. * while aggregating a msdu
  6280. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6281. * The aggregation is done until (number of MSDUs aggregated
  6282. * < LIMIT + 1)
  6283. * b'31:18 - Reserved
  6284. *
  6285. * fisa_control_value - 32bit value FW can write to register
  6286. *
  6287. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  6288. * Threshold value for FISA timeout (units are microseconds).
  6289. * When the global timestamp exceeds this threshold, FISA
  6290. * aggregation will be restarted.
  6291. * A value of 0 means timeout is disabled.
  6292. * Compare the threshold register with timestamp field in
  6293. * flow entry to generate timeout for the flow.
  6294. *
  6295. * |31 18 |17 16|15 8|7 0|
  6296. * |-------------------------------------------------------------|
  6297. * | reserved | pdev_mask | msg type |
  6298. * |-------------------------------------------------------------|
  6299. * | reserved | FISA_CTRL |
  6300. * |-------------------------------------------------------------|
  6301. * | FISA_TIMEOUT_THRESH |
  6302. * |-------------------------------------------------------------|
  6303. */
  6304. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  6305. A_UINT32 msg_type:8,
  6306. pdev_id:8,
  6307. reserved0:16;
  6308. /**
  6309. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  6310. * [17:0]
  6311. */
  6312. union {
  6313. /*
  6314. * fisa_control_bits structure is deprecated.
  6315. * Please use fisa_control_bits_v2 going forward.
  6316. */
  6317. struct {
  6318. A_UINT32 fisa_enable: 1,
  6319. ipsec_skip_search: 1,
  6320. nontcp_skip_search: 1,
  6321. add_ipv4_fixed_hdr_len: 1,
  6322. add_ipv6_fixed_hdr_len: 1,
  6323. add_tcp_fixed_hdr_len: 1,
  6324. add_udp_hdr_len: 1,
  6325. chksum_cum_ip_len_en: 1,
  6326. disable_tid_check: 1,
  6327. disable_ta_check: 1,
  6328. disable_qos_check: 1,
  6329. disable_raw_check: 1,
  6330. disable_decrypt_err_check: 1,
  6331. disable_msdu_drop_check: 1,
  6332. fisa_aggr_limit: 4,
  6333. reserved: 14;
  6334. } fisa_control_bits;
  6335. struct {
  6336. A_UINT32 fisa_enable: 1,
  6337. fisa_aggr_limit: 4,
  6338. reserved: 27;
  6339. } fisa_control_bits_v2;
  6340. A_UINT32 fisa_control_value;
  6341. } u_fisa_control;
  6342. /**
  6343. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  6344. * timeout threshold for aggregation. Unit in usec.
  6345. * [31:0]
  6346. */
  6347. A_UINT32 fisa_timeout_threshold;
  6348. } POSTPACK;
  6349. /* DWord 0: pdev-ID */
  6350. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  6351. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  6352. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  6353. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  6354. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  6355. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  6356. do { \
  6357. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  6358. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  6359. } while (0)
  6360. /* Dword 1: fisa_control_value fisa config */
  6361. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  6362. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  6363. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  6364. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  6365. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  6366. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  6367. do { \
  6368. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  6369. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  6370. } while (0)
  6371. /* Dword 1: fisa_control_value ipsec_skip_search */
  6372. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  6373. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  6374. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  6375. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  6376. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  6377. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  6378. do { \
  6379. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  6380. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  6381. } while (0)
  6382. /* Dword 1: fisa_control_value non_tcp_skip_search */
  6383. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  6384. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  6385. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  6386. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  6387. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  6388. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  6389. do { \
  6390. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  6391. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  6392. } while (0)
  6393. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  6394. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  6395. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  6396. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  6397. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  6398. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  6399. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  6400. do { \
  6401. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  6402. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  6403. } while (0)
  6404. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  6405. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  6406. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  6407. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  6408. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  6409. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  6410. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  6411. do { \
  6412. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  6413. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  6414. } while (0)
  6415. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  6416. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  6417. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  6418. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  6419. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  6420. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  6421. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  6422. do { \
  6423. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  6424. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  6425. } while (0)
  6426. /* Dword 1: fisa_control_value add_udp_hdr_len */
  6427. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  6428. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  6429. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  6430. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  6431. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  6432. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  6433. do { \
  6434. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  6435. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  6436. } while (0)
  6437. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  6438. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  6439. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  6440. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  6441. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  6442. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  6443. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  6444. do { \
  6445. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  6446. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  6447. } while (0)
  6448. /* Dword 1: fisa_control_value disable_tid_check */
  6449. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  6450. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  6451. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  6452. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  6453. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  6454. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  6455. do { \
  6456. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  6457. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  6458. } while (0)
  6459. /* Dword 1: fisa_control_value disable_ta_check */
  6460. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  6461. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  6462. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  6463. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  6464. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  6465. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  6466. do { \
  6467. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  6468. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  6469. } while (0)
  6470. /* Dword 1: fisa_control_value disable_qos_check */
  6471. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  6472. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  6473. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  6474. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  6475. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  6476. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  6477. do { \
  6478. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  6479. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  6480. } while (0)
  6481. /* Dword 1: fisa_control_value disable_raw_check */
  6482. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  6483. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  6484. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  6485. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  6486. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  6487. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  6488. do { \
  6489. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  6490. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  6491. } while (0)
  6492. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  6493. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  6494. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  6495. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  6496. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  6497. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  6498. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  6499. do { \
  6500. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  6501. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  6502. } while (0)
  6503. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  6504. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  6505. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  6506. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  6507. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  6508. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  6509. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  6510. do { \
  6511. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  6512. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  6513. } while (0)
  6514. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6515. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  6516. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  6517. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  6518. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  6519. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  6520. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  6521. do { \
  6522. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  6523. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  6524. } while (0)
  6525. /* Dword 1: fisa_control_value fisa config */
  6526. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  6527. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  6528. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  6529. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  6530. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  6531. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  6532. do { \
  6533. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  6534. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  6535. } while (0)
  6536. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6537. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  6538. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  6539. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  6540. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  6541. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  6542. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  6543. do { \
  6544. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  6545. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  6546. } while (0)
  6547. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  6548. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  6549. pdev_id:8,
  6550. reserved0:16;
  6551. A_UINT32 num_records:20,
  6552. max_search:8,
  6553. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  6554. reserved1:2;
  6555. A_UINT32 base_addr_lo;
  6556. A_UINT32 base_addr_hi;
  6557. A_UINT32 toeplitz31_0;
  6558. A_UINT32 toeplitz63_32;
  6559. A_UINT32 toeplitz95_64;
  6560. A_UINT32 toeplitz127_96;
  6561. A_UINT32 toeplitz159_128;
  6562. A_UINT32 toeplitz191_160;
  6563. A_UINT32 toeplitz223_192;
  6564. A_UINT32 toeplitz255_224;
  6565. A_UINT32 toeplitz287_256;
  6566. A_UINT32 toeplitz314_288:27,
  6567. reserved2:5;
  6568. } POSTPACK;
  6569. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  6570. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  6571. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  6572. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  6573. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  6574. /* DWORD 0: Pdev ID */
  6575. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  6576. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  6577. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  6578. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  6579. HTT_RX_FSE_SETUP_PDEV_ID_S)
  6580. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  6581. do { \
  6582. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  6583. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  6584. } while (0)
  6585. /* DWORD 1:num of records */
  6586. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  6587. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  6588. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  6589. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  6590. HTT_RX_FSE_SETUP_NUM_REC_S)
  6591. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  6592. do { \
  6593. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  6594. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  6595. } while (0)
  6596. /* DWORD 1:max_search */
  6597. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  6598. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  6599. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  6600. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  6601. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  6602. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  6603. do { \
  6604. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  6605. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  6606. } while (0)
  6607. /* DWORD 1:ip_da_sa prefix */
  6608. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  6609. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  6610. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  6611. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  6612. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  6613. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  6614. do { \
  6615. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  6616. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  6617. } while (0)
  6618. /* DWORD 2: Base Address LO */
  6619. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  6620. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  6621. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  6622. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  6623. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  6624. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  6625. do { \
  6626. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  6627. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  6628. } while (0)
  6629. /* DWORD 3: Base Address High */
  6630. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  6631. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  6632. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  6633. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  6634. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  6635. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  6636. do { \
  6637. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  6638. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  6639. } while (0)
  6640. /* DWORD 4-12: Hash Value */
  6641. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  6642. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  6643. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  6644. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  6645. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  6646. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  6647. do { \
  6648. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  6649. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  6650. } while (0)
  6651. /* DWORD 13: Hash Value 314:288 bits */
  6652. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  6653. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  6654. HTT_RX_FSE_SETUP_HASH_314_288_S)
  6655. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  6656. do { \
  6657. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  6658. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  6659. } while (0)
  6660. /**
  6661. * @brief Host-->target HTT RX FSE operation message
  6662. *
  6663. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  6664. *
  6665. * @details
  6666. * The host will send this Flow Search Engine (FSE) operation message for
  6667. * every flow add/delete operation.
  6668. * The FSE operation includes FSE full cache invalidation or individual entry
  6669. * invalidation.
  6670. * This message can be sent per SOC or per PDEV which is differentiated
  6671. * by pdev id values.
  6672. *
  6673. * |31 16|15 8|7 1|0|
  6674. * |-------------------------------------------------------------|
  6675. * | reserved | pdev_id | MSG_TYPE |
  6676. * |-------------------------------------------------------------|
  6677. * | reserved | operation |I|
  6678. * |-------------------------------------------------------------|
  6679. * | ip_src_addr_31_0 |
  6680. * |-------------------------------------------------------------|
  6681. * | ip_src_addr_63_32 |
  6682. * |-------------------------------------------------------------|
  6683. * | ip_src_addr_95_64 |
  6684. * |-------------------------------------------------------------|
  6685. * | ip_src_addr_127_96 |
  6686. * |-------------------------------------------------------------|
  6687. * | ip_dst_addr_31_0 |
  6688. * |-------------------------------------------------------------|
  6689. * | ip_dst_addr_63_32 |
  6690. * |-------------------------------------------------------------|
  6691. * | ip_dst_addr_95_64 |
  6692. * |-------------------------------------------------------------|
  6693. * | ip_dst_addr_127_96 |
  6694. * |-------------------------------------------------------------|
  6695. * | l4_dst_port | l4_src_port |
  6696. * | (32-bit SPI incase of IPsec) |
  6697. * |-------------------------------------------------------------|
  6698. * | reserved | l4_proto |
  6699. * |-------------------------------------------------------------|
  6700. *
  6701. * where I is 1-bit ipsec_valid.
  6702. *
  6703. * The following field definitions describe the format of the RX FSE operation
  6704. * message sent from the host to target for every add/delete flow entry to flow
  6705. * table.
  6706. *
  6707. * Header fields:
  6708. * dword0 - b'7:0 - msg_type: This will be set to
  6709. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  6710. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6711. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6712. * specified pdev's LMAC ring.
  6713. * b'31:16 - reserved : Reserved for future use
  6714. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  6715. * (Internet Protocol Security).
  6716. * IPsec describes the framework for providing security at
  6717. * IP layer. IPsec is defined for both versions of IP:
  6718. * IPV4 and IPV6.
  6719. * Please refer to htt_rx_flow_proto enumeration below for
  6720. * more info.
  6721. * ipsec_valid = 1 for IPSEC packets
  6722. * ipsec_valid = 0 for IP Packets
  6723. * b'7:1 - operation: This indicates types of FSE operation.
  6724. * Refer to htt_rx_fse_operation enumeration:
  6725. * 0 - No Cache Invalidation required
  6726. * 1 - Cache invalidate only one entry given by IP
  6727. * src/dest address at DWORD[2:9]
  6728. * 2 - Complete FSE Cache Invalidation
  6729. * 3 - FSE Disable
  6730. * 4 - FSE Enable
  6731. * b'31:8 - reserved: Reserved for future use
  6732. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  6733. * for per flow addition/deletion
  6734. * For IPV4 src/dest addresses, the first A_UINT32 is used
  6735. * and the subsequent 3 A_UINT32 will be padding bytes.
  6736. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  6737. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  6738. * from 0 to 65535 but only 0 to 1023 are designated as
  6739. * well-known ports. Refer to [RFC1700] for more details.
  6740. * This field is valid only if
  6741. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6742. * - L4 dest port (31:16): 16-bit Destination Port numbers
  6743. * range from 0 to 65535 but only 0 to 1023 are designated
  6744. * as well-known ports. Refer to [RFC1700] for more details.
  6745. * This field is valid only if
  6746. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6747. * - SPI (31:0): Security Parameters Index is an
  6748. * identification tag added to the header while using IPsec
  6749. * for tunneling the IP traffici.
  6750. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  6751. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  6752. * Assigned Internet Protocol Numbers.
  6753. * l4_proto numbers for standard protocol like UDP/TCP
  6754. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  6755. * l4_proto = 17 for UDP etc.
  6756. * b'31:8 - reserved: Reserved for future use.
  6757. *
  6758. */
  6759. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  6760. A_UINT32 msg_type:8,
  6761. pdev_id:8,
  6762. reserved0:16;
  6763. A_UINT32 ipsec_valid:1,
  6764. operation:7,
  6765. reserved1:24;
  6766. A_UINT32 ip_src_addr_31_0;
  6767. A_UINT32 ip_src_addr_63_32;
  6768. A_UINT32 ip_src_addr_95_64;
  6769. A_UINT32 ip_src_addr_127_96;
  6770. A_UINT32 ip_dest_addr_31_0;
  6771. A_UINT32 ip_dest_addr_63_32;
  6772. A_UINT32 ip_dest_addr_95_64;
  6773. A_UINT32 ip_dest_addr_127_96;
  6774. union {
  6775. A_UINT32 spi;
  6776. struct {
  6777. A_UINT32 l4_src_port:16,
  6778. l4_dest_port:16;
  6779. } ip;
  6780. } u;
  6781. A_UINT32 l4_proto:8,
  6782. reserved:24;
  6783. } POSTPACK;
  6784. /**
  6785. * @brief Host-->target HTT RX Full monitor mode register configuration message
  6786. *
  6787. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  6788. *
  6789. * @details
  6790. * The host will send this Full monitor mode register configuration message.
  6791. * This message can be sent per SOC or per PDEV which is differentiated
  6792. * by pdev id values.
  6793. *
  6794. * |31 16|15 11|10 8|7 3|2|1|0|
  6795. * |-------------------------------------------------------------|
  6796. * | reserved | pdev_id | MSG_TYPE |
  6797. * |-------------------------------------------------------------|
  6798. * | reserved |Release Ring |N|Z|E|
  6799. * |-------------------------------------------------------------|
  6800. *
  6801. * where E is 1-bit full monitor mode enable/disable.
  6802. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  6803. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  6804. *
  6805. * The following field definitions describe the format of the full monitor
  6806. * mode configuration message sent from the host to target for each pdev.
  6807. *
  6808. * Header fields:
  6809. * dword0 - b'7:0 - msg_type: This will be set to
  6810. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  6811. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6812. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6813. * specified pdev's LMAC ring.
  6814. * b'31:16 - reserved : Reserved for future use.
  6815. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  6816. * monitor mode rxdma register is to be enabled or disabled.
  6817. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  6818. * additional descriptors at ppdu end for zero mpdus
  6819. * enabled or disabled.
  6820. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  6821. * additional descriptors at ppdu end for non zero mpdus
  6822. * enabled or disabled.
  6823. * b'10:3 - release_ring: This indicates the destination ring
  6824. * selection for the descriptor at the end of PPDU
  6825. * 0 - REO ring select
  6826. * 1 - FW ring select
  6827. * 2 - SW ring select
  6828. * 3 - Release ring select
  6829. * Refer to htt_rx_full_mon_release_ring.
  6830. * b'31:11 - reserved for future use
  6831. */
  6832. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  6833. A_UINT32 msg_type:8,
  6834. pdev_id:8,
  6835. reserved0:16;
  6836. A_UINT32 full_monitor_mode_enable:1,
  6837. addnl_descs_zero_mpdus_end:1,
  6838. addnl_descs_non_zero_mpdus_end:1,
  6839. release_ring:8,
  6840. reserved1:21;
  6841. } POSTPACK;
  6842. /**
  6843. * Enumeration for full monitor mode destination ring select
  6844. * 0 - REO destination ring select
  6845. * 1 - FW destination ring select
  6846. * 2 - SW destination ring select
  6847. * 3 - Release destination ring select
  6848. */
  6849. enum htt_rx_full_mon_release_ring {
  6850. HTT_RX_MON_RING_REO,
  6851. HTT_RX_MON_RING_FW,
  6852. HTT_RX_MON_RING_SW,
  6853. HTT_RX_MON_RING_RELEASE,
  6854. };
  6855. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  6856. /* DWORD 0: Pdev ID */
  6857. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  6858. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  6859. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  6860. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  6861. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  6862. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  6863. do { \
  6864. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  6865. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  6866. } while (0)
  6867. /* DWORD 1:ENABLE */
  6868. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  6869. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  6870. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  6871. do { \
  6872. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  6873. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  6874. } while (0)
  6875. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6876. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6877. /* DWORD 1:ZERO_MPDU */
  6878. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6879. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6880. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6881. do { \
  6882. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6883. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6884. } while (0)
  6885. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6886. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6887. /* DWORD 1:NON_ZERO_MPDU */
  6888. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6889. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6890. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6891. do { \
  6892. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6893. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6894. } while (0)
  6895. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6896. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6897. /* DWORD 1:RELEASE_RINGS */
  6898. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6899. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6900. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6901. do { \
  6902. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6903. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6904. } while (0)
  6905. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6906. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6907. /**
  6908. * Enumeration for IP Protocol or IPSEC Protocol
  6909. * IPsec describes the framework for providing security at IP layer.
  6910. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6911. */
  6912. enum htt_rx_flow_proto {
  6913. HTT_RX_FLOW_IP_PROTO,
  6914. HTT_RX_FLOW_IPSEC_PROTO,
  6915. };
  6916. /**
  6917. * Enumeration for FSE Cache Invalidation
  6918. * 0 - No Cache Invalidation required
  6919. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6920. * 2 - Complete FSE Cache Invalidation
  6921. * 3 - FSE Disable
  6922. * 4 - FSE Enable
  6923. */
  6924. enum htt_rx_fse_operation {
  6925. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6926. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6927. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6928. HTT_RX_FSE_DISABLE,
  6929. HTT_RX_FSE_ENABLE,
  6930. };
  6931. /* DWORD 0: Pdev ID */
  6932. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6933. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6934. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6935. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6936. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6937. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6938. do { \
  6939. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6940. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6941. } while (0)
  6942. /* DWORD 1:IP PROTO or IPSEC */
  6943. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6944. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6945. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6946. do { \
  6947. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6948. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6949. } while (0)
  6950. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6951. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6952. /* DWORD 1:FSE Operation */
  6953. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6954. #define HTT_RX_FSE_OPERATION_S 1
  6955. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6956. do { \
  6957. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6958. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6959. } while (0)
  6960. #define HTT_RX_FSE_OPERATION_GET(word) \
  6961. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6962. /* DWORD 2-9:IP Address */
  6963. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6964. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6965. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6966. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6967. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6968. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6969. do { \
  6970. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6971. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6972. } while (0)
  6973. /* DWORD 10:Source Port Number */
  6974. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6975. #define HTT_RX_FSE_SOURCEPORT_S 0
  6976. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6977. do { \
  6978. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6979. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6980. } while (0)
  6981. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6982. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6983. /* DWORD 11:Destination Port Number */
  6984. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6985. #define HTT_RX_FSE_DESTPORT_S 16
  6986. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6987. do { \
  6988. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6989. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6990. } while (0)
  6991. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6992. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6993. /* DWORD 10-11:SPI (In case of IPSEC) */
  6994. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  6995. #define HTT_RX_FSE_OPERATION_SPI_S 0
  6996. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  6997. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  6998. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  6999. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7000. do { \
  7001. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7002. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7003. } while (0)
  7004. /* DWORD 12:L4 PROTO */
  7005. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7006. #define HTT_RX_FSE_L4_PROTO_S 0
  7007. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7008. do { \
  7009. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7010. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7011. } while (0)
  7012. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7013. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7014. /**
  7015. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7016. *
  7017. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7018. *
  7019. * |31 24|23 |15 8|7 2|1|0|
  7020. * |----------------+----------------+----------------+----------------|
  7021. * | reserved | pdev_id | msg_type |
  7022. * |---------------------------------+----------------+----------------|
  7023. * | reserved |E|F|
  7024. * |---------------------------------+----------------+----------------|
  7025. * Where E = Configure the target to provide the 3-tuple hash value in
  7026. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7027. * F = Configure the target to provide the 3-tuple hash value in
  7028. * flow_id_toeplitz field of rx_msdu_start tlv
  7029. *
  7030. * The following field definitions describe the format of the 3 tuple hash value
  7031. * message sent from the host to target as part of initialization sequence.
  7032. *
  7033. * Header fields:
  7034. * dword0 - b'7:0 - msg_type: This will be set to
  7035. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7036. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7037. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7038. * specified pdev's LMAC ring.
  7039. * b'31:16 - reserved : Reserved for future use
  7040. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7041. * b'1 - toeplitz_hash_2_or_4_field_enable
  7042. * b'31:2 - reserved : Reserved for future use
  7043. * ---------+------+----------------------------------------------------------
  7044. * bit1 | bit0 | Functionality
  7045. * ---------+------+----------------------------------------------------------
  7046. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7047. * | | in flow_id_toeplitz field
  7048. * ---------+------+----------------------------------------------------------
  7049. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7050. * | | in toeplitz_hash_2_or_4 field
  7051. * ---------+------+----------------------------------------------------------
  7052. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7053. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7054. * ---------+------+----------------------------------------------------------
  7055. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7056. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7057. * | | toeplitz_hash_2_or_4 field
  7058. *----------------------------------------------------------------------------
  7059. */
  7060. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7061. A_UINT32 msg_type :8,
  7062. pdev_id :8,
  7063. reserved0 :16;
  7064. A_UINT32 flow_id_toeplitz_field_enable :1,
  7065. toeplitz_hash_2_or_4_field_enable :1,
  7066. reserved1 :30;
  7067. } POSTPACK;
  7068. /* DWORD0 : pdev_id configuration Macros */
  7069. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7070. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7071. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7072. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7073. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7074. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7075. do { \
  7076. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7077. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7078. } while (0)
  7079. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7080. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7081. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7082. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7083. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7084. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7085. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7086. do { \
  7087. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7088. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7089. } while (0)
  7090. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7091. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7092. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7093. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7094. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7095. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7096. do { \
  7097. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7098. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7099. } while (0)
  7100. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7101. /**
  7102. * @brief host --> target Host PA Address Size
  7103. *
  7104. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7105. *
  7106. * @details
  7107. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7108. * provide the physical start address and size of each of the memory
  7109. * areas within host DDR that the target FW may need to access.
  7110. *
  7111. * For example, the host can use this message to allow the target FW
  7112. * to set up access to the host's pools of TQM link descriptors.
  7113. * The message would appear as follows:
  7114. *
  7115. * |31 24|23 16|15 8|7 0|
  7116. * |----------------+----------------+----------------+----------------|
  7117. * | reserved | num_entries | msg_type |
  7118. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7119. * | mem area 0 size |
  7120. * |----------------+----------------+----------------+----------------|
  7121. * | mem area 0 physical_address_lo |
  7122. * |----------------+----------------+----------------+----------------|
  7123. * | mem area 0 physical_address_hi |
  7124. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7125. * | mem area 1 size |
  7126. * |----------------+----------------+----------------+----------------|
  7127. * | mem area 1 physical_address_lo |
  7128. * |----------------+----------------+----------------+----------------|
  7129. * | mem area 1 physical_address_hi |
  7130. * |----------------+----------------+----------------+----------------|
  7131. * ...
  7132. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7133. * | mem area N size |
  7134. * |----------------+----------------+----------------+----------------|
  7135. * | mem area N physical_address_lo |
  7136. * |----------------+----------------+----------------+----------------|
  7137. * | mem area N physical_address_hi |
  7138. * |----------------+----------------+----------------+----------------|
  7139. *
  7140. * The message is interpreted as follows:
  7141. * dword0 - b'0:7 - msg_type: This will be set to
  7142. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7143. * b'8:15 - number_entries: Indicated the number of host memory
  7144. * areas specified within the remainder of the message
  7145. * b'16:31 - reserved.
  7146. * dword1 - b'0:31 - memory area 0 size in bytes
  7147. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7148. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7149. * and similar for memory area 1 through memory area N.
  7150. */
  7151. PREPACK struct htt_h2t_host_paddr_size {
  7152. A_UINT32 msg_type: 8,
  7153. num_entries: 8,
  7154. reserved: 16;
  7155. } POSTPACK;
  7156. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7157. A_UINT32 size;
  7158. A_UINT32 physical_address_lo;
  7159. A_UINT32 physical_address_hi;
  7160. } POSTPACK;
  7161. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7162. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7163. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7164. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7165. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7166. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7167. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7168. do { \
  7169. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7170. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7171. } while (0)
  7172. /**
  7173. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7174. *
  7175. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7176. *
  7177. * @details
  7178. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7179. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7180. *
  7181. * The message would appear as follows:
  7182. *
  7183. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7184. * |---------------------------------+---+---+----------+-+-----------|
  7185. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7186. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7187. *
  7188. *
  7189. * The message is interpreted as follows:
  7190. * dword0 - b'0:7 - msg_type: This will be set to
  7191. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7192. * b'8 - override bit to drive MSDUs to PPE ring
  7193. * b'9:13 - REO destination ring indication
  7194. * b'14 - Multi buffer msdu override enable bit
  7195. * b'15 - Intra BSS override
  7196. * b'16 - Decap raw override
  7197. * b'17 - Decap Native wifi override
  7198. * b'18 - IP frag override
  7199. * b'19:31 - reserved
  7200. */
  7201. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7202. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7203. override: 1,
  7204. reo_destination_indication: 5,
  7205. multi_buffer_msdu_override_en: 1,
  7206. intra_bss_override: 1,
  7207. decap_raw_override: 1,
  7208. decap_nwifi_override: 1,
  7209. ip_frag_override: 1,
  7210. reserved: 13;
  7211. } POSTPACK;
  7212. /* DWORD 0: Override */
  7213. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7214. #define HTT_PPE_CFG_OVERRIDE_S 8
  7215. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7216. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7217. HTT_PPE_CFG_OVERRIDE_S)
  7218. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7219. do { \
  7220. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7221. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7222. } while (0)
  7223. /* DWORD 0: REO Destination Indication*/
  7224. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7225. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7226. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7227. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7228. HTT_PPE_CFG_REO_DEST_IND_S)
  7229. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7230. do { \
  7231. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7232. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7233. } while (0)
  7234. /* DWORD 0: Multi buffer MSDU override */
  7235. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7236. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7237. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7238. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7239. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7240. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7241. do { \
  7242. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7243. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7244. } while (0)
  7245. /* DWORD 0: Intra BSS override */
  7246. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7247. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7248. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7249. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7250. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7251. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7252. do { \
  7253. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7254. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7255. } while (0)
  7256. /* DWORD 0: Decap RAW override */
  7257. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7258. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7259. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7260. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7261. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7262. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7263. do { \
  7264. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7265. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7266. } while (0)
  7267. /* DWORD 0: Decap NWIFI override */
  7268. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7269. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7270. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7271. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7272. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7273. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7274. do { \
  7275. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7276. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7277. } while (0)
  7278. /* DWORD 0: IP frag override */
  7279. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7280. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7281. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7282. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7283. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  7284. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  7285. do { \
  7286. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  7287. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  7288. } while (0)
  7289. /*
  7290. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  7291. *
  7292. * @details
  7293. * The following field definitions describe the format of the HTT host
  7294. * to target FW VDEV TX RX stats retrieve message.
  7295. * The message specifies the type of stats the host wants to retrieve.
  7296. *
  7297. * |31 27|26 25|24 17|16|15 8|7 0|
  7298. * |-----------------------------------------------------------|
  7299. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  7300. * |-----------------------------------------------------------|
  7301. * | vdev_id lower bitmask |
  7302. * |-----------------------------------------------------------|
  7303. * | vdev_id upper bitmask |
  7304. * |-----------------------------------------------------------|
  7305. * Header fields:
  7306. * Where:
  7307. * dword0 - b'7:0 - msg_type: This will be set to
  7308. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  7309. * b'15:8 - pdev id
  7310. * b'16(E) - Enable/Disable the vdev HW stats
  7311. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  7312. * b'25:26(R) - Reset stats bits
  7313. * 0: don't reset stats
  7314. * 1: reset stats once
  7315. * 2: reset stats at the start of each periodic interval
  7316. * b'27:31 - reserved for future use
  7317. * dword1 - b'0:31 - vdev_id lower bitmask
  7318. * dword2 - b'0:31 - vdev_id upper bitmask
  7319. */
  7320. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  7321. A_UINT32 msg_type :8,
  7322. pdev_id :8,
  7323. enable :1,
  7324. periodic_interval :8,
  7325. reset_stats_bits :2,
  7326. reserved0 :5;
  7327. A_UINT32 vdev_id_lower_bitmask;
  7328. A_UINT32 vdev_id_upper_bitmask;
  7329. } POSTPACK;
  7330. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  7331. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  7332. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  7333. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  7334. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  7335. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  7336. do { \
  7337. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  7338. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  7339. } while (0)
  7340. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  7341. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  7342. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  7343. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  7344. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  7345. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  7346. do { \
  7347. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  7348. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  7349. } while (0)
  7350. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  7351. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  7352. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  7353. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  7354. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  7355. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  7356. do { \
  7357. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  7358. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  7359. } while (0)
  7360. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  7361. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  7362. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  7363. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  7364. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  7365. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  7366. do { \
  7367. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  7368. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  7369. } while (0)
  7370. /*=== target -> host messages ===============================================*/
  7371. enum htt_t2h_msg_type {
  7372. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  7373. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  7374. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  7375. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  7376. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  7377. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  7378. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  7379. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  7380. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  7381. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  7382. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  7383. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  7384. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  7385. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  7386. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  7387. /* only used for HL, add HTT MSG for HTT CREDIT update */
  7388. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  7389. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  7390. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  7391. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  7392. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  7393. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  7394. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  7395. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  7396. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  7397. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  7398. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  7399. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  7400. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  7401. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  7402. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  7403. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  7404. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  7405. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  7406. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  7407. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  7408. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  7409. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  7410. /* TX_OFFLOAD_DELIVER_IND:
  7411. * Forward the target's locally-generated packets to the host,
  7412. * to provide to the monitor mode interface.
  7413. */
  7414. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  7415. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  7416. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  7417. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  7418. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  7419. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  7420. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  7421. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  7422. HTT_T2H_MSG_TYPE_TEST,
  7423. /* keep this last */
  7424. HTT_T2H_NUM_MSGS
  7425. };
  7426. /*
  7427. * HTT target to host message type -
  7428. * stored in bits 7:0 of the first word of the message
  7429. */
  7430. #define HTT_T2H_MSG_TYPE_M 0xff
  7431. #define HTT_T2H_MSG_TYPE_S 0
  7432. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  7433. do { \
  7434. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  7435. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  7436. } while (0)
  7437. #define HTT_T2H_MSG_TYPE_GET(word) \
  7438. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  7439. /**
  7440. * @brief target -> host version number confirmation message definition
  7441. *
  7442. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  7443. *
  7444. * |31 24|23 16|15 8|7 0|
  7445. * |----------------+----------------+----------------+----------------|
  7446. * | reserved | major number | minor number | msg type |
  7447. * |-------------------------------------------------------------------|
  7448. * : option request TLV (optional) |
  7449. * :...................................................................:
  7450. *
  7451. * The VER_CONF message may consist of a single 4-byte word, or may be
  7452. * extended with TLVs that specify HTT options selected by the target.
  7453. * The following option TLVs may be appended to the VER_CONF message:
  7454. * - LL_BUS_ADDR_SIZE
  7455. * - HL_SUPPRESS_TX_COMPL_IND
  7456. * - MAX_TX_QUEUE_GROUPS
  7457. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  7458. * may be appended to the VER_CONF message (but only one TLV of each type).
  7459. *
  7460. * Header fields:
  7461. * - MSG_TYPE
  7462. * Bits 7:0
  7463. * Purpose: identifies this as a version number confirmation message
  7464. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  7465. * - VER_MINOR
  7466. * Bits 15:8
  7467. * Purpose: Specify the minor number of the HTT message library version
  7468. * in use by the target firmware.
  7469. * The minor number specifies the specific revision within a range
  7470. * of fundamentally compatible HTT message definition revisions.
  7471. * Compatible revisions involve adding new messages or perhaps
  7472. * adding new fields to existing messages, in a backwards-compatible
  7473. * manner.
  7474. * Incompatible revisions involve changing the message type values,
  7475. * or redefining existing messages.
  7476. * Value: minor number
  7477. * - VER_MAJOR
  7478. * Bits 15:8
  7479. * Purpose: Specify the major number of the HTT message library version
  7480. * in use by the target firmware.
  7481. * The major number specifies the family of minor revisions that are
  7482. * fundamentally compatible with each other, but not with prior or
  7483. * later families.
  7484. * Value: major number
  7485. */
  7486. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  7487. #define HTT_VER_CONF_MINOR_S 8
  7488. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  7489. #define HTT_VER_CONF_MAJOR_S 16
  7490. #define HTT_VER_CONF_MINOR_SET(word, value) \
  7491. do { \
  7492. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  7493. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  7494. } while (0)
  7495. #define HTT_VER_CONF_MINOR_GET(word) \
  7496. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  7497. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  7498. do { \
  7499. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  7500. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  7501. } while (0)
  7502. #define HTT_VER_CONF_MAJOR_GET(word) \
  7503. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  7504. #define HTT_VER_CONF_BYTES 4
  7505. /**
  7506. * @brief - target -> host HTT Rx In order indication message
  7507. *
  7508. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  7509. *
  7510. * @details
  7511. *
  7512. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  7513. * |----------------+-------------------+---------------------+---------------|
  7514. * | peer ID | P| F| O| ext TID | msg type |
  7515. * |--------------------------------------------------------------------------|
  7516. * | MSDU count | Reserved | vdev id |
  7517. * |--------------------------------------------------------------------------|
  7518. * | MSDU 0 bus address (bits 31:0) |
  7519. #if HTT_PADDR64
  7520. * | MSDU 0 bus address (bits 63:32) |
  7521. #endif
  7522. * |--------------------------------------------------------------------------|
  7523. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  7524. * |--------------------------------------------------------------------------|
  7525. * | MSDU 1 bus address (bits 31:0) |
  7526. #if HTT_PADDR64
  7527. * | MSDU 1 bus address (bits 63:32) |
  7528. #endif
  7529. * |--------------------------------------------------------------------------|
  7530. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  7531. * |--------------------------------------------------------------------------|
  7532. */
  7533. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  7534. *
  7535. * @details
  7536. * bits
  7537. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  7538. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7539. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  7540. * | | frag | | | | fail |chksum fail|
  7541. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7542. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  7543. */
  7544. struct htt_rx_in_ord_paddr_ind_hdr_t
  7545. {
  7546. A_UINT32 /* word 0 */
  7547. msg_type: 8,
  7548. ext_tid: 5,
  7549. offload: 1,
  7550. frag: 1,
  7551. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  7552. peer_id: 16;
  7553. A_UINT32 /* word 1 */
  7554. vap_id: 8,
  7555. /* NOTE:
  7556. * This reserved_1 field is not truly reserved - certain targets use
  7557. * this field internally to store debug information, and do not zero
  7558. * out the contents of the field before uploading the message to the
  7559. * host. Thus, any host-target communication supported by this field
  7560. * is limited to using values that are never used by the debug
  7561. * information stored by certain targets in the reserved_1 field.
  7562. * In particular, the targets in question don't use the value 0x3
  7563. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  7564. * so this previously-unused value within these bits is available to
  7565. * use as the host / target PKT_CAPTURE_MODE flag.
  7566. */
  7567. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  7568. /* if pkt_capture_mode == 0x3, host should
  7569. * send rx frames to monitor mode interface
  7570. */
  7571. msdu_cnt: 16;
  7572. };
  7573. struct htt_rx_in_ord_paddr_ind_msdu32_t
  7574. {
  7575. A_UINT32 dma_addr;
  7576. A_UINT32
  7577. length: 16,
  7578. fw_desc: 8,
  7579. msdu_info:8;
  7580. };
  7581. struct htt_rx_in_ord_paddr_ind_msdu64_t
  7582. {
  7583. A_UINT32 dma_addr_lo;
  7584. A_UINT32 dma_addr_hi;
  7585. A_UINT32
  7586. length: 16,
  7587. fw_desc: 8,
  7588. msdu_info:8;
  7589. };
  7590. #if HTT_PADDR64
  7591. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  7592. #else
  7593. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  7594. #endif
  7595. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  7596. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  7597. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  7598. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  7599. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  7600. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  7601. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  7602. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  7603. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  7604. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  7605. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  7606. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  7607. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  7608. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  7609. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  7610. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  7611. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  7612. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  7613. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  7614. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  7615. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  7616. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  7617. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  7618. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  7619. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  7620. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  7621. /* for systems using 64-bit format for bus addresses */
  7622. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  7623. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  7624. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  7625. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  7626. /* for systems using 32-bit format for bus addresses */
  7627. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  7628. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  7629. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  7630. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  7631. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  7632. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  7633. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  7634. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  7635. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  7636. do { \
  7637. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  7638. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  7639. } while (0)
  7640. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  7641. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  7642. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  7643. do { \
  7644. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  7645. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  7646. } while (0)
  7647. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  7648. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  7649. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  7650. do { \
  7651. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  7652. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  7653. } while (0)
  7654. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  7655. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  7656. /*
  7657. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  7658. * deliver the rx frames to the monitor mode interface.
  7659. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  7660. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  7661. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  7662. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  7663. */
  7664. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  7665. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  7666. do { \
  7667. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  7668. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  7669. } while (0)
  7670. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  7671. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  7672. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  7673. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  7674. do { \
  7675. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  7676. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  7677. } while (0)
  7678. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  7679. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  7680. /* for systems using 64-bit format for bus addresses */
  7681. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  7682. do { \
  7683. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  7684. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  7685. } while (0)
  7686. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  7687. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  7688. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  7689. do { \
  7690. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  7691. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  7692. } while (0)
  7693. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  7694. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  7695. /* for systems using 32-bit format for bus addresses */
  7696. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  7697. do { \
  7698. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  7699. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  7700. } while (0)
  7701. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  7702. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  7703. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  7704. do { \
  7705. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  7706. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  7707. } while (0)
  7708. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  7709. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  7710. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  7711. do { \
  7712. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  7713. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  7714. } while (0)
  7715. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  7716. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  7717. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  7718. do { \
  7719. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  7720. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  7721. } while (0)
  7722. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  7723. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  7724. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  7725. do { \
  7726. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  7727. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  7728. } while (0)
  7729. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  7730. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  7731. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  7732. do { \
  7733. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  7734. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  7735. } while (0)
  7736. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  7737. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  7738. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  7739. do { \
  7740. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  7741. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  7742. } while (0)
  7743. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  7744. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  7745. /* definitions used within target -> host rx indication message */
  7746. PREPACK struct htt_rx_ind_hdr_prefix_t
  7747. {
  7748. A_UINT32 /* word 0 */
  7749. msg_type: 8,
  7750. ext_tid: 5,
  7751. release_valid: 1,
  7752. flush_valid: 1,
  7753. reserved0: 1,
  7754. peer_id: 16;
  7755. A_UINT32 /* word 1 */
  7756. flush_start_seq_num: 6,
  7757. flush_end_seq_num: 6,
  7758. release_start_seq_num: 6,
  7759. release_end_seq_num: 6,
  7760. num_mpdu_ranges: 8;
  7761. } POSTPACK;
  7762. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  7763. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  7764. #define HTT_TGT_RSSI_INVALID 0x80
  7765. PREPACK struct htt_rx_ppdu_desc_t
  7766. {
  7767. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  7768. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  7769. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  7770. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  7771. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  7772. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  7773. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  7774. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  7775. A_UINT32 /* word 0 */
  7776. rssi_cmb: 8,
  7777. timestamp_submicrosec: 8,
  7778. phy_err_code: 8,
  7779. phy_err: 1,
  7780. legacy_rate: 4,
  7781. legacy_rate_sel: 1,
  7782. end_valid: 1,
  7783. start_valid: 1;
  7784. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  7785. union {
  7786. A_UINT32 /* word 1 */
  7787. rssi0_pri20: 8,
  7788. rssi0_ext20: 8,
  7789. rssi0_ext40: 8,
  7790. rssi0_ext80: 8;
  7791. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  7792. } u0;
  7793. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  7794. union {
  7795. A_UINT32 /* word 2 */
  7796. rssi1_pri20: 8,
  7797. rssi1_ext20: 8,
  7798. rssi1_ext40: 8,
  7799. rssi1_ext80: 8;
  7800. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  7801. } u1;
  7802. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  7803. union {
  7804. A_UINT32 /* word 3 */
  7805. rssi2_pri20: 8,
  7806. rssi2_ext20: 8,
  7807. rssi2_ext40: 8,
  7808. rssi2_ext80: 8;
  7809. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  7810. } u2;
  7811. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  7812. union {
  7813. A_UINT32 /* word 4 */
  7814. rssi3_pri20: 8,
  7815. rssi3_ext20: 8,
  7816. rssi3_ext40: 8,
  7817. rssi3_ext80: 8;
  7818. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  7819. } u3;
  7820. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  7821. A_UINT32 tsf32; /* word 5 */
  7822. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  7823. A_UINT32 timestamp_microsec; /* word 6 */
  7824. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  7825. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  7826. A_UINT32 /* word 7 */
  7827. vht_sig_a1: 24,
  7828. preamble_type: 8;
  7829. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  7830. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  7831. A_UINT32 /* word 8 */
  7832. vht_sig_a2: 24,
  7833. /* sa_ant_matrix
  7834. * For cases where a single rx chain has options to be connected to
  7835. * different rx antennas, show which rx antennas were in use during
  7836. * receipt of a given PPDU.
  7837. * This sa_ant_matrix provides a bitmask of the antennas used while
  7838. * receiving this frame.
  7839. */
  7840. sa_ant_matrix: 8;
  7841. } POSTPACK;
  7842. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  7843. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  7844. PREPACK struct htt_rx_ind_hdr_suffix_t
  7845. {
  7846. A_UINT32 /* word 0 */
  7847. fw_rx_desc_bytes: 16,
  7848. reserved0: 16;
  7849. } POSTPACK;
  7850. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  7851. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  7852. PREPACK struct htt_rx_ind_hdr_t
  7853. {
  7854. struct htt_rx_ind_hdr_prefix_t prefix;
  7855. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  7856. struct htt_rx_ind_hdr_suffix_t suffix;
  7857. } POSTPACK;
  7858. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  7859. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  7860. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  7861. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  7862. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  7863. /*
  7864. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  7865. * the offset into the HTT rx indication message at which the
  7866. * FW rx PPDU descriptor resides
  7867. */
  7868. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  7869. /*
  7870. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  7871. * the offset into the HTT rx indication message at which the
  7872. * header suffix (FW rx MSDU byte count) resides
  7873. */
  7874. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  7875. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  7876. /*
  7877. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  7878. * the offset into the HTT rx indication message at which the per-MSDU
  7879. * information starts
  7880. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  7881. * per-MSDU information portion of the message. The per-MSDU info itself
  7882. * starts at byte 12.
  7883. */
  7884. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  7885. /**
  7886. * @brief target -> host rx indication message definition
  7887. *
  7888. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  7889. *
  7890. * @details
  7891. * The following field definitions describe the format of the rx indication
  7892. * message sent from the target to the host.
  7893. * The message consists of three major sections:
  7894. * 1. a fixed-length header
  7895. * 2. a variable-length list of firmware rx MSDU descriptors
  7896. * 3. one or more 4-octet MPDU range information elements
  7897. * The fixed length header itself has two sub-sections
  7898. * 1. the message meta-information, including identification of the
  7899. * sender and type of the received data, and a 4-octet flush/release IE
  7900. * 2. the firmware rx PPDU descriptor
  7901. *
  7902. * The format of the message is depicted below.
  7903. * in this depiction, the following abbreviations are used for information
  7904. * elements within the message:
  7905. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  7906. * elements associated with the PPDU start are valid.
  7907. * Specifically, the following fields are valid only if SV is set:
  7908. * RSSI (all variants), L, legacy rate, preamble type, service,
  7909. * VHT-SIG-A
  7910. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  7911. * elements associated with the PPDU end are valid.
  7912. * Specifically, the following fields are valid only if EV is set:
  7913. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  7914. * - L - Legacy rate selector - if legacy rates are used, this flag
  7915. * indicates whether the rate is from a CCK (L == 1) or OFDM
  7916. * (L == 0) PHY.
  7917. * - P - PHY error flag - boolean indication of whether the rx frame had
  7918. * a PHY error
  7919. *
  7920. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7921. * |----------------+-------------------+---------------------+---------------|
  7922. * | peer ID | |RV|FV| ext TID | msg type |
  7923. * |--------------------------------------------------------------------------|
  7924. * | num | release | release | flush | flush |
  7925. * | MPDU | end | start | end | start |
  7926. * | ranges | seq num | seq num | seq num | seq num |
  7927. * |==========================================================================|
  7928. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  7929. * |V|V| | rate | | | timestamp | RSSI |
  7930. * |--------------------------------------------------------------------------|
  7931. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  7932. * |--------------------------------------------------------------------------|
  7933. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  7934. * |--------------------------------------------------------------------------|
  7935. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  7936. * |--------------------------------------------------------------------------|
  7937. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  7938. * |--------------------------------------------------------------------------|
  7939. * | TSF LSBs |
  7940. * |--------------------------------------------------------------------------|
  7941. * | microsec timestamp |
  7942. * |--------------------------------------------------------------------------|
  7943. * | preamble type | HT-SIG / VHT-SIG-A1 |
  7944. * |--------------------------------------------------------------------------|
  7945. * | service | HT-SIG / VHT-SIG-A2 |
  7946. * |==========================================================================|
  7947. * | reserved | FW rx desc bytes |
  7948. * |--------------------------------------------------------------------------|
  7949. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  7950. * | desc B3 | desc B2 | desc B1 | desc B0 |
  7951. * |--------------------------------------------------------------------------|
  7952. * : : :
  7953. * |--------------------------------------------------------------------------|
  7954. * | alignment | MSDU Rx |
  7955. * | padding | desc Bn |
  7956. * |--------------------------------------------------------------------------|
  7957. * | reserved | MPDU range status | MPDU count |
  7958. * |--------------------------------------------------------------------------|
  7959. * : reserved : MPDU range status : MPDU count :
  7960. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  7961. *
  7962. * Header fields:
  7963. * - MSG_TYPE
  7964. * Bits 7:0
  7965. * Purpose: identifies this as an rx indication message
  7966. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  7967. * - EXT_TID
  7968. * Bits 12:8
  7969. * Purpose: identify the traffic ID of the rx data, including
  7970. * special "extended" TID values for multicast, broadcast, and
  7971. * non-QoS data frames
  7972. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7973. * - FLUSH_VALID (FV)
  7974. * Bit 13
  7975. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7976. * is valid
  7977. * Value:
  7978. * 1 -> flush IE is valid and needs to be processed
  7979. * 0 -> flush IE is not valid and should be ignored
  7980. * - REL_VALID (RV)
  7981. * Bit 13
  7982. * Purpose: indicate whether the release IE (start/end sequence numbers)
  7983. * is valid
  7984. * Value:
  7985. * 1 -> release IE is valid and needs to be processed
  7986. * 0 -> release IE is not valid and should be ignored
  7987. * - PEER_ID
  7988. * Bits 31:16
  7989. * Purpose: Identify, by ID, which peer sent the rx data
  7990. * Value: ID of the peer who sent the rx data
  7991. * - FLUSH_SEQ_NUM_START
  7992. * Bits 5:0
  7993. * Purpose: Indicate the start of a series of MPDUs to flush
  7994. * Not all MPDUs within this series are necessarily valid - the host
  7995. * must check each sequence number within this range to see if the
  7996. * corresponding MPDU is actually present.
  7997. * This field is only valid if the FV bit is set.
  7998. * Value:
  7999. * The sequence number for the first MPDUs to check to flush.
  8000. * The sequence number is masked by 0x3f.
  8001. * - FLUSH_SEQ_NUM_END
  8002. * Bits 11:6
  8003. * Purpose: Indicate the end of a series of MPDUs to flush
  8004. * Value:
  8005. * The sequence number one larger than the sequence number of the
  8006. * last MPDU to check to flush.
  8007. * The sequence number is masked by 0x3f.
  8008. * Not all MPDUs within this series are necessarily valid - the host
  8009. * must check each sequence number within this range to see if the
  8010. * corresponding MPDU is actually present.
  8011. * This field is only valid if the FV bit is set.
  8012. * - REL_SEQ_NUM_START
  8013. * Bits 17:12
  8014. * Purpose: Indicate the start of a series of MPDUs to release.
  8015. * All MPDUs within this series are present and valid - the host
  8016. * need not check each sequence number within this range to see if
  8017. * the corresponding MPDU is actually present.
  8018. * This field is only valid if the RV bit is set.
  8019. * Value:
  8020. * The sequence number for the first MPDUs to check to release.
  8021. * The sequence number is masked by 0x3f.
  8022. * - REL_SEQ_NUM_END
  8023. * Bits 23:18
  8024. * Purpose: Indicate the end of a series of MPDUs to release.
  8025. * Value:
  8026. * The sequence number one larger than the sequence number of the
  8027. * last MPDU to check to release.
  8028. * The sequence number is masked by 0x3f.
  8029. * All MPDUs within this series are present and valid - the host
  8030. * need not check each sequence number within this range to see if
  8031. * the corresponding MPDU is actually present.
  8032. * This field is only valid if the RV bit is set.
  8033. * - NUM_MPDU_RANGES
  8034. * Bits 31:24
  8035. * Purpose: Indicate how many ranges of MPDUs are present.
  8036. * Each MPDU range consists of a series of contiguous MPDUs within the
  8037. * rx frame sequence which all have the same MPDU status.
  8038. * Value: 1-63 (typically a small number, like 1-3)
  8039. *
  8040. * Rx PPDU descriptor fields:
  8041. * - RSSI_CMB
  8042. * Bits 7:0
  8043. * Purpose: Combined RSSI from all active rx chains, across the active
  8044. * bandwidth.
  8045. * Value: RSSI dB units w.r.t. noise floor
  8046. * - TIMESTAMP_SUBMICROSEC
  8047. * Bits 15:8
  8048. * Purpose: high-resolution timestamp
  8049. * Value:
  8050. * Sub-microsecond time of PPDU reception.
  8051. * This timestamp ranges from [0,MAC clock MHz).
  8052. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8053. * to form a high-resolution, large range rx timestamp.
  8054. * - PHY_ERR_CODE
  8055. * Bits 23:16
  8056. * Purpose:
  8057. * If the rx frame processing resulted in a PHY error, indicate what
  8058. * type of rx PHY error occurred.
  8059. * Value:
  8060. * This field is valid if the "P" (PHY_ERR) flag is set.
  8061. * TBD: document/specify the values for this field
  8062. * - PHY_ERR
  8063. * Bit 24
  8064. * Purpose: indicate whether the rx PPDU had a PHY error
  8065. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8066. * - LEGACY_RATE
  8067. * Bits 28:25
  8068. * Purpose:
  8069. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8070. * specify which rate was used.
  8071. * Value:
  8072. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8073. * flag.
  8074. * If LEGACY_RATE_SEL is 0:
  8075. * 0x8: OFDM 48 Mbps
  8076. * 0x9: OFDM 24 Mbps
  8077. * 0xA: OFDM 12 Mbps
  8078. * 0xB: OFDM 6 Mbps
  8079. * 0xC: OFDM 54 Mbps
  8080. * 0xD: OFDM 36 Mbps
  8081. * 0xE: OFDM 18 Mbps
  8082. * 0xF: OFDM 9 Mbps
  8083. * If LEGACY_RATE_SEL is 1:
  8084. * 0x8: CCK 11 Mbps long preamble
  8085. * 0x9: CCK 5.5 Mbps long preamble
  8086. * 0xA: CCK 2 Mbps long preamble
  8087. * 0xB: CCK 1 Mbps long preamble
  8088. * 0xC: CCK 11 Mbps short preamble
  8089. * 0xD: CCK 5.5 Mbps short preamble
  8090. * 0xE: CCK 2 Mbps short preamble
  8091. * - LEGACY_RATE_SEL
  8092. * Bit 29
  8093. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8094. * Value:
  8095. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8096. * used a legacy rate.
  8097. * 0 -> OFDM, 1 -> CCK
  8098. * - END_VALID
  8099. * Bit 30
  8100. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8101. * the start of the PPDU are valid. Specifically, the following
  8102. * fields are only valid if END_VALID is set:
  8103. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8104. * TIMESTAMP_SUBMICROSEC
  8105. * Value:
  8106. * 0 -> rx PPDU desc end fields are not valid
  8107. * 1 -> rx PPDU desc end fields are valid
  8108. * - START_VALID
  8109. * Bit 31
  8110. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8111. * the end of the PPDU are valid. Specifically, the following
  8112. * fields are only valid if START_VALID is set:
  8113. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8114. * VHT-SIG-A
  8115. * Value:
  8116. * 0 -> rx PPDU desc start fields are not valid
  8117. * 1 -> rx PPDU desc start fields are valid
  8118. * - RSSI0_PRI20
  8119. * Bits 7:0
  8120. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8121. * Value: RSSI dB units w.r.t. noise floor
  8122. *
  8123. * - RSSI0_EXT20
  8124. * Bits 7:0
  8125. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8126. * (if the rx bandwidth was >= 40 MHz)
  8127. * Value: RSSI dB units w.r.t. noise floor
  8128. * - RSSI0_EXT40
  8129. * Bits 7:0
  8130. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8131. * (if the rx bandwidth was >= 80 MHz)
  8132. * Value: RSSI dB units w.r.t. noise floor
  8133. * - RSSI0_EXT80
  8134. * Bits 7:0
  8135. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8136. * (if the rx bandwidth was >= 160 MHz)
  8137. * Value: RSSI dB units w.r.t. noise floor
  8138. *
  8139. * - RSSI1_PRI20
  8140. * Bits 7:0
  8141. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  8142. * Value: RSSI dB units w.r.t. noise floor
  8143. * - RSSI1_EXT20
  8144. * Bits 7:0
  8145. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  8146. * (if the rx bandwidth was >= 40 MHz)
  8147. * Value: RSSI dB units w.r.t. noise floor
  8148. * - RSSI1_EXT40
  8149. * Bits 7:0
  8150. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  8151. * (if the rx bandwidth was >= 80 MHz)
  8152. * Value: RSSI dB units w.r.t. noise floor
  8153. * - RSSI1_EXT80
  8154. * Bits 7:0
  8155. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  8156. * (if the rx bandwidth was >= 160 MHz)
  8157. * Value: RSSI dB units w.r.t. noise floor
  8158. *
  8159. * - RSSI2_PRI20
  8160. * Bits 7:0
  8161. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  8162. * Value: RSSI dB units w.r.t. noise floor
  8163. * - RSSI2_EXT20
  8164. * Bits 7:0
  8165. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  8166. * (if the rx bandwidth was >= 40 MHz)
  8167. * Value: RSSI dB units w.r.t. noise floor
  8168. * - RSSI2_EXT40
  8169. * Bits 7:0
  8170. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  8171. * (if the rx bandwidth was >= 80 MHz)
  8172. * Value: RSSI dB units w.r.t. noise floor
  8173. * - RSSI2_EXT80
  8174. * Bits 7:0
  8175. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  8176. * (if the rx bandwidth was >= 160 MHz)
  8177. * Value: RSSI dB units w.r.t. noise floor
  8178. *
  8179. * - RSSI3_PRI20
  8180. * Bits 7:0
  8181. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  8182. * Value: RSSI dB units w.r.t. noise floor
  8183. * - RSSI3_EXT20
  8184. * Bits 7:0
  8185. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  8186. * (if the rx bandwidth was >= 40 MHz)
  8187. * Value: RSSI dB units w.r.t. noise floor
  8188. * - RSSI3_EXT40
  8189. * Bits 7:0
  8190. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  8191. * (if the rx bandwidth was >= 80 MHz)
  8192. * Value: RSSI dB units w.r.t. noise floor
  8193. * - RSSI3_EXT80
  8194. * Bits 7:0
  8195. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  8196. * (if the rx bandwidth was >= 160 MHz)
  8197. * Value: RSSI dB units w.r.t. noise floor
  8198. *
  8199. * - TSF32
  8200. * Bits 31:0
  8201. * Purpose: specify the time the rx PPDU was received, in TSF units
  8202. * Value: 32 LSBs of the TSF
  8203. * - TIMESTAMP_MICROSEC
  8204. * Bits 31:0
  8205. * Purpose: specify the time the rx PPDU was received, in microsecond units
  8206. * Value: PPDU rx time, in microseconds
  8207. * - VHT_SIG_A1
  8208. * Bits 23:0
  8209. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  8210. * from the rx PPDU
  8211. * Value:
  8212. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8213. * VHT-SIG-A1 data.
  8214. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8215. * first 24 bits of the HT-SIG data.
  8216. * Otherwise, this field is invalid.
  8217. * Refer to the the 802.11 protocol for the definition of the
  8218. * HT-SIG and VHT-SIG-A1 fields
  8219. * - VHT_SIG_A2
  8220. * Bits 23:0
  8221. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  8222. * from the rx PPDU
  8223. * Value:
  8224. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8225. * VHT-SIG-A2 data.
  8226. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8227. * last 24 bits of the HT-SIG data.
  8228. * Otherwise, this field is invalid.
  8229. * Refer to the the 802.11 protocol for the definition of the
  8230. * HT-SIG and VHT-SIG-A2 fields
  8231. * - PREAMBLE_TYPE
  8232. * Bits 31:24
  8233. * Purpose: indicate the PHY format of the received burst
  8234. * Value:
  8235. * 0x4: Legacy (OFDM/CCK)
  8236. * 0x8: HT
  8237. * 0x9: HT with TxBF
  8238. * 0xC: VHT
  8239. * 0xD: VHT with TxBF
  8240. * - SERVICE
  8241. * Bits 31:24
  8242. * Purpose: TBD
  8243. * Value: TBD
  8244. *
  8245. * Rx MSDU descriptor fields:
  8246. * - FW_RX_DESC_BYTES
  8247. * Bits 15:0
  8248. * Purpose: Indicate how many bytes in the Rx indication are used for
  8249. * FW Rx descriptors
  8250. *
  8251. * Payload fields:
  8252. * - MPDU_COUNT
  8253. * Bits 7:0
  8254. * Purpose: Indicate how many sequential MPDUs share the same status.
  8255. * All MPDUs within the indicated list are from the same RA-TA-TID.
  8256. * - MPDU_STATUS
  8257. * Bits 15:8
  8258. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  8259. * received successfully.
  8260. * Value:
  8261. * 0x1: success
  8262. * 0x2: FCS error
  8263. * 0x3: duplicate error
  8264. * 0x4: replay error
  8265. * 0x5: invalid peer
  8266. */
  8267. /* header fields */
  8268. #define HTT_RX_IND_EXT_TID_M 0x1f00
  8269. #define HTT_RX_IND_EXT_TID_S 8
  8270. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  8271. #define HTT_RX_IND_FLUSH_VALID_S 13
  8272. #define HTT_RX_IND_REL_VALID_M 0x4000
  8273. #define HTT_RX_IND_REL_VALID_S 14
  8274. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  8275. #define HTT_RX_IND_PEER_ID_S 16
  8276. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  8277. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  8278. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  8279. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  8280. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  8281. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  8282. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  8283. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  8284. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  8285. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  8286. /* rx PPDU descriptor fields */
  8287. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  8288. #define HTT_RX_IND_RSSI_CMB_S 0
  8289. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  8290. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  8291. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  8292. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  8293. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  8294. #define HTT_RX_IND_PHY_ERR_S 24
  8295. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  8296. #define HTT_RX_IND_LEGACY_RATE_S 25
  8297. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  8298. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  8299. #define HTT_RX_IND_END_VALID_M 0x40000000
  8300. #define HTT_RX_IND_END_VALID_S 30
  8301. #define HTT_RX_IND_START_VALID_M 0x80000000
  8302. #define HTT_RX_IND_START_VALID_S 31
  8303. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  8304. #define HTT_RX_IND_RSSI_PRI20_S 0
  8305. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  8306. #define HTT_RX_IND_RSSI_EXT20_S 8
  8307. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  8308. #define HTT_RX_IND_RSSI_EXT40_S 16
  8309. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  8310. #define HTT_RX_IND_RSSI_EXT80_S 24
  8311. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  8312. #define HTT_RX_IND_VHT_SIG_A1_S 0
  8313. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  8314. #define HTT_RX_IND_VHT_SIG_A2_S 0
  8315. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  8316. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  8317. #define HTT_RX_IND_SERVICE_M 0xff000000
  8318. #define HTT_RX_IND_SERVICE_S 24
  8319. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  8320. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  8321. /* rx MSDU descriptor fields */
  8322. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  8323. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  8324. /* payload fields */
  8325. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  8326. #define HTT_RX_IND_MPDU_COUNT_S 0
  8327. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  8328. #define HTT_RX_IND_MPDU_STATUS_S 8
  8329. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  8330. do { \
  8331. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  8332. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  8333. } while (0)
  8334. #define HTT_RX_IND_EXT_TID_GET(word) \
  8335. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  8336. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  8337. do { \
  8338. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  8339. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  8340. } while (0)
  8341. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  8342. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  8343. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  8344. do { \
  8345. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  8346. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  8347. } while (0)
  8348. #define HTT_RX_IND_REL_VALID_GET(word) \
  8349. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  8350. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  8351. do { \
  8352. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  8353. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  8354. } while (0)
  8355. #define HTT_RX_IND_PEER_ID_GET(word) \
  8356. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  8357. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  8358. do { \
  8359. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  8360. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  8361. } while (0)
  8362. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  8363. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  8364. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  8365. do { \
  8366. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  8367. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  8368. } while (0)
  8369. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  8370. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  8371. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  8372. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  8373. do { \
  8374. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  8375. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  8376. } while (0)
  8377. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  8378. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  8379. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  8380. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  8381. do { \
  8382. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  8383. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  8384. } while (0)
  8385. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  8386. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  8387. HTT_RX_IND_REL_SEQ_NUM_START_S)
  8388. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  8389. do { \
  8390. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  8391. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  8392. } while (0)
  8393. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  8394. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  8395. HTT_RX_IND_REL_SEQ_NUM_END_S)
  8396. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  8397. do { \
  8398. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  8399. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  8400. } while (0)
  8401. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  8402. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  8403. HTT_RX_IND_NUM_MPDU_RANGES_S)
  8404. /* FW rx PPDU descriptor fields */
  8405. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  8406. do { \
  8407. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  8408. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  8409. } while (0)
  8410. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  8411. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  8412. HTT_RX_IND_RSSI_CMB_S)
  8413. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  8414. do { \
  8415. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  8416. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  8417. } while (0)
  8418. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  8419. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  8420. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  8421. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  8422. do { \
  8423. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  8424. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  8425. } while (0)
  8426. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  8427. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  8428. HTT_RX_IND_PHY_ERR_CODE_S)
  8429. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  8430. do { \
  8431. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  8432. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  8433. } while (0)
  8434. #define HTT_RX_IND_PHY_ERR_GET(word) \
  8435. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  8436. HTT_RX_IND_PHY_ERR_S)
  8437. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  8438. do { \
  8439. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  8440. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  8441. } while (0)
  8442. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  8443. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  8444. HTT_RX_IND_LEGACY_RATE_S)
  8445. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  8446. do { \
  8447. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  8448. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  8449. } while (0)
  8450. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  8451. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  8452. HTT_RX_IND_LEGACY_RATE_SEL_S)
  8453. #define HTT_RX_IND_END_VALID_SET(word, value) \
  8454. do { \
  8455. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  8456. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  8457. } while (0)
  8458. #define HTT_RX_IND_END_VALID_GET(word) \
  8459. (((word) & HTT_RX_IND_END_VALID_M) >> \
  8460. HTT_RX_IND_END_VALID_S)
  8461. #define HTT_RX_IND_START_VALID_SET(word, value) \
  8462. do { \
  8463. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  8464. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  8465. } while (0)
  8466. #define HTT_RX_IND_START_VALID_GET(word) \
  8467. (((word) & HTT_RX_IND_START_VALID_M) >> \
  8468. HTT_RX_IND_START_VALID_S)
  8469. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  8470. do { \
  8471. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  8472. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  8473. } while (0)
  8474. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  8475. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  8476. HTT_RX_IND_RSSI_PRI20_S)
  8477. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  8478. do { \
  8479. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  8480. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  8481. } while (0)
  8482. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  8483. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  8484. HTT_RX_IND_RSSI_EXT20_S)
  8485. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  8486. do { \
  8487. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  8488. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  8489. } while (0)
  8490. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  8491. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  8492. HTT_RX_IND_RSSI_EXT40_S)
  8493. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  8494. do { \
  8495. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  8496. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  8497. } while (0)
  8498. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  8499. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  8500. HTT_RX_IND_RSSI_EXT80_S)
  8501. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  8502. do { \
  8503. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  8504. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  8505. } while (0)
  8506. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  8507. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  8508. HTT_RX_IND_VHT_SIG_A1_S)
  8509. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  8510. do { \
  8511. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  8512. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  8513. } while (0)
  8514. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  8515. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  8516. HTT_RX_IND_VHT_SIG_A2_S)
  8517. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  8518. do { \
  8519. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  8520. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  8521. } while (0)
  8522. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  8523. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  8524. HTT_RX_IND_PREAMBLE_TYPE_S)
  8525. #define HTT_RX_IND_SERVICE_SET(word, value) \
  8526. do { \
  8527. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  8528. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  8529. } while (0)
  8530. #define HTT_RX_IND_SERVICE_GET(word) \
  8531. (((word) & HTT_RX_IND_SERVICE_M) >> \
  8532. HTT_RX_IND_SERVICE_S)
  8533. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  8534. do { \
  8535. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  8536. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  8537. } while (0)
  8538. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  8539. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  8540. HTT_RX_IND_SA_ANT_MATRIX_S)
  8541. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  8542. do { \
  8543. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  8544. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  8545. } while (0)
  8546. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  8547. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  8548. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  8549. do { \
  8550. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  8551. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  8552. } while (0)
  8553. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  8554. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  8555. #define HTT_RX_IND_HL_BYTES \
  8556. (HTT_RX_IND_HDR_BYTES + \
  8557. 4 /* single FW rx MSDU descriptor */ + \
  8558. 4 /* single MPDU range information element */)
  8559. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  8560. /* Could we use one macro entry? */
  8561. #define HTT_WORD_SET(word, field, value) \
  8562. do { \
  8563. HTT_CHECK_SET_VAL(field, value); \
  8564. (word) |= ((value) << field ## _S); \
  8565. } while (0)
  8566. #define HTT_WORD_GET(word, field) \
  8567. (((word) & field ## _M) >> field ## _S)
  8568. PREPACK struct hl_htt_rx_ind_base {
  8569. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  8570. } POSTPACK;
  8571. /*
  8572. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  8573. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  8574. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  8575. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  8576. * htt_rx_ind_hl_rx_desc_t.
  8577. */
  8578. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  8579. struct htt_rx_ind_hl_rx_desc_t {
  8580. A_UINT8 ver;
  8581. A_UINT8 len;
  8582. struct {
  8583. A_UINT8
  8584. first_msdu: 1,
  8585. last_msdu: 1,
  8586. c3_failed: 1,
  8587. c4_failed: 1,
  8588. ipv6: 1,
  8589. tcp: 1,
  8590. udp: 1,
  8591. reserved: 1;
  8592. } flags;
  8593. /* NOTE: no reserved space - don't append any new fields here */
  8594. };
  8595. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  8596. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8597. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  8598. #define HTT_RX_IND_HL_RX_DESC_VER 0
  8599. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  8600. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8601. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  8602. #define HTT_RX_IND_HL_FLAG_OFFSET \
  8603. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8604. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  8605. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  8606. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  8607. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  8608. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  8609. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  8610. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  8611. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  8612. /* This structure is used in HL, the basic descriptor information
  8613. * used by host. the structure is translated by FW from HW desc
  8614. * or generated by FW. But in HL monitor mode, the host would use
  8615. * the same structure with LL.
  8616. */
  8617. PREPACK struct hl_htt_rx_desc_base {
  8618. A_UINT32
  8619. seq_num:12,
  8620. encrypted:1,
  8621. chan_info_present:1,
  8622. resv0:2,
  8623. mcast_bcast:1,
  8624. fragment:1,
  8625. key_id_oct:8,
  8626. resv1:6;
  8627. A_UINT32
  8628. pn_31_0;
  8629. union {
  8630. struct {
  8631. A_UINT16 pn_47_32;
  8632. A_UINT16 pn_63_48;
  8633. } pn16;
  8634. A_UINT32 pn_63_32;
  8635. } u0;
  8636. A_UINT32
  8637. pn_95_64;
  8638. A_UINT32
  8639. pn_127_96;
  8640. } POSTPACK;
  8641. /*
  8642. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  8643. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  8644. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  8645. * Please see htt_chan_change_t for description of the fields.
  8646. */
  8647. PREPACK struct htt_chan_info_t
  8648. {
  8649. A_UINT32 primary_chan_center_freq_mhz: 16,
  8650. contig_chan1_center_freq_mhz: 16;
  8651. A_UINT32 contig_chan2_center_freq_mhz: 16,
  8652. phy_mode: 8,
  8653. reserved: 8;
  8654. } POSTPACK;
  8655. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  8656. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  8657. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  8658. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  8659. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  8660. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  8661. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  8662. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  8663. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  8664. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  8665. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  8666. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  8667. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  8668. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  8669. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  8670. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  8671. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  8672. /* Channel information */
  8673. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  8674. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  8675. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  8676. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  8677. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  8678. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  8679. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  8680. #define HTT_CHAN_INFO_PHY_MODE_S 16
  8681. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  8682. do { \
  8683. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  8684. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  8685. } while (0)
  8686. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  8687. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  8688. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  8689. do { \
  8690. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  8691. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  8692. } while (0)
  8693. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  8694. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  8695. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  8696. do { \
  8697. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  8698. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  8699. } while (0)
  8700. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  8701. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  8702. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  8703. do { \
  8704. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  8705. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  8706. } while (0)
  8707. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  8708. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  8709. /*
  8710. * @brief target -> host message definition for FW offloaded pkts
  8711. *
  8712. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  8713. *
  8714. * @details
  8715. * The following field definitions describe the format of the firmware
  8716. * offload deliver message sent from the target to the host.
  8717. *
  8718. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  8719. *
  8720. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  8721. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  8722. * | reserved_1 | msg type |
  8723. * |--------------------------------------------------------------------------|
  8724. * | phy_timestamp_l32 |
  8725. * |--------------------------------------------------------------------------|
  8726. * | WORD2 (see below) |
  8727. * |--------------------------------------------------------------------------|
  8728. * | seqno | framectrl |
  8729. * |--------------------------------------------------------------------------|
  8730. * | reserved_3 | vdev_id | tid_num|
  8731. * |--------------------------------------------------------------------------|
  8732. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  8733. * |--------------------------------------------------------------------------|
  8734. *
  8735. * where:
  8736. * STAT = status
  8737. * F = format (802.3 vs. 802.11)
  8738. *
  8739. * definition for word 2
  8740. *
  8741. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  8742. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  8743. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  8744. * |--------------------------------------------------------------------------|
  8745. *
  8746. * where:
  8747. * PR = preamble
  8748. * BF = beamformed
  8749. */
  8750. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  8751. {
  8752. A_UINT32 /* word 0 */
  8753. msg_type:8, /* [ 7: 0] */
  8754. reserved_1:24; /* [31: 8] */
  8755. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  8756. A_UINT32 /* word 2 */
  8757. /* preamble:
  8758. * 0-OFDM,
  8759. * 1-CCk,
  8760. * 2-HT,
  8761. * 3-VHT
  8762. */
  8763. preamble: 2, /* [1:0] */
  8764. /* mcs:
  8765. * In case of HT preamble interpret
  8766. * MCS along with NSS.
  8767. * Valid values for HT are 0 to 7.
  8768. * HT mcs 0 with NSS 2 is mcs 8.
  8769. * Valid values for VHT are 0 to 9.
  8770. */
  8771. mcs: 4, /* [5:2] */
  8772. /* rate:
  8773. * This is applicable only for
  8774. * CCK and OFDM preamble type
  8775. * rate 0: OFDM 48 Mbps,
  8776. * 1: OFDM 24 Mbps,
  8777. * 2: OFDM 12 Mbps
  8778. * 3: OFDM 6 Mbps
  8779. * 4: OFDM 54 Mbps
  8780. * 5: OFDM 36 Mbps
  8781. * 6: OFDM 18 Mbps
  8782. * 7: OFDM 9 Mbps
  8783. * rate 0: CCK 11 Mbps Long
  8784. * 1: CCK 5.5 Mbps Long
  8785. * 2: CCK 2 Mbps Long
  8786. * 3: CCK 1 Mbps Long
  8787. * 4: CCK 11 Mbps Short
  8788. * 5: CCK 5.5 Mbps Short
  8789. * 6: CCK 2 Mbps Short
  8790. */
  8791. rate : 3, /* [ 8: 6] */
  8792. rssi : 8, /* [16: 9] units=dBm */
  8793. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8794. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8795. stbc : 1, /* [22] */
  8796. sgi : 1, /* [23] */
  8797. ldpc : 1, /* [24] */
  8798. beamformed: 1, /* [25] */
  8799. reserved_2: 6; /* [31:26] */
  8800. A_UINT32 /* word 3 */
  8801. framectrl:16, /* [15: 0] */
  8802. seqno:16; /* [31:16] */
  8803. A_UINT32 /* word 4 */
  8804. tid_num:5, /* [ 4: 0] actual TID number */
  8805. vdev_id:8, /* [12: 5] */
  8806. reserved_3:19; /* [31:13] */
  8807. A_UINT32 /* word 5 */
  8808. /* status:
  8809. * 0: tx_ok
  8810. * 1: retry
  8811. * 2: drop
  8812. * 3: filtered
  8813. * 4: abort
  8814. * 5: tid delete
  8815. * 6: sw abort
  8816. * 7: dropped by peer migration
  8817. */
  8818. status:3, /* [2:0] */
  8819. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  8820. tx_mpdu_bytes:16, /* [19:4] */
  8821. /* Indicates retry count of offloaded/local generated Data tx frames */
  8822. tx_retry_cnt:6, /* [25:20] */
  8823. reserved_4:6; /* [31:26] */
  8824. } POSTPACK;
  8825. /* FW offload deliver ind message header fields */
  8826. /* DWORD one */
  8827. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  8828. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  8829. /* DWORD two */
  8830. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  8831. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  8832. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  8833. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  8834. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  8835. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  8836. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  8837. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  8838. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  8839. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  8840. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  8841. #define HTT_FW_OFFLOAD_IND_BW_S 19
  8842. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  8843. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  8844. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  8845. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  8846. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  8847. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  8848. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  8849. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  8850. /* DWORD three*/
  8851. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  8852. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  8853. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  8854. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  8855. /* DWORD four */
  8856. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  8857. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  8858. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  8859. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  8860. /* DWORD five */
  8861. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  8862. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  8863. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  8864. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  8865. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  8866. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  8867. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  8868. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  8869. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  8870. do { \
  8871. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  8872. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  8873. } while (0)
  8874. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  8875. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  8876. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  8877. do { \
  8878. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  8879. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  8880. } while (0)
  8881. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  8882. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  8883. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  8884. do { \
  8885. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  8886. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  8887. } while (0)
  8888. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  8889. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  8890. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  8891. do { \
  8892. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  8893. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  8894. } while (0)
  8895. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  8896. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  8897. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  8898. do { \
  8899. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  8900. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  8901. } while (0)
  8902. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  8903. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  8904. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  8905. do { \
  8906. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  8907. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  8908. } while (0)
  8909. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  8910. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  8911. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  8912. do { \
  8913. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  8914. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  8915. } while (0)
  8916. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  8917. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  8918. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  8919. do { \
  8920. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  8921. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  8922. } while (0)
  8923. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  8924. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  8925. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  8926. do { \
  8927. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  8928. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  8929. } while (0)
  8930. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  8931. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  8932. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  8933. do { \
  8934. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  8935. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  8936. } while (0)
  8937. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  8938. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  8939. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  8940. do { \
  8941. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  8942. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  8943. } while (0)
  8944. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  8945. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  8946. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  8947. do { \
  8948. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  8949. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  8950. } while (0)
  8951. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  8952. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  8953. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  8954. do { \
  8955. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  8956. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  8957. } while (0)
  8958. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  8959. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  8960. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  8961. do { \
  8962. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  8963. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  8964. } while (0)
  8965. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  8966. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  8967. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  8968. do { \
  8969. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  8970. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  8971. } while (0)
  8972. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  8973. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  8974. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  8975. do { \
  8976. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  8977. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  8978. } while (0)
  8979. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  8980. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  8981. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  8982. do { \
  8983. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  8984. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  8985. } while (0)
  8986. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  8987. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  8988. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  8989. do { \
  8990. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  8991. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  8992. } while (0)
  8993. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  8994. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  8995. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  8996. do { \
  8997. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  8998. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  8999. } while (0)
  9000. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9001. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9002. /*
  9003. * @brief target -> host rx reorder flush message definition
  9004. *
  9005. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9006. *
  9007. * @details
  9008. * The following field definitions describe the format of the rx flush
  9009. * message sent from the target to the host.
  9010. * The message consists of a 4-octet header, followed by one or more
  9011. * 4-octet payload information elements.
  9012. *
  9013. * |31 24|23 8|7 0|
  9014. * |--------------------------------------------------------------|
  9015. * | TID | peer ID | msg type |
  9016. * |--------------------------------------------------------------|
  9017. * | seq num end | seq num start | MPDU status | reserved |
  9018. * |--------------------------------------------------------------|
  9019. * First DWORD:
  9020. * - MSG_TYPE
  9021. * Bits 7:0
  9022. * Purpose: identifies this as an rx flush message
  9023. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9024. * - PEER_ID
  9025. * Bits 23:8 (only bits 18:8 actually used)
  9026. * Purpose: identify which peer's rx data is being flushed
  9027. * Value: (rx) peer ID
  9028. * - TID
  9029. * Bits 31:24 (only bits 27:24 actually used)
  9030. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9031. * Value: traffic identifier
  9032. * Second DWORD:
  9033. * - MPDU_STATUS
  9034. * Bits 15:8
  9035. * Purpose:
  9036. * Indicate whether the flushed MPDUs should be discarded or processed.
  9037. * Value:
  9038. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9039. * stages of rx processing
  9040. * other: discard the MPDUs
  9041. * It is anticipated that flush messages will always have
  9042. * MPDU status == 1, but the status flag is included for
  9043. * flexibility.
  9044. * - SEQ_NUM_START
  9045. * Bits 23:16
  9046. * Purpose:
  9047. * Indicate the start of a series of consecutive MPDUs being flushed.
  9048. * Not all MPDUs within this range are necessarily valid - the host
  9049. * must check each sequence number within this range to see if the
  9050. * corresponding MPDU is actually present.
  9051. * Value:
  9052. * The sequence number for the first MPDU in the sequence.
  9053. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9054. * - SEQ_NUM_END
  9055. * Bits 30:24
  9056. * Purpose:
  9057. * Indicate the end of a series of consecutive MPDUs being flushed.
  9058. * Value:
  9059. * The sequence number one larger than the sequence number of the
  9060. * last MPDU being flushed.
  9061. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9062. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9063. * are to be released for further rx processing.
  9064. * Not all MPDUs within this range are necessarily valid - the host
  9065. * must check each sequence number within this range to see if the
  9066. * corresponding MPDU is actually present.
  9067. */
  9068. /* first DWORD */
  9069. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9070. #define HTT_RX_FLUSH_PEER_ID_S 8
  9071. #define HTT_RX_FLUSH_TID_M 0xff000000
  9072. #define HTT_RX_FLUSH_TID_S 24
  9073. /* second DWORD */
  9074. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9075. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9076. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9077. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9078. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9079. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9080. #define HTT_RX_FLUSH_BYTES 8
  9081. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9082. do { \
  9083. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9084. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9085. } while (0)
  9086. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9087. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9088. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9089. do { \
  9090. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9091. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9092. } while (0)
  9093. #define HTT_RX_FLUSH_TID_GET(word) \
  9094. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9095. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9096. do { \
  9097. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9098. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9099. } while (0)
  9100. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9101. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9102. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9103. do { \
  9104. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9105. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9106. } while (0)
  9107. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9108. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9109. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9110. do { \
  9111. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9112. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9113. } while (0)
  9114. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9115. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9116. /*
  9117. * @brief target -> host rx pn check indication message
  9118. *
  9119. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9120. *
  9121. * @details
  9122. * The following field definitions describe the format of the Rx PN check
  9123. * indication message sent from the target to the host.
  9124. * The message consists of a 4-octet header, followed by the start and
  9125. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9126. * IE is one octet containing the sequence number that failed the PN
  9127. * check.
  9128. *
  9129. * |31 24|23 8|7 0|
  9130. * |--------------------------------------------------------------|
  9131. * | TID | peer ID | msg type |
  9132. * |--------------------------------------------------------------|
  9133. * | Reserved | PN IE count | seq num end | seq num start|
  9134. * |--------------------------------------------------------------|
  9135. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9136. * |--------------------------------------------------------------|
  9137. * First DWORD:
  9138. * - MSG_TYPE
  9139. * Bits 7:0
  9140. * Purpose: Identifies this as an rx pn check indication message
  9141. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  9142. * - PEER_ID
  9143. * Bits 23:8 (only bits 18:8 actually used)
  9144. * Purpose: identify which peer
  9145. * Value: (rx) peer ID
  9146. * - TID
  9147. * Bits 31:24 (only bits 27:24 actually used)
  9148. * Purpose: identify traffic identifier
  9149. * Value: traffic identifier
  9150. * Second DWORD:
  9151. * - SEQ_NUM_START
  9152. * Bits 7:0
  9153. * Purpose:
  9154. * Indicates the starting sequence number of the MPDU in this
  9155. * series of MPDUs that went though PN check.
  9156. * Value:
  9157. * The sequence number for the first MPDU in the sequence.
  9158. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9159. * - SEQ_NUM_END
  9160. * Bits 15:8
  9161. * Purpose:
  9162. * Indicates the ending sequence number of the MPDU in this
  9163. * series of MPDUs that went though PN check.
  9164. * Value:
  9165. * The sequence number one larger then the sequence number of the last
  9166. * MPDU being flushed.
  9167. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9168. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  9169. * for invalid PN numbers and are ready to be released for further processing.
  9170. * Not all MPDUs within this range are necessarily valid - the host
  9171. * must check each sequence number within this range to see if the
  9172. * corresponding MPDU is actually present.
  9173. * - PN_IE_COUNT
  9174. * Bits 23:16
  9175. * Purpose:
  9176. * Used to determine the variable number of PN information elements in this
  9177. * message
  9178. *
  9179. * PN information elements:
  9180. * - PN_IE_x-
  9181. * Purpose:
  9182. * Each PN information element contains the sequence number of the MPDU that
  9183. * has failed the target PN check.
  9184. * Value:
  9185. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  9186. * that failed the PN check.
  9187. */
  9188. /* first DWORD */
  9189. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  9190. #define HTT_RX_PN_IND_PEER_ID_S 8
  9191. #define HTT_RX_PN_IND_TID_M 0xff000000
  9192. #define HTT_RX_PN_IND_TID_S 24
  9193. /* second DWORD */
  9194. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  9195. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  9196. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  9197. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  9198. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  9199. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  9200. #define HTT_RX_PN_IND_BYTES 8
  9201. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  9202. do { \
  9203. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  9204. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  9205. } while (0)
  9206. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  9207. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  9208. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  9209. do { \
  9210. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  9211. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  9212. } while (0)
  9213. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  9214. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  9215. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  9216. do { \
  9217. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  9218. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  9219. } while (0)
  9220. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  9221. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  9222. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  9223. do { \
  9224. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  9225. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  9226. } while (0)
  9227. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  9228. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  9229. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  9230. do { \
  9231. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  9232. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  9233. } while (0)
  9234. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  9235. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  9236. /*
  9237. * @brief target -> host rx offload deliver message for LL system
  9238. *
  9239. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  9240. *
  9241. * @details
  9242. * In a low latency system this message is sent whenever the offload
  9243. * manager flushes out the packets it has coalesced in its coalescing buffer.
  9244. * The DMA of the actual packets into host memory is done before sending out
  9245. * this message. This message indicates only how many MSDUs to reap. The
  9246. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  9247. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  9248. * DMA'd by the MAC directly into host memory these packets do not contain
  9249. * the MAC descriptors in the header portion of the packet. Instead they contain
  9250. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  9251. * message, the packets are delivered directly to the NW stack without going
  9252. * through the regular reorder buffering and PN checking path since it has
  9253. * already been done in target.
  9254. *
  9255. * |31 24|23 16|15 8|7 0|
  9256. * |-----------------------------------------------------------------------|
  9257. * | Total MSDU count | reserved | msg type |
  9258. * |-----------------------------------------------------------------------|
  9259. *
  9260. * @brief target -> host rx offload deliver message for HL system
  9261. *
  9262. * @details
  9263. * In a high latency system this message is sent whenever the offload manager
  9264. * flushes out the packets it has coalesced in its coalescing buffer. The
  9265. * actual packets are also carried along with this message. When the host
  9266. * receives this message, it is expected to deliver these packets to the NW
  9267. * stack directly instead of routing them through the reorder buffering and
  9268. * PN checking path since it has already been done in target.
  9269. *
  9270. * |31 24|23 16|15 8|7 0|
  9271. * |-----------------------------------------------------------------------|
  9272. * | Total MSDU count | reserved | msg type |
  9273. * |-----------------------------------------------------------------------|
  9274. * | peer ID | MSDU length |
  9275. * |-----------------------------------------------------------------------|
  9276. * | MSDU payload | FW Desc | tid | vdev ID |
  9277. * |-----------------------------------------------------------------------|
  9278. * | MSDU payload contd. |
  9279. * |-----------------------------------------------------------------------|
  9280. * | peer ID | MSDU length |
  9281. * |-----------------------------------------------------------------------|
  9282. * | MSDU payload | FW Desc | tid | vdev ID |
  9283. * |-----------------------------------------------------------------------|
  9284. * | MSDU payload contd. |
  9285. * |-----------------------------------------------------------------------|
  9286. *
  9287. */
  9288. /* first DWORD */
  9289. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  9290. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  9291. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  9292. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  9293. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  9294. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  9295. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  9296. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  9297. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  9298. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  9299. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  9300. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  9301. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  9302. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  9303. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  9304. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  9305. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  9306. do { \
  9307. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  9308. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  9309. } while (0)
  9310. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  9311. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  9312. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  9313. do { \
  9314. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  9315. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  9316. } while (0)
  9317. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  9318. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  9319. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  9320. do { \
  9321. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  9322. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  9323. } while (0)
  9324. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  9325. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  9326. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  9327. do { \
  9328. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  9329. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  9330. } while (0)
  9331. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  9332. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  9333. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  9334. do { \
  9335. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  9336. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  9337. } while (0)
  9338. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  9339. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  9340. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  9341. do { \
  9342. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  9343. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  9344. } while (0)
  9345. /**
  9346. * @brief target -> host rx peer map/unmap message definition
  9347. *
  9348. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  9349. *
  9350. * @details
  9351. * The following diagram shows the format of the rx peer map message sent
  9352. * from the target to the host. This layout assumes the target operates
  9353. * as little-endian.
  9354. *
  9355. * This message always contains a SW peer ID. The main purpose of the
  9356. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9357. * with, so that the host can use that peer ID to determine which peer
  9358. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9359. * other purposes, such as identifying during tx completions which peer
  9360. * the tx frames in question were transmitted to.
  9361. *
  9362. * In certain generations of chips, the peer map message also contains
  9363. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  9364. * to identify which peer the frame needs to be forwarded to (i.e. the
  9365. * peer assocated with the Destination MAC Address within the packet),
  9366. * and particularly which vdev needs to transmit the frame (for cases
  9367. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  9368. * meaning as AST_INDEX_0.
  9369. * This DA-based peer ID that is provided for certain rx frames
  9370. * (the rx frames that need to be re-transmitted as tx frames)
  9371. * is the ID that the HW uses for referring to the peer in question,
  9372. * rather than the peer ID that the SW+FW use to refer to the peer.
  9373. *
  9374. *
  9375. * |31 24|23 16|15 8|7 0|
  9376. * |-----------------------------------------------------------------------|
  9377. * | SW peer ID | VDEV ID | msg type |
  9378. * |-----------------------------------------------------------------------|
  9379. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9380. * |-----------------------------------------------------------------------|
  9381. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9382. * |-----------------------------------------------------------------------|
  9383. *
  9384. *
  9385. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  9386. *
  9387. * The following diagram shows the format of the rx peer unmap message sent
  9388. * from the target to the host.
  9389. *
  9390. * |31 24|23 16|15 8|7 0|
  9391. * |-----------------------------------------------------------------------|
  9392. * | SW peer ID | VDEV ID | msg type |
  9393. * |-----------------------------------------------------------------------|
  9394. *
  9395. * The following field definitions describe the format of the rx peer map
  9396. * and peer unmap messages sent from the target to the host.
  9397. * - MSG_TYPE
  9398. * Bits 7:0
  9399. * Purpose: identifies this as an rx peer map or peer unmap message
  9400. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  9401. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  9402. * - VDEV_ID
  9403. * Bits 15:8
  9404. * Purpose: Indicates which virtual device the peer is associated
  9405. * with.
  9406. * Value: vdev ID (used in the host to look up the vdev object)
  9407. * - PEER_ID (a.k.a. SW_PEER_ID)
  9408. * Bits 31:16
  9409. * Purpose: The peer ID (index) that WAL is allocating (map) or
  9410. * freeing (unmap)
  9411. * Value: (rx) peer ID
  9412. * - MAC_ADDR_L32 (peer map only)
  9413. * Bits 31:0
  9414. * Purpose: Identifies which peer node the peer ID is for.
  9415. * Value: lower 4 bytes of peer node's MAC address
  9416. * - MAC_ADDR_U16 (peer map only)
  9417. * Bits 15:0
  9418. * Purpose: Identifies which peer node the peer ID is for.
  9419. * Value: upper 2 bytes of peer node's MAC address
  9420. * - HW_PEER_ID
  9421. * Bits 31:16
  9422. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9423. * address, so for rx frames marked for rx --> tx forwarding, the
  9424. * host can determine from the HW peer ID provided as meta-data with
  9425. * the rx frame which peer the frame is supposed to be forwarded to.
  9426. * Value: ID used by the MAC HW to identify the peer
  9427. */
  9428. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  9429. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  9430. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  9431. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  9432. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  9433. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  9434. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9435. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  9436. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  9437. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  9438. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  9439. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  9440. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  9441. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  9442. do { \
  9443. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  9444. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  9445. } while (0)
  9446. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  9447. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  9448. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  9449. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  9450. do { \
  9451. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  9452. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  9453. } while (0)
  9454. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  9455. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  9456. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  9457. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  9458. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  9459. do { \
  9460. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  9461. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  9462. } while (0)
  9463. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  9464. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  9465. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9466. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  9467. #define HTT_RX_PEER_MAP_BYTES 12
  9468. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  9469. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  9470. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  9471. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  9472. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  9473. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  9474. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  9475. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  9476. #define HTT_RX_PEER_UNMAP_BYTES 4
  9477. /**
  9478. * @brief target -> host rx peer map V2 message definition
  9479. *
  9480. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  9481. *
  9482. * @details
  9483. * The following diagram shows the format of the rx peer map v2 message sent
  9484. * from the target to the host. This layout assumes the target operates
  9485. * as little-endian.
  9486. *
  9487. * This message always contains a SW peer ID. The main purpose of the
  9488. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9489. * with, so that the host can use that peer ID to determine which peer
  9490. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9491. * other purposes, such as identifying during tx completions which peer
  9492. * the tx frames in question were transmitted to.
  9493. *
  9494. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  9495. * is used during rx --> tx frame forwarding to identify which peer the
  9496. * frame needs to be forwarded to (i.e. the peer assocated with the
  9497. * Destination MAC Address within the packet), and particularly which vdev
  9498. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  9499. * This DA-based peer ID that is provided for certain rx frames
  9500. * (the rx frames that need to be re-transmitted as tx frames)
  9501. * is the ID that the HW uses for referring to the peer in question,
  9502. * rather than the peer ID that the SW+FW use to refer to the peer.
  9503. *
  9504. * The HW peer id here is the same meaning as AST_INDEX_0.
  9505. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  9506. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  9507. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  9508. * AST is valid.
  9509. *
  9510. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  9511. * |-------------------------------------------------------------------------|
  9512. * | SW peer ID | VDEV ID | msg type |
  9513. * |-------------------------------------------------------------------------|
  9514. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9515. * |-------------------------------------------------------------------------|
  9516. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9517. * |-------------------------------------------------------------------------|
  9518. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  9519. * |-------------------------------------------------------------------------|
  9520. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  9521. * |-------------------------------------------------------------------------|
  9522. * |TID valid low pri| TID valid hi pri | AST index 2 |
  9523. * |-------------------------------------------------------------------------|
  9524. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  9525. * |-------------------------------------------------------------------------|
  9526. * | Reserved_2 |
  9527. * |-------------------------------------------------------------------------|
  9528. * Where:
  9529. * NH = Next Hop
  9530. * ASTVM = AST valid mask
  9531. * OA = on-chip AST valid bit
  9532. * ASTFM = AST flow mask
  9533. *
  9534. * The following field definitions describe the format of the rx peer map v2
  9535. * messages sent from the target to the host.
  9536. * - MSG_TYPE
  9537. * Bits 7:0
  9538. * Purpose: identifies this as an rx peer map v2 message
  9539. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  9540. * - VDEV_ID
  9541. * Bits 15:8
  9542. * Purpose: Indicates which virtual device the peer is associated with.
  9543. * Value: vdev ID (used in the host to look up the vdev object)
  9544. * - SW_PEER_ID
  9545. * Bits 31:16
  9546. * Purpose: The peer ID (index) that WAL is allocating
  9547. * Value: (rx) peer ID
  9548. * - MAC_ADDR_L32
  9549. * Bits 31:0
  9550. * Purpose: Identifies which peer node the peer ID is for.
  9551. * Value: lower 4 bytes of peer node's MAC address
  9552. * - MAC_ADDR_U16
  9553. * Bits 15:0
  9554. * Purpose: Identifies which peer node the peer ID is for.
  9555. * Value: upper 2 bytes of peer node's MAC address
  9556. * - HW_PEER_ID / AST_INDEX_0
  9557. * Bits 31:16
  9558. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9559. * address, so for rx frames marked for rx --> tx forwarding, the
  9560. * host can determine from the HW peer ID provided as meta-data with
  9561. * the rx frame which peer the frame is supposed to be forwarded to.
  9562. * Value: ID used by the MAC HW to identify the peer
  9563. * - AST_HASH_VALUE
  9564. * Bits 15:0
  9565. * Purpose: Indicates AST Hash value is required for the TCL AST index
  9566. * override feature.
  9567. * - NEXT_HOP
  9568. * Bit 16
  9569. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  9570. * (Wireless Distribution System).
  9571. * - AST_VALID_MASK
  9572. * Bits 19:17
  9573. * Purpose: Indicate if the AST 1 through AST 3 are valid
  9574. * - ONCHIP_AST_VALID_FLAG
  9575. * Bit 20
  9576. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  9577. * is valid.
  9578. * - AST_INDEX_1
  9579. * Bits 15:0
  9580. * Purpose: indicate the second AST index for this peer
  9581. * - AST_0_FLOW_MASK
  9582. * Bits 19:16
  9583. * Purpose: identify the which flow the AST 0 entry corresponds to.
  9584. * - AST_1_FLOW_MASK
  9585. * Bits 23:20
  9586. * Purpose: identify the which flow the AST 1 entry corresponds to.
  9587. * - AST_2_FLOW_MASK
  9588. * Bits 27:24
  9589. * Purpose: identify the which flow the AST 2 entry corresponds to.
  9590. * - AST_3_FLOW_MASK
  9591. * Bits 31:28
  9592. * Purpose: identify the which flow the AST 3 entry corresponds to.
  9593. * - AST_INDEX_2
  9594. * Bits 15:0
  9595. * Purpose: indicate the third AST index for this peer
  9596. * - TID_VALID_HI_PRI
  9597. * Bits 23:16
  9598. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  9599. * - TID_VALID_LOW_PRI
  9600. * Bits 31:24
  9601. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  9602. * - AST_INDEX_3
  9603. * Bits 15:0
  9604. * Purpose: indicate the fourth AST index for this peer
  9605. * - ONCHIP_AST_IDX / RESERVED
  9606. * Bits 31:16
  9607. * Purpose: This field is valid only when split AST feature is enabled.
  9608. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  9609. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9610. * address, this ast_idx is used for LMAC modules for RXPCU.
  9611. * Value: ID used by the LMAC HW to identify the peer
  9612. */
  9613. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  9614. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  9615. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  9616. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  9617. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  9618. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  9619. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  9620. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  9621. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  9622. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  9623. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  9624. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  9625. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  9626. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  9627. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  9628. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  9629. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  9630. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  9631. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  9632. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  9633. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  9634. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  9635. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  9636. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  9637. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  9638. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  9639. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  9640. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  9641. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  9642. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  9643. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  9644. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  9645. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  9646. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  9647. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  9648. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  9649. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  9650. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  9651. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  9652. do { \
  9653. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  9654. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  9655. } while (0)
  9656. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  9657. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  9658. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  9659. do { \
  9660. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  9661. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  9662. } while (0)
  9663. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  9664. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  9665. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  9666. do { \
  9667. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  9668. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  9669. } while (0)
  9670. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  9671. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  9672. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  9673. do { \
  9674. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  9675. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  9676. } while (0)
  9677. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  9678. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  9679. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  9680. do { \
  9681. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  9682. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  9683. } while (0)
  9684. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  9685. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  9686. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  9687. do { \
  9688. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  9689. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  9690. } while (0)
  9691. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  9692. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  9693. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  9694. do { \
  9695. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  9696. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  9697. } while (0)
  9698. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  9699. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  9700. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9701. do { \
  9702. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  9703. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  9704. } while (0)
  9705. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  9706. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  9707. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  9708. do { \
  9709. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  9710. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  9711. } while (0)
  9712. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  9713. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  9714. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  9715. do { \
  9716. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  9717. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  9718. } while (0)
  9719. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  9720. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  9721. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  9722. do { \
  9723. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  9724. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  9725. } while (0)
  9726. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  9727. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  9728. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  9729. do { \
  9730. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  9731. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  9732. } while (0)
  9733. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  9734. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  9735. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  9736. do { \
  9737. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  9738. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  9739. } while (0)
  9740. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  9741. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  9742. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  9743. do { \
  9744. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  9745. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  9746. } while (0)
  9747. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  9748. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  9749. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  9750. do { \
  9751. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  9752. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  9753. } while (0)
  9754. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  9755. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  9756. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  9757. do { \
  9758. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  9759. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  9760. } while (0)
  9761. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  9762. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  9763. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  9764. do { \
  9765. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  9766. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  9767. } while (0)
  9768. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  9769. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  9770. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  9771. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  9772. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  9773. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  9774. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  9775. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  9776. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  9777. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  9778. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  9779. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  9780. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  9781. #define HTT_RX_PEER_MAP_V2_BYTES 32
  9782. /**
  9783. * @brief target -> host rx peer map V3 message definition
  9784. *
  9785. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  9786. *
  9787. * @details
  9788. * The following diagram shows the format of the rx peer map v3 message sent
  9789. * from the target to the host.
  9790. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  9791. * This layout assumes the target operates as little-endian.
  9792. *
  9793. * |31 24|23 20|19|18|17|16|15 8|7 0|
  9794. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  9795. * | SW peer ID | VDEV ID | msg type |
  9796. * |-----------------+--------------------+-----------------+-----------------|
  9797. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9798. * |-----------------+--------------------+-----------------+-----------------|
  9799. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  9800. * |-----------------+--------+-----------+-----------------+-----------------|
  9801. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  9802. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  9803. * | (8bits) | | (4bits) | |
  9804. * |-----------------+--------+--+--+--+--------------------------------------|
  9805. * | RESERVED |E |O | | |
  9806. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  9807. * | |V |V | | |
  9808. * |-----------------+--------------------+-----------------------------------|
  9809. * | HTT_MSDU_IDX_ | RESERVED | |
  9810. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  9811. * | (8bits) | | |
  9812. * |-----------------+--------------------+-----------------------------------|
  9813. * | Reserved_2 |
  9814. * |--------------------------------------------------------------------------|
  9815. * | Reserved_3 |
  9816. * |--------------------------------------------------------------------------|
  9817. *
  9818. * Where:
  9819. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  9820. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  9821. * NH = Next Hop
  9822. * The following field definitions describe the format of the rx peer map v3
  9823. * messages sent from the target to the host.
  9824. * - MSG_TYPE
  9825. * Bits 7:0
  9826. * Purpose: identifies this as a peer map v3 message
  9827. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  9828. * - VDEV_ID
  9829. * Bits 15:8
  9830. * Purpose: Indicates which virtual device the peer is associated with.
  9831. * - SW_PEER_ID
  9832. * Bits 31:16
  9833. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  9834. * - MAC_ADDR_L32
  9835. * Bits 31:0
  9836. * Purpose: Identifies which peer node the peer ID is for.
  9837. * Value: lower 4 bytes of peer node's MAC address
  9838. * - MAC_ADDR_U16
  9839. * Bits 15:0
  9840. * Purpose: Identifies which peer node the peer ID is for.
  9841. * Value: upper 2 bytes of peer node's MAC address
  9842. * - MULTICAST_SW_PEER_ID
  9843. * Bits 31:16
  9844. * Purpose: The multicast peer ID (index)
  9845. * Value: set to HTT_INVALID_PEER if not valid
  9846. * - HW_PEER_ID / AST_INDEX
  9847. * Bits 15:0
  9848. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9849. * address, so for rx frames marked for rx --> tx forwarding, the
  9850. * host can determine from the HW peer ID provided as meta-data with
  9851. * the rx frame which peer the frame is supposed to be forwarded to.
  9852. * - CACHE_SET_NUM
  9853. * Bits 19:16
  9854. * Purpose: Cache Set Number for AST_INDEX
  9855. * Cache set number that should be used to cache the index based
  9856. * search results, for address and flow search.
  9857. * This value should be equal to LSB 4 bits of the hash value
  9858. * of match data, in case of search index points to an entry which
  9859. * may be used in content based search also. The value can be
  9860. * anything when the entry pointed by search index will not be
  9861. * used for content based search.
  9862. * - HTT_MSDU_IDX_VALID_MASK
  9863. * Bits 31:24
  9864. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  9865. * - ONCHIP_AST_IDX / RESERVED
  9866. * Bits 15:0
  9867. * Purpose: This field is valid only when split AST feature is enabled.
  9868. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  9869. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9870. * address, this ast_idx is used for LMAC modules for RXPCU.
  9871. * - NEXT_HOP
  9872. * Bits 16
  9873. * Purpose: Flag indicates next_hop AST entry used for WDS
  9874. * (Wireless Distribution System).
  9875. * - ONCHIP_AST_VALID
  9876. * Bits 17
  9877. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  9878. * - EXT_AST_VALID
  9879. * Bits 18
  9880. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  9881. * - EXT_AST_INDEX
  9882. * Bits 15:0
  9883. * Purpose: This field describes Extended AST index
  9884. * Valid if EXT_AST_VALID flag set
  9885. * - HTT_MSDU_IDX_VALID_MASK_EXT
  9886. * Bits 31:24
  9887. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  9888. */
  9889. /* dword 0 */
  9890. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  9891. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  9892. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  9893. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  9894. /* dword 1 */
  9895. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  9896. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  9897. /* dword 2 */
  9898. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  9899. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  9900. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  9901. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  9902. /* dword 3 */
  9903. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  9904. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  9905. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  9906. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  9907. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  9908. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  9909. /* dword 4 */
  9910. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  9911. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  9912. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  9913. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  9914. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  9915. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  9916. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  9917. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  9918. /* dword 5 */
  9919. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  9920. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  9921. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  9922. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  9923. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  9924. do { \
  9925. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  9926. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  9927. } while (0)
  9928. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  9929. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  9930. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  9931. do { \
  9932. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  9933. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  9934. } while (0)
  9935. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  9936. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  9937. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  9938. do { \
  9939. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  9940. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  9941. } while (0)
  9942. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  9943. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  9944. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  9945. do { \
  9946. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  9947. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  9948. } while (0)
  9949. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  9950. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  9951. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  9952. do { \
  9953. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  9954. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  9955. } while (0)
  9956. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  9957. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  9958. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  9959. do { \
  9960. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  9961. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  9962. } while (0)
  9963. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  9964. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  9965. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  9966. do { \
  9967. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  9968. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  9969. } while (0)
  9970. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  9971. (((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)
  9972. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  9973. do { \
  9974. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  9975. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  9976. } while (0)
  9977. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  9978. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  9979. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9980. do { \
  9981. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  9982. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  9983. } while (0)
  9984. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  9985. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  9986. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  9987. do { \
  9988. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  9989. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  9990. } while (0)
  9991. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  9992. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  9993. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  9994. do { \
  9995. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  9996. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  9997. } while (0)
  9998. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  9999. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  10000. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10001. do { \
  10002. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10003. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10004. } while (0)
  10005. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10006. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10007. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10008. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10009. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10010. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10011. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10012. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10013. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10014. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10015. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10016. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10017. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10018. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10019. /**
  10020. * @brief target -> host rx peer unmap V2 message definition
  10021. *
  10022. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10023. *
  10024. * The following diagram shows the format of the rx peer unmap message sent
  10025. * from the target to the host.
  10026. *
  10027. * |31 24|23 16|15 8|7 0|
  10028. * |-----------------------------------------------------------------------|
  10029. * | SW peer ID | VDEV ID | msg type |
  10030. * |-----------------------------------------------------------------------|
  10031. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10032. * |-----------------------------------------------------------------------|
  10033. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10034. * |-----------------------------------------------------------------------|
  10035. * | Peer Delete Duration |
  10036. * |-----------------------------------------------------------------------|
  10037. * | Reserved_0 | WDS Free Count |
  10038. * |-----------------------------------------------------------------------|
  10039. * | Reserved_1 |
  10040. * |-----------------------------------------------------------------------|
  10041. * | Reserved_2 |
  10042. * |-----------------------------------------------------------------------|
  10043. *
  10044. *
  10045. * The following field definitions describe the format of the rx peer unmap
  10046. * messages sent from the target to the host.
  10047. * - MSG_TYPE
  10048. * Bits 7:0
  10049. * Purpose: identifies this as an rx peer unmap v2 message
  10050. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10051. * - VDEV_ID
  10052. * Bits 15:8
  10053. * Purpose: Indicates which virtual device the peer is associated
  10054. * with.
  10055. * Value: vdev ID (used in the host to look up the vdev object)
  10056. * - SW_PEER_ID
  10057. * Bits 31:16
  10058. * Purpose: The peer ID (index) that WAL is freeing
  10059. * Value: (rx) peer ID
  10060. * - MAC_ADDR_L32
  10061. * Bits 31:0
  10062. * Purpose: Identifies which peer node the peer ID is for.
  10063. * Value: lower 4 bytes of peer node's MAC address
  10064. * - MAC_ADDR_U16
  10065. * Bits 15:0
  10066. * Purpose: Identifies which peer node the peer ID is for.
  10067. * Value: upper 2 bytes of peer node's MAC address
  10068. * - NEXT_HOP
  10069. * Bits 16
  10070. * Purpose: Bit indicates next_hop AST entry used for WDS
  10071. * (Wireless Distribution System).
  10072. * - PEER_DELETE_DURATION
  10073. * Bits 31:0
  10074. * Purpose: Time taken to delete peer, in msec,
  10075. * Used for monitoring / debugging PEER delete response delay
  10076. * - PEER_WDS_FREE_COUNT
  10077. * Bits 15:0
  10078. * Purpose: Count of WDS entries deleted associated to peer deleted
  10079. */
  10080. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10081. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10082. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10083. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10084. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10085. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10086. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10087. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10088. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10089. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10090. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10091. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10092. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10093. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10094. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10095. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10096. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10097. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10098. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10099. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10100. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10101. do { \
  10102. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10103. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10104. } while (0)
  10105. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10106. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10107. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10108. do { \
  10109. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10110. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10111. } while (0)
  10112. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10113. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10114. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10115. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10116. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10117. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10118. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10119. /**
  10120. * @brief target -> host rx peer mlo map message definition
  10121. *
  10122. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10123. *
  10124. * @details
  10125. * The following diagram shows the format of the rx mlo peer map message sent
  10126. * from the target to the host. This layout assumes the target operates
  10127. * as little-endian.
  10128. *
  10129. * MCC:
  10130. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10131. *
  10132. * WIN:
  10133. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10134. * It will be sent on the Assoc Link.
  10135. *
  10136. * This message always contains a MLO peer ID. The main purpose of the
  10137. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10138. * with, so that the host can use that MLO peer ID to determine which peer
  10139. * transmitted the rx frame.
  10140. *
  10141. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  10142. * |-------------------------------------------------------------------------|
  10143. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  10144. * |-------------------------------------------------------------------------|
  10145. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10146. * |-------------------------------------------------------------------------|
  10147. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  10148. * |-------------------------------------------------------------------------|
  10149. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  10150. * |-------------------------------------------------------------------------|
  10151. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  10152. * |-------------------------------------------------------------------------|
  10153. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  10154. * |-------------------------------------------------------------------------|
  10155. * |RSVD |
  10156. * |-------------------------------------------------------------------------|
  10157. * |RSVD |
  10158. * |-------------------------------------------------------------------------|
  10159. * | htt_tlv_hdr_t |
  10160. * |-------------------------------------------------------------------------|
  10161. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10162. * |-------------------------------------------------------------------------|
  10163. * | htt_tlv_hdr_t |
  10164. * |-------------------------------------------------------------------------|
  10165. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10166. * |-------------------------------------------------------------------------|
  10167. * | htt_tlv_hdr_t |
  10168. * |-------------------------------------------------------------------------|
  10169. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10170. * |-------------------------------------------------------------------------|
  10171. *
  10172. * Where:
  10173. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  10174. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  10175. * V (valid) - 1 Bit Bit17
  10176. * CHIPID - 3 Bits
  10177. * TIDMASK - 8 Bits
  10178. * CACHE_SET_NUM - 8 Bits
  10179. *
  10180. * The following field definitions describe the format of the rx MLO peer map
  10181. * messages sent from the target to the host.
  10182. * - MSG_TYPE
  10183. * Bits 7:0
  10184. * Purpose: identifies this as an rx mlo peer map message
  10185. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  10186. *
  10187. * - MLO_PEER_ID
  10188. * Bits 23:8
  10189. * Purpose: The MLO peer ID (index).
  10190. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  10191. * Value: MLO peer ID
  10192. *
  10193. * - NUMLINK
  10194. * Bits: 26:24 (3Bits)
  10195. * Purpose: Indicate the max number of logical links supported per client.
  10196. * Value: number of logical links
  10197. *
  10198. * - PRC
  10199. * Bits: 29:27 (3Bits)
  10200. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  10201. * if there is migration of the primary chip.
  10202. * Value: Primary REO CHIPID
  10203. *
  10204. * - MAC_ADDR_L32
  10205. * Bits 31:0
  10206. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  10207. * Value: lower 4 bytes of peer node's MAC address
  10208. *
  10209. * - MAC_ADDR_U16
  10210. * Bits 15:0
  10211. * Purpose: Identifies which peer node the peer ID is for.
  10212. * Value: upper 2 bytes of peer node's MAC address
  10213. *
  10214. * - PRIMARY_TCL_AST_IDX
  10215. * Bits 15:0
  10216. * Purpose: Primary TCL AST index for this peer.
  10217. *
  10218. * - V
  10219. * 1 Bit Position 16
  10220. * Purpose: If the ast idx is valid.
  10221. *
  10222. * - CHIPID
  10223. * Bits 19:17
  10224. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  10225. *
  10226. * - TIDMASK
  10227. * Bits 27:20
  10228. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  10229. *
  10230. * - CACHE_SET_NUM
  10231. * Bits 31:28
  10232. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  10233. * Cache set number that should be used to cache the index based
  10234. * search results, for address and flow search.
  10235. * This value should be equal to LSB four bits of the hash value
  10236. * of match data, in case of search index points to an entry which
  10237. * may be used in content based search also. The value can be
  10238. * anything when the entry pointed by search index will not be
  10239. * used for content based search.
  10240. *
  10241. * - htt_tlv_hdr_t
  10242. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  10243. *
  10244. * Bits 11:0
  10245. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  10246. *
  10247. * Bits 23:12
  10248. * Purpose: Length, Length of the value that follows the header
  10249. *
  10250. * Bits 31:28
  10251. * Purpose: Reserved.
  10252. *
  10253. *
  10254. * - SW_PEER_ID
  10255. * Bits 15:0
  10256. * Purpose: The peer ID (index) that WAL is allocating
  10257. * Value: (rx) peer ID
  10258. *
  10259. * - VDEV_ID
  10260. * Bits 23:16
  10261. * Purpose: Indicates which virtual device the peer is associated with.
  10262. * Value: vdev ID (used in the host to look up the vdev object)
  10263. *
  10264. * - CHIPID
  10265. * Bits 26:24
  10266. * Purpose: Indicates which Chip id the peer is associated with.
  10267. * Value: chip ID (Provided by Host as part of QMI exchange)
  10268. */
  10269. typedef enum {
  10270. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  10271. } MLO_PEER_MAP_TLV_TAG_ID;
  10272. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  10273. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  10274. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  10275. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  10276. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  10277. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  10278. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10279. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  10280. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  10281. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  10282. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  10283. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  10284. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  10285. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  10286. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  10287. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  10288. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  10289. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  10290. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  10291. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  10292. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  10293. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  10294. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  10295. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  10296. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  10297. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  10298. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  10299. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  10300. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  10301. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  10302. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  10303. do { \
  10304. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  10305. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  10306. } while (0)
  10307. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  10308. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  10309. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  10310. do { \
  10311. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  10312. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  10313. } while (0)
  10314. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  10315. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  10316. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  10317. do { \
  10318. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  10319. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  10320. } while (0)
  10321. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  10322. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  10323. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  10324. do { \
  10325. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  10326. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  10327. } while (0)
  10328. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  10329. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  10330. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  10331. do { \
  10332. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  10333. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  10334. } while (0)
  10335. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  10336. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  10337. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  10338. do { \
  10339. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  10340. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  10341. } while (0)
  10342. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  10343. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  10344. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  10345. do { \
  10346. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  10347. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  10348. } while (0)
  10349. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  10350. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  10351. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  10352. do { \
  10353. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  10354. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  10355. } while (0)
  10356. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  10357. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  10358. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  10359. do { \
  10360. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  10361. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  10362. } while (0)
  10363. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  10364. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  10365. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  10366. do { \
  10367. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  10368. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  10369. } while (0)
  10370. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  10371. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  10372. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  10373. do { \
  10374. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  10375. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  10376. } while (0)
  10377. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  10378. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  10379. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  10380. do { \
  10381. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  10382. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  10383. } while (0)
  10384. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  10385. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  10386. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  10387. do { \
  10388. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  10389. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  10390. } while (0)
  10391. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  10392. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  10393. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10394. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  10395. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  10396. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  10397. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  10398. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  10399. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  10400. *
  10401. * The following diagram shows the format of the rx mlo peer unmap message sent
  10402. * from the target to the host.
  10403. *
  10404. * |31 24|23 16|15 8|7 0|
  10405. * |-----------------------------------------------------------------------|
  10406. * | RSVD_24_31 | MLO peer ID | msg type |
  10407. * |-----------------------------------------------------------------------|
  10408. */
  10409. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  10410. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  10411. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  10412. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  10413. /**
  10414. * @brief target -> host message specifying security parameters
  10415. *
  10416. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  10417. *
  10418. * @details
  10419. * The following diagram shows the format of the security specification
  10420. * message sent from the target to the host.
  10421. * This security specification message tells the host whether a PN check is
  10422. * necessary on rx data frames, and if so, how large the PN counter is.
  10423. * This message also tells the host about the security processing to apply
  10424. * to defragmented rx frames - specifically, whether a Message Integrity
  10425. * Check is required, and the Michael key to use.
  10426. *
  10427. * |31 24|23 16|15|14 8|7 0|
  10428. * |-----------------------------------------------------------------------|
  10429. * | peer ID | U| security type | msg type |
  10430. * |-----------------------------------------------------------------------|
  10431. * | Michael Key K0 |
  10432. * |-----------------------------------------------------------------------|
  10433. * | Michael Key K1 |
  10434. * |-----------------------------------------------------------------------|
  10435. * | WAPI RSC Low0 |
  10436. * |-----------------------------------------------------------------------|
  10437. * | WAPI RSC Low1 |
  10438. * |-----------------------------------------------------------------------|
  10439. * | WAPI RSC Hi0 |
  10440. * |-----------------------------------------------------------------------|
  10441. * | WAPI RSC Hi1 |
  10442. * |-----------------------------------------------------------------------|
  10443. *
  10444. * The following field definitions describe the format of the security
  10445. * indication message sent from the target to the host.
  10446. * - MSG_TYPE
  10447. * Bits 7:0
  10448. * Purpose: identifies this as a security specification message
  10449. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  10450. * - SEC_TYPE
  10451. * Bits 14:8
  10452. * Purpose: specifies which type of security applies to the peer
  10453. * Value: htt_sec_type enum value
  10454. * - UNICAST
  10455. * Bit 15
  10456. * Purpose: whether this security is applied to unicast or multicast data
  10457. * Value: 1 -> unicast, 0 -> multicast
  10458. * - PEER_ID
  10459. * Bits 31:16
  10460. * Purpose: The ID number for the peer the security specification is for
  10461. * Value: peer ID
  10462. * - MICHAEL_KEY_K0
  10463. * Bits 31:0
  10464. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  10465. * Value: Michael Key K0 (if security type is TKIP)
  10466. * - MICHAEL_KEY_K1
  10467. * Bits 31:0
  10468. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  10469. * Value: Michael Key K1 (if security type is TKIP)
  10470. * - WAPI_RSC_LOW0
  10471. * Bits 31:0
  10472. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  10473. * Value: WAPI RSC Low0 (if security type is WAPI)
  10474. * - WAPI_RSC_LOW1
  10475. * Bits 31:0
  10476. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  10477. * Value: WAPI RSC Low1 (if security type is WAPI)
  10478. * - WAPI_RSC_HI0
  10479. * Bits 31:0
  10480. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  10481. * Value: WAPI RSC Hi0 (if security type is WAPI)
  10482. * - WAPI_RSC_HI1
  10483. * Bits 31:0
  10484. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  10485. * Value: WAPI RSC Hi1 (if security type is WAPI)
  10486. */
  10487. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  10488. #define HTT_SEC_IND_SEC_TYPE_S 8
  10489. #define HTT_SEC_IND_UNICAST_M 0x00008000
  10490. #define HTT_SEC_IND_UNICAST_S 15
  10491. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  10492. #define HTT_SEC_IND_PEER_ID_S 16
  10493. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  10494. do { \
  10495. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  10496. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  10497. } while (0)
  10498. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  10499. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  10500. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  10501. do { \
  10502. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  10503. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  10504. } while (0)
  10505. #define HTT_SEC_IND_UNICAST_GET(word) \
  10506. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  10507. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  10508. do { \
  10509. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  10510. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  10511. } while (0)
  10512. #define HTT_SEC_IND_PEER_ID_GET(word) \
  10513. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  10514. #define HTT_SEC_IND_BYTES 28
  10515. /**
  10516. * @brief target -> host rx ADDBA / DELBA message definitions
  10517. *
  10518. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  10519. *
  10520. * @details
  10521. * The following diagram shows the format of the rx ADDBA message sent
  10522. * from the target to the host:
  10523. *
  10524. * |31 20|19 16|15 8|7 0|
  10525. * |---------------------------------------------------------------------|
  10526. * | peer ID | TID | window size | msg type |
  10527. * |---------------------------------------------------------------------|
  10528. *
  10529. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  10530. *
  10531. * The following diagram shows the format of the rx DELBA message sent
  10532. * from the target to the host:
  10533. *
  10534. * |31 20|19 16|15 10|9 8|7 0|
  10535. * |---------------------------------------------------------------------|
  10536. * | peer ID | TID | window size | IR| msg type |
  10537. * |---------------------------------------------------------------------|
  10538. *
  10539. * The following field definitions describe the format of the rx ADDBA
  10540. * and DELBA messages sent from the target to the host.
  10541. * - MSG_TYPE
  10542. * Bits 7:0
  10543. * Purpose: identifies this as an rx ADDBA or DELBA message
  10544. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  10545. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  10546. * - IR (initiator / recipient)
  10547. * Bits 9:8 (DELBA only)
  10548. * Purpose: specify whether the DELBA handshake was initiated by the
  10549. * local STA/AP, or by the peer STA/AP
  10550. * Value:
  10551. * 0 - unspecified
  10552. * 1 - initiator (a.k.a. originator)
  10553. * 2 - recipient (a.k.a. responder)
  10554. * 3 - unused / reserved
  10555. * - WIN_SIZE
  10556. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  10557. * Purpose: Specifies the length of the block ack window (max = 64).
  10558. * Value:
  10559. * block ack window length specified by the received ADDBA/DELBA
  10560. * management message.
  10561. * - TID
  10562. * Bits 19:16
  10563. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  10564. * Value:
  10565. * TID specified by the received ADDBA or DELBA management message.
  10566. * - PEER_ID
  10567. * Bits 31:20
  10568. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  10569. * Value:
  10570. * ID (hash value) used by the host for fast, direct lookup of
  10571. * host SW peer info, including rx reorder states.
  10572. */
  10573. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  10574. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  10575. #define HTT_RX_ADDBA_TID_M 0xf0000
  10576. #define HTT_RX_ADDBA_TID_S 16
  10577. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  10578. #define HTT_RX_ADDBA_PEER_ID_S 20
  10579. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  10580. do { \
  10581. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  10582. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  10583. } while (0)
  10584. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  10585. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  10586. #define HTT_RX_ADDBA_TID_SET(word, value) \
  10587. do { \
  10588. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  10589. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  10590. } while (0)
  10591. #define HTT_RX_ADDBA_TID_GET(word) \
  10592. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  10593. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  10594. do { \
  10595. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  10596. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  10597. } while (0)
  10598. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  10599. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  10600. #define HTT_RX_ADDBA_BYTES 4
  10601. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  10602. #define HTT_RX_DELBA_INITIATOR_S 8
  10603. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  10604. #define HTT_RX_DELBA_WIN_SIZE_S 10
  10605. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  10606. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  10607. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  10608. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  10609. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  10610. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  10611. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  10612. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  10613. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  10614. do { \
  10615. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  10616. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  10617. } while (0)
  10618. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  10619. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  10620. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  10621. do { \
  10622. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  10623. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  10624. } while (0)
  10625. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  10626. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  10627. #define HTT_RX_DELBA_BYTES 4
  10628. /**
  10629. * @brief tx queue group information element definition
  10630. *
  10631. * @details
  10632. * The following diagram shows the format of the tx queue group
  10633. * information element, which can be included in target --> host
  10634. * messages to specify the number of tx "credits" (tx descriptors
  10635. * for LL, or tx buffers for HL) available to a particular group
  10636. * of host-side tx queues, and which host-side tx queues belong to
  10637. * the group.
  10638. *
  10639. * |31|30 24|23 16|15|14|13 0|
  10640. * |------------------------------------------------------------------------|
  10641. * | X| reserved | tx queue grp ID | A| S| credit count |
  10642. * |------------------------------------------------------------------------|
  10643. * | vdev ID mask | AC mask |
  10644. * |------------------------------------------------------------------------|
  10645. *
  10646. * The following definitions describe the fields within the tx queue group
  10647. * information element:
  10648. * - credit_count
  10649. * Bits 13:1
  10650. * Purpose: specify how many tx credits are available to the tx queue group
  10651. * Value: An absolute or relative, positive or negative credit value
  10652. * The 'A' bit specifies whether the value is absolute or relative.
  10653. * The 'S' bit specifies whether the value is positive or negative.
  10654. * A negative value can only be relative, not absolute.
  10655. * An absolute value replaces any prior credit value the host has for
  10656. * the tx queue group in question.
  10657. * A relative value is added to the prior credit value the host has for
  10658. * the tx queue group in question.
  10659. * - sign
  10660. * Bit 14
  10661. * Purpose: specify whether the credit count is positive or negative
  10662. * Value: 0 -> positive, 1 -> negative
  10663. * - absolute
  10664. * Bit 15
  10665. * Purpose: specify whether the credit count is absolute or relative
  10666. * Value: 0 -> relative, 1 -> absolute
  10667. * - txq_group_id
  10668. * Bits 23:16
  10669. * Purpose: indicate which tx queue group's credit and/or membership are
  10670. * being specified
  10671. * Value: 0 to max_tx_queue_groups-1
  10672. * - reserved
  10673. * Bits 30:16
  10674. * Value: 0x0
  10675. * - eXtension
  10676. * Bit 31
  10677. * Purpose: specify whether another tx queue group info element follows
  10678. * Value: 0 -> no more tx queue group information elements
  10679. * 1 -> another tx queue group information element immediately follows
  10680. * - ac_mask
  10681. * Bits 15:0
  10682. * Purpose: specify which Access Categories belong to the tx queue group
  10683. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  10684. * the tx queue group.
  10685. * The AC bit-mask values are obtained by left-shifting by the
  10686. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  10687. * - vdev_id_mask
  10688. * Bits 31:16
  10689. * Purpose: specify which vdev's tx queues belong to the tx queue group
  10690. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  10691. * belong to the tx queue group.
  10692. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  10693. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  10694. */
  10695. PREPACK struct htt_txq_group {
  10696. A_UINT32
  10697. credit_count: 14,
  10698. sign: 1,
  10699. absolute: 1,
  10700. tx_queue_group_id: 8,
  10701. reserved0: 7,
  10702. extension: 1;
  10703. A_UINT32
  10704. ac_mask: 16,
  10705. vdev_id_mask: 16;
  10706. } POSTPACK;
  10707. /* first word */
  10708. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  10709. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  10710. #define HTT_TXQ_GROUP_SIGN_S 14
  10711. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  10712. #define HTT_TXQ_GROUP_ABS_S 15
  10713. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  10714. #define HTT_TXQ_GROUP_ID_S 16
  10715. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  10716. #define HTT_TXQ_GROUP_EXT_S 31
  10717. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  10718. /* second word */
  10719. #define HTT_TXQ_GROUP_AC_MASK_S 0
  10720. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  10721. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  10722. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  10723. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  10724. do { \
  10725. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  10726. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  10727. } while (0)
  10728. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  10729. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  10730. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  10731. do { \
  10732. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  10733. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  10734. } while (0)
  10735. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  10736. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  10737. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  10738. do { \
  10739. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  10740. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  10741. } while (0)
  10742. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  10743. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  10744. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  10745. do { \
  10746. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  10747. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  10748. } while (0)
  10749. #define HTT_TXQ_GROUP_ID_GET(_info) \
  10750. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  10751. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  10752. do { \
  10753. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  10754. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  10755. } while (0)
  10756. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  10757. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  10758. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  10759. do { \
  10760. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  10761. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  10762. } while (0)
  10763. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  10764. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  10765. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  10766. do { \
  10767. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  10768. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  10769. } while (0)
  10770. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  10771. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  10772. /**
  10773. * @brief target -> host TX completion indication message definition
  10774. *
  10775. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  10776. *
  10777. * @details
  10778. * The following diagram shows the format of the TX completion indication sent
  10779. * from the target to the host
  10780. *
  10781. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  10782. * |-------------------------------------------------------------------|
  10783. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  10784. * |-------------------------------------------------------------------|
  10785. * payload:| MSDU1 ID | MSDU0 ID |
  10786. * |-------------------------------------------------------------------|
  10787. * : MSDU3 ID | MSDU2 ID :
  10788. * |-------------------------------------------------------------------|
  10789. * | struct htt_tx_compl_ind_append_retries |
  10790. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10791. * | struct htt_tx_compl_ind_append_tx_tstamp |
  10792. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10793. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  10794. * |-------------------------------------------------------------------|
  10795. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  10796. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10797. * | MSDU0 tx_tsf64_low |
  10798. * |-------------------------------------------------------------------|
  10799. * | MSDU0 tx_tsf64_high |
  10800. * |-------------------------------------------------------------------|
  10801. * | MSDU1 tx_tsf64_low |
  10802. * |-------------------------------------------------------------------|
  10803. * | MSDU1 tx_tsf64_high |
  10804. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10805. * | phy_timestamp |
  10806. * |-------------------------------------------------------------------|
  10807. * | rate specs (see below) |
  10808. * |-------------------------------------------------------------------|
  10809. * | seqctrl | framectrl |
  10810. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10811. * Where:
  10812. * A0 = append (a.k.a. append0)
  10813. * A1 = append1
  10814. * TP = MSDU tx power presence
  10815. * A2 = append2
  10816. * A3 = append3
  10817. * A4 = append4
  10818. *
  10819. * The following field definitions describe the format of the TX completion
  10820. * indication sent from the target to the host
  10821. * Header fields:
  10822. * - msg_type
  10823. * Bits 7:0
  10824. * Purpose: identifies this as HTT TX completion indication
  10825. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  10826. * - status
  10827. * Bits 10:8
  10828. * Purpose: the TX completion status of payload fragmentations descriptors
  10829. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  10830. * - tid
  10831. * Bits 14:11
  10832. * Purpose: the tid associated with those fragmentation descriptors. It is
  10833. * valid or not, depending on the tid_invalid bit.
  10834. * Value: 0 to 15
  10835. * - tid_invalid
  10836. * Bits 15:15
  10837. * Purpose: this bit indicates whether the tid field is valid or not
  10838. * Value: 0 indicates valid; 1 indicates invalid
  10839. * - num
  10840. * Bits 23:16
  10841. * Purpose: the number of payload in this indication
  10842. * Value: 1 to 255
  10843. * - append (a.k.a. append0)
  10844. * Bits 24:24
  10845. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  10846. * the number of tx retries for one MSDU at the end of this message
  10847. * Value: 0 indicates no appending; 1 indicates appending
  10848. * - append1
  10849. * Bits 25:25
  10850. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  10851. * contains the timestamp info for each TX msdu id in payload.
  10852. * The order of the timestamps matches the order of the MSDU IDs.
  10853. * Note that a big-endian host needs to account for the reordering
  10854. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10855. * conversion) when determining which tx timestamp corresponds to
  10856. * which MSDU ID.
  10857. * Value: 0 indicates no appending; 1 indicates appending
  10858. * - msdu_tx_power_presence
  10859. * Bits 26:26
  10860. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  10861. * for each MSDU referenced by the TX_COMPL_IND message.
  10862. * The tx power is reported in 0.5 dBm units.
  10863. * The order of the per-MSDU tx power reports matches the order
  10864. * of the MSDU IDs.
  10865. * Note that a big-endian host needs to account for the reordering
  10866. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10867. * conversion) when determining which Tx Power corresponds to
  10868. * which MSDU ID.
  10869. * Value: 0 indicates MSDU tx power reports are not appended,
  10870. * 1 indicates MSDU tx power reports are appended
  10871. * - append2
  10872. * Bits 27:27
  10873. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  10874. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  10875. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  10876. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  10877. * for each MSDU, for convenience.
  10878. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  10879. * this append2 bit is set).
  10880. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  10881. * dB above the noise floor.
  10882. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  10883. * 1 indicates MSDU ACK RSSI values are appended.
  10884. * - append3
  10885. * Bits 28:28
  10886. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  10887. * contains the tx tsf info based on wlan global TSF for
  10888. * each TX msdu id in payload.
  10889. * The order of the tx tsf matches the order of the MSDU IDs.
  10890. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  10891. * values to indicate the the lower 32 bits and higher 32 bits of
  10892. * the tx tsf.
  10893. * The tx_tsf64 here represents the time MSDU was acked and the
  10894. * tx_tsf64 has microseconds units.
  10895. * Value: 0 indicates no appending; 1 indicates appending
  10896. * - append4
  10897. * Bits 29:29
  10898. * Purpose: Indicate whether data frame control fields and fields required
  10899. * for radio tap header are appended for each MSDU in TX_COMP_IND
  10900. * message. The order of the this message matches the order of
  10901. * the MSDU IDs.
  10902. * Value: 0 indicates frame control fields and fields required for
  10903. * radio tap header values are not appended,
  10904. * 1 indicates frame control fields and fields required for
  10905. * radio tap header values are appended.
  10906. * Payload fields:
  10907. * - hmsdu_id
  10908. * Bits 15:0
  10909. * Purpose: this ID is used to track the Tx buffer in host
  10910. * Value: 0 to "size of host MSDU descriptor pool - 1"
  10911. */
  10912. PREPACK struct htt_tx_data_hdr_information {
  10913. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  10914. A_UINT32 /* word 1 */
  10915. /* preamble:
  10916. * 0-OFDM,
  10917. * 1-CCk,
  10918. * 2-HT,
  10919. * 3-VHT
  10920. */
  10921. preamble: 2, /* [1:0] */
  10922. /* mcs:
  10923. * In case of HT preamble interpret
  10924. * MCS along with NSS.
  10925. * Valid values for HT are 0 to 7.
  10926. * HT mcs 0 with NSS 2 is mcs 8.
  10927. * Valid values for VHT are 0 to 9.
  10928. */
  10929. mcs: 4, /* [5:2] */
  10930. /* rate:
  10931. * This is applicable only for
  10932. * CCK and OFDM preamble type
  10933. * rate 0: OFDM 48 Mbps,
  10934. * 1: OFDM 24 Mbps,
  10935. * 2: OFDM 12 Mbps
  10936. * 3: OFDM 6 Mbps
  10937. * 4: OFDM 54 Mbps
  10938. * 5: OFDM 36 Mbps
  10939. * 6: OFDM 18 Mbps
  10940. * 7: OFDM 9 Mbps
  10941. * rate 0: CCK 11 Mbps Long
  10942. * 1: CCK 5.5 Mbps Long
  10943. * 2: CCK 2 Mbps Long
  10944. * 3: CCK 1 Mbps Long
  10945. * 4: CCK 11 Mbps Short
  10946. * 5: CCK 5.5 Mbps Short
  10947. * 6: CCK 2 Mbps Short
  10948. */
  10949. rate : 3, /* [ 8: 6] */
  10950. rssi : 8, /* [16: 9] units=dBm */
  10951. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10952. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10953. stbc : 1, /* [22] */
  10954. sgi : 1, /* [23] */
  10955. ldpc : 1, /* [24] */
  10956. beamformed: 1, /* [25] */
  10957. /* tx_retry_cnt:
  10958. * Indicates retry count of data tx frames provided by the host.
  10959. */
  10960. tx_retry_cnt: 6; /* [31:26] */
  10961. A_UINT32 /* word 2 */
  10962. framectrl:16, /* [15: 0] */
  10963. seqno:16; /* [31:16] */
  10964. } POSTPACK;
  10965. #define HTT_TX_COMPL_IND_STATUS_S 8
  10966. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  10967. #define HTT_TX_COMPL_IND_TID_S 11
  10968. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  10969. #define HTT_TX_COMPL_IND_TID_INV_S 15
  10970. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  10971. #define HTT_TX_COMPL_IND_NUM_S 16
  10972. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  10973. #define HTT_TX_COMPL_IND_APPEND_S 24
  10974. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  10975. #define HTT_TX_COMPL_IND_APPEND1_S 25
  10976. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  10977. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  10978. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  10979. #define HTT_TX_COMPL_IND_APPEND2_S 27
  10980. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  10981. #define HTT_TX_COMPL_IND_APPEND3_S 28
  10982. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  10983. #define HTT_TX_COMPL_IND_APPEND4_S 29
  10984. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  10985. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  10986. do { \
  10987. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  10988. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  10989. } while (0)
  10990. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  10991. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  10992. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  10993. do { \
  10994. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  10995. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  10996. } while (0)
  10997. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  10998. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  10999. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  11000. do { \
  11001. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11002. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11003. } while (0)
  11004. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11005. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11006. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11007. do { \
  11008. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11009. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11010. } while (0)
  11011. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11012. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11013. HTT_TX_COMPL_IND_TID_INV_S)
  11014. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11015. do { \
  11016. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11017. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11018. } while (0)
  11019. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11020. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11021. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11022. do { \
  11023. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11024. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11025. } while (0)
  11026. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11027. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11028. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11029. do { \
  11030. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11031. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11032. } while (0)
  11033. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11034. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11035. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11036. do { \
  11037. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11038. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11039. } while (0)
  11040. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11041. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11042. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11043. do { \
  11044. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11045. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11046. } while (0)
  11047. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11048. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11049. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11050. do { \
  11051. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11052. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11053. } while (0)
  11054. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11055. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11056. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11057. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11058. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11059. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11060. #define HTT_TX_COMPL_IND_STAT_OK 0
  11061. /* DISCARD:
  11062. * current meaning:
  11063. * MSDUs were queued for transmission but filtered by HW or SW
  11064. * without any over the air attempts
  11065. * legacy meaning (HL Rome):
  11066. * MSDUs were discarded by the target FW without any over the air
  11067. * attempts due to lack of space
  11068. */
  11069. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11070. /* NO_ACK:
  11071. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11072. */
  11073. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11074. /* POSTPONE:
  11075. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11076. * be downloaded again later (in the appropriate order), when they are
  11077. * deliverable.
  11078. */
  11079. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11080. /*
  11081. * The PEER_DEL tx completion status is used for HL cases
  11082. * where the peer the frame is for has been deleted.
  11083. * The host has already discarded its copy of the frame, but
  11084. * it still needs the tx completion to restore its credit.
  11085. */
  11086. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11087. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11088. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11089. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11090. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11091. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11092. PREPACK struct htt_tx_compl_ind_base {
  11093. A_UINT32 hdr;
  11094. A_UINT16 payload[1/*or more*/];
  11095. } POSTPACK;
  11096. PREPACK struct htt_tx_compl_ind_append_retries {
  11097. A_UINT16 msdu_id;
  11098. A_UINT8 tx_retries;
  11099. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11100. 0: this is the last append_retries struct */
  11101. } POSTPACK;
  11102. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11103. A_UINT32 timestamp[1/*or more*/];
  11104. } POSTPACK;
  11105. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11106. A_UINT32 tx_tsf64_low;
  11107. A_UINT32 tx_tsf64_high;
  11108. } POSTPACK;
  11109. /* htt_tx_data_hdr_information payload extension fields: */
  11110. /* DWORD zero */
  11111. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11112. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11113. /* DWORD one */
  11114. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11115. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11116. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11117. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11118. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11119. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11120. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11121. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11122. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11123. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11124. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11125. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11126. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11127. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11128. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11129. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11130. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11131. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11132. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11133. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11134. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11135. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11136. /* DWORD two */
  11137. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11138. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11139. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11140. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11141. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  11142. do { \
  11143. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  11144. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  11145. } while (0)
  11146. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  11147. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  11148. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  11149. do { \
  11150. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  11151. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  11152. } while (0)
  11153. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  11154. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  11155. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  11156. do { \
  11157. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  11158. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  11159. } while (0)
  11160. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  11161. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  11162. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  11163. do { \
  11164. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  11165. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  11166. } while (0)
  11167. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  11168. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  11169. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  11170. do { \
  11171. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  11172. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  11173. } while (0)
  11174. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  11175. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  11176. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  11177. do { \
  11178. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  11179. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  11180. } while (0)
  11181. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  11182. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  11183. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  11184. do { \
  11185. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  11186. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  11187. } while (0)
  11188. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  11189. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  11190. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  11191. do { \
  11192. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  11193. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  11194. } while (0)
  11195. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  11196. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  11197. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  11198. do { \
  11199. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  11200. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  11201. } while (0)
  11202. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  11203. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  11204. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  11205. do { \
  11206. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  11207. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  11208. } while (0)
  11209. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  11210. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  11211. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  11212. do { \
  11213. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  11214. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  11215. } while (0)
  11216. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  11217. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  11218. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  11219. do { \
  11220. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  11221. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  11222. } while (0)
  11223. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  11224. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  11225. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  11226. do { \
  11227. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  11228. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  11229. } while (0)
  11230. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  11231. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  11232. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  11233. do { \
  11234. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  11235. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  11236. } while (0)
  11237. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  11238. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  11239. /**
  11240. * @brief target -> host rate-control update indication message
  11241. *
  11242. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  11243. *
  11244. * @details
  11245. * The following diagram shows the format of the RC Update message
  11246. * sent from the target to the host, while processing the tx-completion
  11247. * of a transmitted PPDU.
  11248. *
  11249. * |31 24|23 16|15 8|7 0|
  11250. * |-------------------------------------------------------------|
  11251. * | peer ID | vdev ID | msg_type |
  11252. * |-------------------------------------------------------------|
  11253. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11254. * |-------------------------------------------------------------|
  11255. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  11256. * |-------------------------------------------------------------|
  11257. * | : |
  11258. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11259. * | : |
  11260. * |-------------------------------------------------------------|
  11261. * | : |
  11262. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11263. * | : |
  11264. * |-------------------------------------------------------------|
  11265. * : :
  11266. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11267. *
  11268. */
  11269. typedef struct {
  11270. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  11271. A_UINT32 rate_code_flags;
  11272. A_UINT32 flags; /* Encodes information such as excessive
  11273. retransmission, aggregate, some info
  11274. from .11 frame control,
  11275. STBC, LDPC, (SGI and Tx Chain Mask
  11276. are encoded in ptx_rc->flags field),
  11277. AMPDU truncation (BT/time based etc.),
  11278. RTS/CTS attempt */
  11279. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  11280. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  11281. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  11282. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  11283. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  11284. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  11285. } HTT_RC_TX_DONE_PARAMS;
  11286. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  11287. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  11288. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  11289. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  11290. #define HTT_RC_UPDATE_VDEVID_S 8
  11291. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  11292. #define HTT_RC_UPDATE_PEERID_S 16
  11293. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  11294. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  11295. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  11296. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  11297. do { \
  11298. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  11299. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  11300. } while (0)
  11301. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  11302. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  11303. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  11304. do { \
  11305. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  11306. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  11307. } while (0)
  11308. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  11309. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  11310. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  11311. do { \
  11312. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  11313. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  11314. } while (0)
  11315. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  11316. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  11317. /**
  11318. * @brief target -> host rx fragment indication message definition
  11319. *
  11320. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  11321. *
  11322. * @details
  11323. * The following field definitions describe the format of the rx fragment
  11324. * indication message sent from the target to the host.
  11325. * The rx fragment indication message shares the format of the
  11326. * rx indication message, but not all fields from the rx indication message
  11327. * are relevant to the rx fragment indication message.
  11328. *
  11329. *
  11330. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  11331. * |-----------+-------------------+---------------------+-------------|
  11332. * | peer ID | |FV| ext TID | msg type |
  11333. * |-------------------------------------------------------------------|
  11334. * | | flush | flush |
  11335. * | | end | start |
  11336. * | | seq num | seq num |
  11337. * |-------------------------------------------------------------------|
  11338. * | reserved | FW rx desc bytes |
  11339. * |-------------------------------------------------------------------|
  11340. * | | FW MSDU Rx |
  11341. * | | desc B0 |
  11342. * |-------------------------------------------------------------------|
  11343. * Header fields:
  11344. * - MSG_TYPE
  11345. * Bits 7:0
  11346. * Purpose: identifies this as an rx fragment indication message
  11347. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  11348. * - EXT_TID
  11349. * Bits 12:8
  11350. * Purpose: identify the traffic ID of the rx data, including
  11351. * special "extended" TID values for multicast, broadcast, and
  11352. * non-QoS data frames
  11353. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  11354. * - FLUSH_VALID (FV)
  11355. * Bit 13
  11356. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  11357. * is valid
  11358. * Value:
  11359. * 1 -> flush IE is valid and needs to be processed
  11360. * 0 -> flush IE is not valid and should be ignored
  11361. * - PEER_ID
  11362. * Bits 31:16
  11363. * Purpose: Identify, by ID, which peer sent the rx data
  11364. * Value: ID of the peer who sent the rx data
  11365. * - FLUSH_SEQ_NUM_START
  11366. * Bits 5:0
  11367. * Purpose: Indicate the start of a series of MPDUs to flush
  11368. * Not all MPDUs within this series are necessarily valid - the host
  11369. * must check each sequence number within this range to see if the
  11370. * corresponding MPDU is actually present.
  11371. * This field is only valid if the FV bit is set.
  11372. * Value:
  11373. * The sequence number for the first MPDUs to check to flush.
  11374. * The sequence number is masked by 0x3f.
  11375. * - FLUSH_SEQ_NUM_END
  11376. * Bits 11:6
  11377. * Purpose: Indicate the end of a series of MPDUs to flush
  11378. * Value:
  11379. * The sequence number one larger than the sequence number of the
  11380. * last MPDU to check to flush.
  11381. * The sequence number is masked by 0x3f.
  11382. * Not all MPDUs within this series are necessarily valid - the host
  11383. * must check each sequence number within this range to see if the
  11384. * corresponding MPDU is actually present.
  11385. * This field is only valid if the FV bit is set.
  11386. * Rx descriptor fields:
  11387. * - FW_RX_DESC_BYTES
  11388. * Bits 15:0
  11389. * Purpose: Indicate how many bytes in the Rx indication are used for
  11390. * FW Rx descriptors
  11391. * Value: 1
  11392. */
  11393. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  11394. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  11395. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  11396. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  11397. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  11398. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  11399. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  11400. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  11401. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  11402. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  11403. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  11404. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  11405. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  11406. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  11407. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  11408. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  11409. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  11410. #define HTT_RX_FRAG_IND_BYTES \
  11411. (4 /* msg hdr */ + \
  11412. 4 /* flush spec */ + \
  11413. 4 /* (unused) FW rx desc bytes spec */ + \
  11414. 4 /* FW rx desc */)
  11415. /**
  11416. * @brief target -> host test message definition
  11417. *
  11418. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  11419. *
  11420. * @details
  11421. * The following field definitions describe the format of the test
  11422. * message sent from the target to the host.
  11423. * The message consists of a 4-octet header, followed by a variable
  11424. * number of 32-bit integer values, followed by a variable number
  11425. * of 8-bit character values.
  11426. *
  11427. * |31 16|15 8|7 0|
  11428. * |-----------------------------------------------------------|
  11429. * | num chars | num ints | msg type |
  11430. * |-----------------------------------------------------------|
  11431. * | int 0 |
  11432. * |-----------------------------------------------------------|
  11433. * | int 1 |
  11434. * |-----------------------------------------------------------|
  11435. * | ... |
  11436. * |-----------------------------------------------------------|
  11437. * | char 3 | char 2 | char 1 | char 0 |
  11438. * |-----------------------------------------------------------|
  11439. * | | | ... | char 4 |
  11440. * |-----------------------------------------------------------|
  11441. * - MSG_TYPE
  11442. * Bits 7:0
  11443. * Purpose: identifies this as a test message
  11444. * Value: HTT_MSG_TYPE_TEST
  11445. * - NUM_INTS
  11446. * Bits 15:8
  11447. * Purpose: indicate how many 32-bit integers follow the message header
  11448. * - NUM_CHARS
  11449. * Bits 31:16
  11450. * Purpose: indicate how many 8-bit charaters follow the series of integers
  11451. */
  11452. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  11453. #define HTT_RX_TEST_NUM_INTS_S 8
  11454. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  11455. #define HTT_RX_TEST_NUM_CHARS_S 16
  11456. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  11457. do { \
  11458. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  11459. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  11460. } while (0)
  11461. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  11462. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  11463. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  11464. do { \
  11465. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  11466. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  11467. } while (0)
  11468. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  11469. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  11470. /**
  11471. * @brief target -> host packet log message
  11472. *
  11473. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  11474. *
  11475. * @details
  11476. * The following field definitions describe the format of the packet log
  11477. * message sent from the target to the host.
  11478. * The message consists of a 4-octet header,followed by a variable number
  11479. * of 32-bit character values.
  11480. *
  11481. * |31 16|15 12|11 10|9 8|7 0|
  11482. * |------------------------------------------------------------------|
  11483. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  11484. * |------------------------------------------------------------------|
  11485. * | payload |
  11486. * |------------------------------------------------------------------|
  11487. * - MSG_TYPE
  11488. * Bits 7:0
  11489. * Purpose: identifies this as a pktlog message
  11490. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  11491. * - mac_id
  11492. * Bits 9:8
  11493. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  11494. * Value: 0-3
  11495. * - pdev_id
  11496. * Bits 11:10
  11497. * Purpose: pdev_id
  11498. * Value: 0-3
  11499. * 0 (for rings at SOC level),
  11500. * 1/2/3 PDEV -> 0/1/2
  11501. * - payload_size
  11502. * Bits 31:16
  11503. * Purpose: explicitly specify the payload size
  11504. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  11505. */
  11506. PREPACK struct htt_pktlog_msg {
  11507. A_UINT32 header;
  11508. A_UINT32 payload[1/* or more */];
  11509. } POSTPACK;
  11510. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  11511. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  11512. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  11513. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  11514. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  11515. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  11516. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  11517. do { \
  11518. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  11519. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  11520. } while (0)
  11521. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  11522. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  11523. HTT_T2H_PKTLOG_MAC_ID_S)
  11524. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  11525. do { \
  11526. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  11527. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  11528. } while (0)
  11529. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  11530. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  11531. HTT_T2H_PKTLOG_PDEV_ID_S)
  11532. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  11533. do { \
  11534. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  11535. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  11536. } while (0)
  11537. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  11538. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  11539. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  11540. /*
  11541. * Rx reorder statistics
  11542. * NB: all the fields must be defined in 4 octets size.
  11543. */
  11544. struct rx_reorder_stats {
  11545. /* Non QoS MPDUs received */
  11546. A_UINT32 deliver_non_qos;
  11547. /* MPDUs received in-order */
  11548. A_UINT32 deliver_in_order;
  11549. /* Flush due to reorder timer expired */
  11550. A_UINT32 deliver_flush_timeout;
  11551. /* Flush due to move out of window */
  11552. A_UINT32 deliver_flush_oow;
  11553. /* Flush due to DELBA */
  11554. A_UINT32 deliver_flush_delba;
  11555. /* MPDUs dropped due to FCS error */
  11556. A_UINT32 fcs_error;
  11557. /* MPDUs dropped due to monitor mode non-data packet */
  11558. A_UINT32 mgmt_ctrl;
  11559. /* Unicast-data MPDUs dropped due to invalid peer */
  11560. A_UINT32 invalid_peer;
  11561. /* MPDUs dropped due to duplication (non aggregation) */
  11562. A_UINT32 dup_non_aggr;
  11563. /* MPDUs dropped due to processed before */
  11564. A_UINT32 dup_past;
  11565. /* MPDUs dropped due to duplicate in reorder queue */
  11566. A_UINT32 dup_in_reorder;
  11567. /* Reorder timeout happened */
  11568. A_UINT32 reorder_timeout;
  11569. /* invalid bar ssn */
  11570. A_UINT32 invalid_bar_ssn;
  11571. /* reorder reset due to bar ssn */
  11572. A_UINT32 ssn_reset;
  11573. /* Flush due to delete peer */
  11574. A_UINT32 deliver_flush_delpeer;
  11575. /* Flush due to offload*/
  11576. A_UINT32 deliver_flush_offload;
  11577. /* Flush due to out of buffer*/
  11578. A_UINT32 deliver_flush_oob;
  11579. /* MPDUs dropped due to PN check fail */
  11580. A_UINT32 pn_fail;
  11581. /* MPDUs dropped due to unable to allocate memory */
  11582. A_UINT32 store_fail;
  11583. /* Number of times the tid pool alloc succeeded */
  11584. A_UINT32 tid_pool_alloc_succ;
  11585. /* Number of times the MPDU pool alloc succeeded */
  11586. A_UINT32 mpdu_pool_alloc_succ;
  11587. /* Number of times the MSDU pool alloc succeeded */
  11588. A_UINT32 msdu_pool_alloc_succ;
  11589. /* Number of times the tid pool alloc failed */
  11590. A_UINT32 tid_pool_alloc_fail;
  11591. /* Number of times the MPDU pool alloc failed */
  11592. A_UINT32 mpdu_pool_alloc_fail;
  11593. /* Number of times the MSDU pool alloc failed */
  11594. A_UINT32 msdu_pool_alloc_fail;
  11595. /* Number of times the tid pool freed */
  11596. A_UINT32 tid_pool_free;
  11597. /* Number of times the MPDU pool freed */
  11598. A_UINT32 mpdu_pool_free;
  11599. /* Number of times the MSDU pool freed */
  11600. A_UINT32 msdu_pool_free;
  11601. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  11602. A_UINT32 msdu_queued;
  11603. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  11604. A_UINT32 msdu_recycled;
  11605. /* Number of MPDUs with invalid peer but A2 found in AST */
  11606. A_UINT32 invalid_peer_a2_in_ast;
  11607. /* Number of MPDUs with invalid peer but A3 found in AST */
  11608. A_UINT32 invalid_peer_a3_in_ast;
  11609. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  11610. A_UINT32 invalid_peer_bmc_mpdus;
  11611. /* Number of MSDUs with err attention word */
  11612. A_UINT32 rxdesc_err_att;
  11613. /* Number of MSDUs with flag of peer_idx_invalid */
  11614. A_UINT32 rxdesc_err_peer_idx_inv;
  11615. /* Number of MSDUs with flag of peer_idx_timeout */
  11616. A_UINT32 rxdesc_err_peer_idx_to;
  11617. /* Number of MSDUs with flag of overflow */
  11618. A_UINT32 rxdesc_err_ov;
  11619. /* Number of MSDUs with flag of msdu_length_err */
  11620. A_UINT32 rxdesc_err_msdu_len;
  11621. /* Number of MSDUs with flag of mpdu_length_err */
  11622. A_UINT32 rxdesc_err_mpdu_len;
  11623. /* Number of MSDUs with flag of tkip_mic_err */
  11624. A_UINT32 rxdesc_err_tkip_mic;
  11625. /* Number of MSDUs with flag of decrypt_err */
  11626. A_UINT32 rxdesc_err_decrypt;
  11627. /* Number of MSDUs with flag of fcs_err */
  11628. A_UINT32 rxdesc_err_fcs;
  11629. /* Number of Unicast (bc_mc bit is not set in attention word)
  11630. * frames with invalid peer handler
  11631. */
  11632. A_UINT32 rxdesc_uc_msdus_inv_peer;
  11633. /* Number of unicast frame directly (direct bit is set in attention word)
  11634. * to DUT with invalid peer handler
  11635. */
  11636. A_UINT32 rxdesc_direct_msdus_inv_peer;
  11637. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  11638. * frames with invalid peer handler
  11639. */
  11640. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  11641. /* Number of MSDUs dropped due to no first MSDU flag */
  11642. A_UINT32 rxdesc_no_1st_msdu;
  11643. /* Number of MSDUs droped due to ring overflow */
  11644. A_UINT32 msdu_drop_ring_ov;
  11645. /* Number of MSDUs dropped due to FC mismatch */
  11646. A_UINT32 msdu_drop_fc_mismatch;
  11647. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  11648. A_UINT32 msdu_drop_mgmt_remote_ring;
  11649. /* Number of MSDUs dropped due to errors not reported in attention word */
  11650. A_UINT32 msdu_drop_misc;
  11651. /* Number of MSDUs go to offload before reorder */
  11652. A_UINT32 offload_msdu_wal;
  11653. /* Number of data frame dropped by offload after reorder */
  11654. A_UINT32 offload_msdu_reorder;
  11655. /* Number of MPDUs with sequence number in the past and within the BA window */
  11656. A_UINT32 dup_past_within_window;
  11657. /* Number of MPDUs with sequence number in the past and outside the BA window */
  11658. A_UINT32 dup_past_outside_window;
  11659. /* Number of MSDUs with decrypt/MIC error */
  11660. A_UINT32 rxdesc_err_decrypt_mic;
  11661. /* Number of data MSDUs received on both local and remote rings */
  11662. A_UINT32 data_msdus_on_both_rings;
  11663. /* MPDUs never filled */
  11664. A_UINT32 holes_not_filled;
  11665. };
  11666. /*
  11667. * Rx Remote buffer statistics
  11668. * NB: all the fields must be defined in 4 octets size.
  11669. */
  11670. struct rx_remote_buffer_mgmt_stats {
  11671. /* Total number of MSDUs reaped for Rx processing */
  11672. A_UINT32 remote_reaped;
  11673. /* MSDUs recycled within firmware */
  11674. A_UINT32 remote_recycled;
  11675. /* MSDUs stored by Data Rx */
  11676. A_UINT32 data_rx_msdus_stored;
  11677. /* Number of HTT indications from WAL Rx MSDU */
  11678. A_UINT32 wal_rx_ind;
  11679. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  11680. A_UINT32 wal_rx_ind_unconsumed;
  11681. /* Number of HTT indications from Data Rx MSDU */
  11682. A_UINT32 data_rx_ind;
  11683. /* Number of unconsumed HTT indications from Data Rx MSDU */
  11684. A_UINT32 data_rx_ind_unconsumed;
  11685. /* Number of HTT indications from ATHBUF */
  11686. A_UINT32 athbuf_rx_ind;
  11687. /* Number of remote buffers requested for refill */
  11688. A_UINT32 refill_buf_req;
  11689. /* Number of remote buffers filled by the host */
  11690. A_UINT32 refill_buf_rsp;
  11691. /* Number of times MAC hw_index = f/w write_index */
  11692. A_INT32 mac_no_bufs;
  11693. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  11694. A_INT32 fw_indices_equal;
  11695. /* Number of times f/w finds no buffers to post */
  11696. A_INT32 host_no_bufs;
  11697. };
  11698. /*
  11699. * TXBF MU/SU packets and NDPA statistics
  11700. * NB: all the fields must be defined in 4 octets size.
  11701. */
  11702. struct rx_txbf_musu_ndpa_pkts_stats {
  11703. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  11704. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  11705. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  11706. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  11707. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  11708. A_UINT32 reserved[3]; /* must be set to 0x0 */
  11709. };
  11710. /*
  11711. * htt_dbg_stats_status -
  11712. * present - The requested stats have been delivered in full.
  11713. * This indicates that either the stats information was contained
  11714. * in its entirety within this message, or else this message
  11715. * completes the delivery of the requested stats info that was
  11716. * partially delivered through earlier STATS_CONF messages.
  11717. * partial - The requested stats have been delivered in part.
  11718. * One or more subsequent STATS_CONF messages with the same
  11719. * cookie value will be sent to deliver the remainder of the
  11720. * information.
  11721. * error - The requested stats could not be delivered, for example due
  11722. * to a shortage of memory to construct a message holding the
  11723. * requested stats.
  11724. * invalid - The requested stat type is either not recognized, or the
  11725. * target is configured to not gather the stats type in question.
  11726. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11727. * series_done - This special value indicates that no further stats info
  11728. * elements are present within a series of stats info elems
  11729. * (within a stats upload confirmation message).
  11730. */
  11731. enum htt_dbg_stats_status {
  11732. HTT_DBG_STATS_STATUS_PRESENT = 0,
  11733. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  11734. HTT_DBG_STATS_STATUS_ERROR = 2,
  11735. HTT_DBG_STATS_STATUS_INVALID = 3,
  11736. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  11737. };
  11738. /**
  11739. * @brief target -> host statistics upload
  11740. *
  11741. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  11742. *
  11743. * @details
  11744. * The following field definitions describe the format of the HTT target
  11745. * to host stats upload confirmation message.
  11746. * The message contains a cookie echoed from the HTT host->target stats
  11747. * upload request, which identifies which request the confirmation is
  11748. * for, and a series of tag-length-value stats information elements.
  11749. * The tag-length header for each stats info element also includes a
  11750. * status field, to indicate whether the request for the stat type in
  11751. * question was fully met, partially met, unable to be met, or invalid
  11752. * (if the stat type in question is disabled in the target).
  11753. * A special value of all 1's in this status field is used to indicate
  11754. * the end of the series of stats info elements.
  11755. *
  11756. *
  11757. * |31 16|15 8|7 5|4 0|
  11758. * |------------------------------------------------------------|
  11759. * | reserved | msg type |
  11760. * |------------------------------------------------------------|
  11761. * | cookie LSBs |
  11762. * |------------------------------------------------------------|
  11763. * | cookie MSBs |
  11764. * |------------------------------------------------------------|
  11765. * | stats entry length | reserved | S |stat type|
  11766. * |------------------------------------------------------------|
  11767. * | |
  11768. * | type-specific stats info |
  11769. * | |
  11770. * |------------------------------------------------------------|
  11771. * | stats entry length | reserved | S |stat type|
  11772. * |------------------------------------------------------------|
  11773. * | |
  11774. * | type-specific stats info |
  11775. * | |
  11776. * |------------------------------------------------------------|
  11777. * | n/a | reserved | 111 | n/a |
  11778. * |------------------------------------------------------------|
  11779. * Header fields:
  11780. * - MSG_TYPE
  11781. * Bits 7:0
  11782. * Purpose: identifies this is a statistics upload confirmation message
  11783. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  11784. * - COOKIE_LSBS
  11785. * Bits 31:0
  11786. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11787. * message with its preceding host->target stats request message.
  11788. * Value: LSBs of the opaque cookie specified by the host-side requestor
  11789. * - COOKIE_MSBS
  11790. * Bits 31:0
  11791. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11792. * message with its preceding host->target stats request message.
  11793. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11794. *
  11795. * Stats Information Element tag-length header fields:
  11796. * - STAT_TYPE
  11797. * Bits 4:0
  11798. * Purpose: identifies the type of statistics info held in the
  11799. * following information element
  11800. * Value: htt_dbg_stats_type
  11801. * - STATUS
  11802. * Bits 7:5
  11803. * Purpose: indicate whether the requested stats are present
  11804. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  11805. * the completion of the stats entry series
  11806. * - LENGTH
  11807. * Bits 31:16
  11808. * Purpose: indicate the stats information size
  11809. * Value: This field specifies the number of bytes of stats information
  11810. * that follows the element tag-length header.
  11811. * It is expected but not required that this length is a multiple of
  11812. * 4 bytes. Even if the length is not an integer multiple of 4, the
  11813. * subsequent stats entry header will begin on a 4-byte aligned
  11814. * boundary.
  11815. */
  11816. #define HTT_T2H_STATS_COOKIE_SIZE 8
  11817. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  11818. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  11819. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  11820. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  11821. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  11822. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  11823. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  11824. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11825. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  11826. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  11827. do { \
  11828. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  11829. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  11830. } while (0)
  11831. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  11832. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  11833. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  11834. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  11835. do { \
  11836. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  11837. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  11838. } while (0)
  11839. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  11840. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  11841. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  11842. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11843. do { \
  11844. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  11845. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  11846. } while (0)
  11847. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  11848. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  11849. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  11850. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  11851. #define HTT_MAX_AGGR 64
  11852. #define HTT_HL_MAX_AGGR 18
  11853. /**
  11854. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  11855. *
  11856. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  11857. *
  11858. * @details
  11859. * The following field definitions describe the format of the HTT host
  11860. * to target frag_desc/msdu_ext bank configuration message.
  11861. * The message contains the based address and the min and max id of the
  11862. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  11863. * MSDU_EXT/FRAG_DESC.
  11864. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  11865. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  11866. * the hardware does the mapping/translation.
  11867. *
  11868. * Total banks that can be configured is configured to 16.
  11869. *
  11870. * This should be called before any TX has be initiated by the HTT
  11871. *
  11872. * |31 16|15 8|7 5|4 0|
  11873. * |------------------------------------------------------------|
  11874. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  11875. * |------------------------------------------------------------|
  11876. * | BANK0_BASE_ADDRESS (bits 31:0) |
  11877. #if HTT_PADDR64
  11878. * | BANK0_BASE_ADDRESS (bits 63:32) |
  11879. #endif
  11880. * |------------------------------------------------------------|
  11881. * | ... |
  11882. * |------------------------------------------------------------|
  11883. * | BANK15_BASE_ADDRESS (bits 31:0) |
  11884. #if HTT_PADDR64
  11885. * | BANK15_BASE_ADDRESS (bits 63:32) |
  11886. #endif
  11887. * |------------------------------------------------------------|
  11888. * | BANK0_MAX_ID | BANK0_MIN_ID |
  11889. * |------------------------------------------------------------|
  11890. * | ... |
  11891. * |------------------------------------------------------------|
  11892. * | BANK15_MAX_ID | BANK15_MIN_ID |
  11893. * |------------------------------------------------------------|
  11894. * Header fields:
  11895. * - MSG_TYPE
  11896. * Bits 7:0
  11897. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  11898. * for systems with 64-bit format for bus addresses:
  11899. * - BANKx_BASE_ADDRESS_LO
  11900. * Bits 31:0
  11901. * Purpose: Provide a mechanism to specify the base address of the
  11902. * MSDU_EXT bank physical/bus address.
  11903. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  11904. * - BANKx_BASE_ADDRESS_HI
  11905. * Bits 31:0
  11906. * Purpose: Provide a mechanism to specify the base address of the
  11907. * MSDU_EXT bank physical/bus address.
  11908. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  11909. * for systems with 32-bit format for bus addresses:
  11910. * - BANKx_BASE_ADDRESS
  11911. * Bits 31:0
  11912. * Purpose: Provide a mechanism to specify the base address of the
  11913. * MSDU_EXT bank physical/bus address.
  11914. * Value: MSDU_EXT bank physical / bus address
  11915. * - BANKx_MIN_ID
  11916. * Bits 15:0
  11917. * Purpose: Provide a mechanism to specify the min index that needs to
  11918. * mapped.
  11919. * - BANKx_MAX_ID
  11920. * Bits 31:16
  11921. * Purpose: Provide a mechanism to specify the max index that needs to
  11922. * mapped.
  11923. *
  11924. */
  11925. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  11926. * safe value.
  11927. * @note MAX supported banks is 16.
  11928. */
  11929. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  11930. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  11931. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  11932. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  11933. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  11934. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  11935. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  11936. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  11937. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  11938. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  11939. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  11940. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  11941. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  11942. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  11943. do { \
  11944. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  11945. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  11946. } while (0)
  11947. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  11948. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  11949. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  11950. do { \
  11951. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  11952. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  11953. } while (0)
  11954. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  11955. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  11956. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  11957. do { \
  11958. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  11959. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  11960. } while (0)
  11961. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  11962. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  11963. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  11964. do { \
  11965. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  11966. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  11967. } while (0)
  11968. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  11969. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  11970. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  11971. do { \
  11972. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  11973. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  11974. } while (0)
  11975. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  11976. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  11977. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  11978. do { \
  11979. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  11980. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  11981. } while (0)
  11982. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  11983. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  11984. /*
  11985. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  11986. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  11987. * addresses are stored in a XXX-bit field.
  11988. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  11989. * htt_tx_frag_desc64_bank_cfg_t structs.
  11990. */
  11991. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  11992. _paddr_bits_, \
  11993. _paddr__bank_base_address_) \
  11994. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  11995. /** word 0 \
  11996. * msg_type: 8, \
  11997. * pdev_id: 2, \
  11998. * swap: 1, \
  11999. * reserved0: 5, \
  12000. * num_banks: 8, \
  12001. * desc_size: 8; \
  12002. */ \
  12003. A_UINT32 word0; \
  12004. /* \
  12005. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12006. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12007. * the second A_UINT32). \
  12008. */ \
  12009. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12010. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12011. } POSTPACK
  12012. /* define htt_tx_frag_desc32_bank_cfg_t */
  12013. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12014. /* define htt_tx_frag_desc64_bank_cfg_t */
  12015. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12016. /*
  12017. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12018. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12019. */
  12020. #if HTT_PADDR64
  12021. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12022. #else
  12023. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12024. #endif
  12025. /**
  12026. * @brief target -> host HTT TX Credit total count update message definition
  12027. *
  12028. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12029. *
  12030. *|31 16|15|14 9| 8 |7 0 |
  12031. *|---------------------+--+----------+-------+----------|
  12032. *|cur htt credit delta | Q| reserved | sign | msg type |
  12033. *|------------------------------------------------------|
  12034. *
  12035. * Header fields:
  12036. * - MSG_TYPE
  12037. * Bits 7:0
  12038. * Purpose: identifies this as a htt tx credit delta update message
  12039. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12040. * - SIGN
  12041. * Bits 8
  12042. * identifies whether credit delta is positive or negative
  12043. * Value:
  12044. * - 0x0: credit delta is positive, rebalance in some buffers
  12045. * - 0x1: credit delta is negative, rebalance out some buffers
  12046. * - reserved
  12047. * Bits 14:9
  12048. * Value: 0x0
  12049. * - TXQ_GRP
  12050. * Bit 15
  12051. * Purpose: indicates whether any tx queue group information elements
  12052. * are appended to the tx credit update message
  12053. * Value: 0 -> no tx queue group information element is present
  12054. * 1 -> a tx queue group information element immediately follows
  12055. * - DELTA_COUNT
  12056. * Bits 31:16
  12057. * Purpose: Specify current htt credit delta absolute count
  12058. */
  12059. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12060. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12061. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12062. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12063. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12064. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12065. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12066. do { \
  12067. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12068. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12069. } while (0)
  12070. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12071. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12072. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12073. do { \
  12074. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12075. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12076. } while (0)
  12077. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12078. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12079. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12080. do { \
  12081. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12082. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12083. } while (0)
  12084. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12085. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12086. #define HTT_TX_CREDIT_MSG_BYTES 4
  12087. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12088. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12089. /**
  12090. * @brief HTT WDI_IPA Operation Response Message
  12091. *
  12092. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12093. *
  12094. * @details
  12095. * HTT WDI_IPA Operation Response message is sent by target
  12096. * to host confirming suspend or resume operation.
  12097. * |31 24|23 16|15 8|7 0|
  12098. * |----------------+----------------+----------------+----------------|
  12099. * | op_code | Rsvd | msg_type |
  12100. * |-------------------------------------------------------------------|
  12101. * | Rsvd | Response len |
  12102. * |-------------------------------------------------------------------|
  12103. * | |
  12104. * | Response-type specific info |
  12105. * | |
  12106. * | |
  12107. * |-------------------------------------------------------------------|
  12108. * Header fields:
  12109. * - MSG_TYPE
  12110. * Bits 7:0
  12111. * Purpose: Identifies this as WDI_IPA Operation Response message
  12112. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12113. * - OP_CODE
  12114. * Bits 31:16
  12115. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12116. * value: = enum htt_wdi_ipa_op_code
  12117. * - RSP_LEN
  12118. * Bits 16:0
  12119. * Purpose: length for the response-type specific info
  12120. * value: = length in bytes for response-type specific info
  12121. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12122. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12123. */
  12124. PREPACK struct htt_wdi_ipa_op_response_t
  12125. {
  12126. /* DWORD 0: flags and meta-data */
  12127. A_UINT32
  12128. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12129. reserved1: 8,
  12130. op_code: 16;
  12131. A_UINT32
  12132. rsp_len: 16,
  12133. reserved2: 16;
  12134. } POSTPACK;
  12135. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12136. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12137. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12138. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12139. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12140. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12141. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  12142. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  12143. do { \
  12144. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  12145. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  12146. } while (0)
  12147. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  12148. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  12149. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  12150. do { \
  12151. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  12152. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  12153. } while (0)
  12154. enum htt_phy_mode {
  12155. htt_phy_mode_11a = 0,
  12156. htt_phy_mode_11g = 1,
  12157. htt_phy_mode_11b = 2,
  12158. htt_phy_mode_11g_only = 3,
  12159. htt_phy_mode_11na_ht20 = 4,
  12160. htt_phy_mode_11ng_ht20 = 5,
  12161. htt_phy_mode_11na_ht40 = 6,
  12162. htt_phy_mode_11ng_ht40 = 7,
  12163. htt_phy_mode_11ac_vht20 = 8,
  12164. htt_phy_mode_11ac_vht40 = 9,
  12165. htt_phy_mode_11ac_vht80 = 10,
  12166. htt_phy_mode_11ac_vht20_2g = 11,
  12167. htt_phy_mode_11ac_vht40_2g = 12,
  12168. htt_phy_mode_11ac_vht80_2g = 13,
  12169. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  12170. htt_phy_mode_11ac_vht160 = 15,
  12171. htt_phy_mode_max,
  12172. };
  12173. /**
  12174. * @brief target -> host HTT channel change indication
  12175. *
  12176. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  12177. *
  12178. * @details
  12179. * Specify when a channel change occurs.
  12180. * This allows the host to precisely determine which rx frames arrived
  12181. * on the old channel and which rx frames arrived on the new channel.
  12182. *
  12183. *|31 |7 0 |
  12184. *|-------------------------------------------+----------|
  12185. *| reserved | msg type |
  12186. *|------------------------------------------------------|
  12187. *| primary_chan_center_freq_mhz |
  12188. *|------------------------------------------------------|
  12189. *| contiguous_chan1_center_freq_mhz |
  12190. *|------------------------------------------------------|
  12191. *| contiguous_chan2_center_freq_mhz |
  12192. *|------------------------------------------------------|
  12193. *| phy_mode |
  12194. *|------------------------------------------------------|
  12195. *
  12196. * Header fields:
  12197. * - MSG_TYPE
  12198. * Bits 7:0
  12199. * Purpose: identifies this as a htt channel change indication message
  12200. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  12201. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  12202. * Bits 31:0
  12203. * Purpose: identify the (center of the) new 20 MHz primary channel
  12204. * Value: center frequency of the 20 MHz primary channel, in MHz units
  12205. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  12206. * Bits 31:0
  12207. * Purpose: identify the (center of the) contiguous frequency range
  12208. * comprising the new channel.
  12209. * For example, if the new channel is a 80 MHz channel extending
  12210. * 60 MHz beyond the primary channel, this field would be 30 larger
  12211. * than the primary channel center frequency field.
  12212. * Value: center frequency of the contiguous frequency range comprising
  12213. * the full channel in MHz units
  12214. * (80+80 channels also use the CONTIG_CHAN2 field)
  12215. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  12216. * Bits 31:0
  12217. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  12218. * within a VHT 80+80 channel.
  12219. * This field is only relevant for VHT 80+80 channels.
  12220. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  12221. * channel (arbitrary value for cases besides VHT 80+80)
  12222. * - PHY_MODE
  12223. * Bits 31:0
  12224. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  12225. * and band
  12226. * Value: htt_phy_mode enum value
  12227. */
  12228. PREPACK struct htt_chan_change_t
  12229. {
  12230. /* DWORD 0: flags and meta-data */
  12231. A_UINT32
  12232. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12233. reserved1: 24;
  12234. A_UINT32 primary_chan_center_freq_mhz;
  12235. A_UINT32 contig_chan1_center_freq_mhz;
  12236. A_UINT32 contig_chan2_center_freq_mhz;
  12237. A_UINT32 phy_mode;
  12238. } POSTPACK;
  12239. /*
  12240. * Due to historical / backwards-compatibility reasons, maintain the
  12241. * below htt_chan_change_msg struct definition, which needs to be
  12242. * consistent with the above htt_chan_change_t struct definition
  12243. * (aside from the htt_chan_change_t definition including the msg_type
  12244. * dword within the message, and the htt_chan_change_msg only containing
  12245. * the payload of the message that follows the msg_type dword).
  12246. */
  12247. PREPACK struct htt_chan_change_msg {
  12248. A_UINT32 chan_mhz; /* frequency in mhz */
  12249. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  12250. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  12251. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  12252. } POSTPACK;
  12253. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  12254. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  12255. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  12256. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  12257. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  12258. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  12259. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  12260. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  12261. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  12262. do { \
  12263. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  12264. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  12265. } while (0)
  12266. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  12267. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  12268. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  12269. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  12270. do { \
  12271. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  12272. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  12273. } while (0)
  12274. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  12275. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  12276. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  12277. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  12278. do { \
  12279. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  12280. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  12281. } while (0)
  12282. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  12283. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  12284. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  12285. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  12286. do { \
  12287. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  12288. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  12289. } while (0)
  12290. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  12291. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  12292. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  12293. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  12294. /**
  12295. * @brief rx offload packet error message
  12296. *
  12297. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  12298. *
  12299. * @details
  12300. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  12301. * of target payload like mic err.
  12302. *
  12303. * |31 24|23 16|15 8|7 0|
  12304. * |----------------+----------------+----------------+----------------|
  12305. * | tid | vdev_id | msg_sub_type | msg_type |
  12306. * |-------------------------------------------------------------------|
  12307. * : (sub-type dependent content) :
  12308. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12309. * Header fields:
  12310. * - msg_type
  12311. * Bits 7:0
  12312. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  12313. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  12314. * - msg_sub_type
  12315. * Bits 15:8
  12316. * Purpose: Identifies which type of rx error is reported by this message
  12317. * value: htt_rx_ofld_pkt_err_type
  12318. * - vdev_id
  12319. * Bits 23:16
  12320. * Purpose: Identifies which vdev received the erroneous rx frame
  12321. * value:
  12322. * - tid
  12323. * Bits 31:24
  12324. * Purpose: Identifies the traffic type of the rx frame
  12325. * value:
  12326. *
  12327. * - The payload fields used if the sub-type == MIC error are shown below.
  12328. * Note - MIC err is per MSDU, while PN is per MPDU.
  12329. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  12330. * with MIC err in A-MSDU case, so FW will send only one HTT message
  12331. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  12332. * instead of sending separate HTT messages for each wrong MSDU within
  12333. * the MPDU.
  12334. *
  12335. * |31 24|23 16|15 8|7 0|
  12336. * |----------------+----------------+----------------+----------------|
  12337. * | Rsvd | key_id | peer_id |
  12338. * |-------------------------------------------------------------------|
  12339. * | receiver MAC addr 31:0 |
  12340. * |-------------------------------------------------------------------|
  12341. * | Rsvd | receiver MAC addr 47:32 |
  12342. * |-------------------------------------------------------------------|
  12343. * | transmitter MAC addr 31:0 |
  12344. * |-------------------------------------------------------------------|
  12345. * | Rsvd | transmitter MAC addr 47:32 |
  12346. * |-------------------------------------------------------------------|
  12347. * | PN 31:0 |
  12348. * |-------------------------------------------------------------------|
  12349. * | Rsvd | PN 47:32 |
  12350. * |-------------------------------------------------------------------|
  12351. * - peer_id
  12352. * Bits 15:0
  12353. * Purpose: identifies which peer is frame is from
  12354. * value:
  12355. * - key_id
  12356. * Bits 23:16
  12357. * Purpose: identifies key_id of rx frame
  12358. * value:
  12359. * - RA_31_0 (receiver MAC addr 31:0)
  12360. * Bits 31:0
  12361. * Purpose: identifies by MAC address which vdev received the frame
  12362. * value: MAC address lower 4 bytes
  12363. * - RA_47_32 (receiver MAC addr 47:32)
  12364. * Bits 15:0
  12365. * Purpose: identifies by MAC address which vdev received the frame
  12366. * value: MAC address upper 2 bytes
  12367. * - TA_31_0 (transmitter MAC addr 31:0)
  12368. * Bits 31:0
  12369. * Purpose: identifies by MAC address which peer transmitted the frame
  12370. * value: MAC address lower 4 bytes
  12371. * - TA_47_32 (transmitter MAC addr 47:32)
  12372. * Bits 15:0
  12373. * Purpose: identifies by MAC address which peer transmitted the frame
  12374. * value: MAC address upper 2 bytes
  12375. * - PN_31_0
  12376. * Bits 31:0
  12377. * Purpose: Identifies pn of rx frame
  12378. * value: PN lower 4 bytes
  12379. * - PN_47_32
  12380. * Bits 15:0
  12381. * Purpose: Identifies pn of rx frame
  12382. * value:
  12383. * TKIP or CCMP: PN upper 2 bytes
  12384. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  12385. */
  12386. enum htt_rx_ofld_pkt_err_type {
  12387. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  12388. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  12389. };
  12390. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  12391. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  12392. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  12393. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  12394. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  12395. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  12396. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  12397. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  12398. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  12399. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  12400. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  12401. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  12402. do { \
  12403. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  12404. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  12405. } while (0)
  12406. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  12407. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  12408. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  12409. do { \
  12410. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  12411. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  12412. } while (0)
  12413. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  12414. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  12415. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  12416. do { \
  12417. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  12418. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  12419. } while (0)
  12420. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  12421. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  12422. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  12423. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  12424. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  12425. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  12426. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  12427. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  12428. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  12429. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  12430. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  12431. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  12432. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  12433. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  12434. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  12435. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  12436. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  12437. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  12438. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  12439. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  12440. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  12441. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  12442. do { \
  12443. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  12444. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  12445. } while (0)
  12446. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  12447. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  12448. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  12449. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  12450. do { \
  12451. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  12452. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  12453. } while (0)
  12454. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  12455. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  12456. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  12457. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  12458. do { \
  12459. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  12460. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  12461. } while (0)
  12462. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  12463. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  12464. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  12465. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  12466. do { \
  12467. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  12468. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  12469. } while (0)
  12470. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  12471. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  12472. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  12473. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  12474. do { \
  12475. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  12476. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  12477. } while (0)
  12478. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  12479. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  12480. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  12481. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  12482. do { \
  12483. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  12484. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  12485. } while (0)
  12486. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  12487. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  12488. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  12489. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  12490. do { \
  12491. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  12492. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  12493. } while (0)
  12494. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  12495. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  12496. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  12497. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  12498. do { \
  12499. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  12500. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  12501. } while (0)
  12502. /**
  12503. * @brief target -> host peer rate report message
  12504. *
  12505. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  12506. *
  12507. * @details
  12508. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  12509. * justified rate of all the peers.
  12510. *
  12511. * |31 24|23 16|15 8|7 0|
  12512. * |----------------+----------------+----------------+----------------|
  12513. * | peer_count | | msg_type |
  12514. * |-------------------------------------------------------------------|
  12515. * : Payload (variant number of peer rate report) :
  12516. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12517. * Header fields:
  12518. * - msg_type
  12519. * Bits 7:0
  12520. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  12521. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  12522. * - reserved
  12523. * Bits 15:8
  12524. * Purpose:
  12525. * value:
  12526. * - peer_count
  12527. * Bits 31:16
  12528. * Purpose: Specify how many peer rate report elements are present in the payload.
  12529. * value:
  12530. *
  12531. * Payload:
  12532. * There are variant number of peer rate report follow the first 32 bits.
  12533. * The peer rate report is defined as follows.
  12534. *
  12535. * |31 20|19 16|15 0|
  12536. * |-----------------------+---------+---------------------------------|-
  12537. * | reserved | phy | peer_id | \
  12538. * |-------------------------------------------------------------------| -> report #0
  12539. * | rate | /
  12540. * |-----------------------+---------+---------------------------------|-
  12541. * | reserved | phy | peer_id | \
  12542. * |-------------------------------------------------------------------| -> report #1
  12543. * | rate | /
  12544. * |-----------------------+---------+---------------------------------|-
  12545. * | reserved | phy | peer_id | \
  12546. * |-------------------------------------------------------------------| -> report #2
  12547. * | rate | /
  12548. * |-------------------------------------------------------------------|-
  12549. * : :
  12550. * : :
  12551. * : :
  12552. * :-------------------------------------------------------------------:
  12553. *
  12554. * - peer_id
  12555. * Bits 15:0
  12556. * Purpose: identify the peer
  12557. * value:
  12558. * - phy
  12559. * Bits 19:16
  12560. * Purpose: identify which phy is in use
  12561. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  12562. * Please see enum htt_peer_report_phy_type for detail.
  12563. * - reserved
  12564. * Bits 31:20
  12565. * Purpose:
  12566. * value:
  12567. * - rate
  12568. * Bits 31:0
  12569. * Purpose: represent the justified rate of the peer specified by peer_id
  12570. * value:
  12571. */
  12572. enum htt_peer_rate_report_phy_type {
  12573. HTT_PEER_RATE_REPORT_11B = 0,
  12574. HTT_PEER_RATE_REPORT_11A_G,
  12575. HTT_PEER_RATE_REPORT_11N,
  12576. HTT_PEER_RATE_REPORT_11AC,
  12577. };
  12578. #define HTT_PEER_RATE_REPORT_SIZE 8
  12579. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  12580. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  12581. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  12582. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  12583. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  12584. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  12585. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  12586. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  12587. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  12588. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  12589. do { \
  12590. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  12591. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  12592. } while (0)
  12593. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  12594. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  12595. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  12596. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  12597. do { \
  12598. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  12599. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  12600. } while (0)
  12601. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  12602. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  12603. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  12604. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  12605. do { \
  12606. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  12607. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  12608. } while (0)
  12609. /**
  12610. * @brief target -> host flow pool map message
  12611. *
  12612. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  12613. *
  12614. * @details
  12615. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  12616. * a flow of descriptors.
  12617. *
  12618. * This message is in TLV format and indicates the parameters to be setup a
  12619. * flow in the host. Each entry indicates that a particular flow ID is ready to
  12620. * receive descriptors from a specified pool.
  12621. *
  12622. * The message would appear as follows:
  12623. *
  12624. * |31 24|23 16|15 8|7 0|
  12625. * |----------------+----------------+----------------+----------------|
  12626. * header | reserved | num_flows | msg_type |
  12627. * |-------------------------------------------------------------------|
  12628. * | |
  12629. * : payload :
  12630. * | |
  12631. * |-------------------------------------------------------------------|
  12632. *
  12633. * The header field is one DWORD long and is interpreted as follows:
  12634. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  12635. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  12636. * this message
  12637. * b'16-31 - reserved: These bits are reserved for future use
  12638. *
  12639. * Payload:
  12640. * The payload would contain multiple objects of the following structure. Each
  12641. * object represents a flow.
  12642. *
  12643. * |31 24|23 16|15 8|7 0|
  12644. * |----------------+----------------+----------------+----------------|
  12645. * header | reserved | num_flows | msg_type |
  12646. * |-------------------------------------------------------------------|
  12647. * payload0| flow_type |
  12648. * |-------------------------------------------------------------------|
  12649. * | flow_id |
  12650. * |-------------------------------------------------------------------|
  12651. * | reserved0 | flow_pool_id |
  12652. * |-------------------------------------------------------------------|
  12653. * | reserved1 | flow_pool_size |
  12654. * |-------------------------------------------------------------------|
  12655. * | reserved2 |
  12656. * |-------------------------------------------------------------------|
  12657. * payload1| flow_type |
  12658. * |-------------------------------------------------------------------|
  12659. * | flow_id |
  12660. * |-------------------------------------------------------------------|
  12661. * | reserved0 | flow_pool_id |
  12662. * |-------------------------------------------------------------------|
  12663. * | reserved1 | flow_pool_size |
  12664. * |-------------------------------------------------------------------|
  12665. * | reserved2 |
  12666. * |-------------------------------------------------------------------|
  12667. * | . |
  12668. * | . |
  12669. * | . |
  12670. * |-------------------------------------------------------------------|
  12671. *
  12672. * Each payload is 5 DWORDS long and is interpreted as follows:
  12673. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  12674. * this flow is associated. It can be VDEV, peer,
  12675. * or tid (AC). Based on enum htt_flow_type.
  12676. *
  12677. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12678. * object. For flow_type vdev it is set to the
  12679. * vdevid, for peer it is peerid and for tid, it is
  12680. * tid_num.
  12681. *
  12682. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  12683. * in the host for this flow
  12684. * b'16:31 - reserved0: This field in reserved for the future. In case
  12685. * we have a hierarchical implementation (HCM) of
  12686. * pools, it can be used to indicate the ID of the
  12687. * parent-pool.
  12688. *
  12689. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  12690. * Descriptors for this flow will be
  12691. * allocated from this pool in the host.
  12692. * b'16:31 - reserved1: This field in reserved for the future. In case
  12693. * we have a hierarchical implementation of pools,
  12694. * it can be used to indicate the max number of
  12695. * descriptors in the pool. The b'0:15 can be used
  12696. * to indicate min number of descriptors in the
  12697. * HCM scheme.
  12698. *
  12699. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  12700. * we have a hierarchical implementation of pools,
  12701. * b'0:15 can be used to indicate the
  12702. * priority-based borrowing (PBB) threshold of
  12703. * the flow's pool. The b'16:31 are still left
  12704. * reserved.
  12705. */
  12706. enum htt_flow_type {
  12707. FLOW_TYPE_VDEV = 0,
  12708. /* Insert new flow types above this line */
  12709. };
  12710. PREPACK struct htt_flow_pool_map_payload_t {
  12711. A_UINT32 flow_type;
  12712. A_UINT32 flow_id;
  12713. A_UINT32 flow_pool_id:16,
  12714. reserved0:16;
  12715. A_UINT32 flow_pool_size:16,
  12716. reserved1:16;
  12717. A_UINT32 reserved2;
  12718. } POSTPACK;
  12719. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  12720. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  12721. (sizeof(struct htt_flow_pool_map_payload_t))
  12722. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  12723. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  12724. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  12725. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  12726. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  12727. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  12728. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  12729. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  12730. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  12731. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  12732. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  12733. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  12734. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  12735. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  12736. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  12737. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  12738. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  12739. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  12740. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  12741. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  12742. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  12743. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  12744. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  12745. do { \
  12746. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  12747. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  12748. } while (0)
  12749. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  12750. do { \
  12751. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  12752. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  12753. } while (0)
  12754. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  12755. do { \
  12756. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  12757. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  12758. } while (0)
  12759. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  12760. do { \
  12761. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  12762. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  12763. } while (0)
  12764. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  12765. do { \
  12766. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  12767. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  12768. } while (0)
  12769. /**
  12770. * @brief target -> host flow pool unmap message
  12771. *
  12772. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  12773. *
  12774. * @details
  12775. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  12776. * down a flow of descriptors.
  12777. * This message indicates that for the flow (whose ID is provided) is wanting
  12778. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  12779. * pool of descriptors from where descriptors are being allocated for this
  12780. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  12781. * be unmapped by the host.
  12782. *
  12783. * The message would appear as follows:
  12784. *
  12785. * |31 24|23 16|15 8|7 0|
  12786. * |----------------+----------------+----------------+----------------|
  12787. * | reserved0 | msg_type |
  12788. * |-------------------------------------------------------------------|
  12789. * | flow_type |
  12790. * |-------------------------------------------------------------------|
  12791. * | flow_id |
  12792. * |-------------------------------------------------------------------|
  12793. * | reserved1 | flow_pool_id |
  12794. * |-------------------------------------------------------------------|
  12795. *
  12796. * The message is interpreted as follows:
  12797. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  12798. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  12799. * b'8:31 - reserved0: Reserved for future use
  12800. *
  12801. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  12802. * this flow is associated. It can be VDEV, peer,
  12803. * or tid (AC). Based on enum htt_flow_type.
  12804. *
  12805. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12806. * object. For flow_type vdev it is set to the
  12807. * vdevid, for peer it is peerid and for tid, it is
  12808. * tid_num.
  12809. *
  12810. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  12811. * used in the host for this flow
  12812. * b'16:31 - reserved0: This field in reserved for the future.
  12813. *
  12814. */
  12815. PREPACK struct htt_flow_pool_unmap_t {
  12816. A_UINT32 msg_type:8,
  12817. reserved0:24;
  12818. A_UINT32 flow_type;
  12819. A_UINT32 flow_id;
  12820. A_UINT32 flow_pool_id:16,
  12821. reserved1:16;
  12822. } POSTPACK;
  12823. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  12824. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  12825. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  12826. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  12827. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  12828. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  12829. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  12830. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  12831. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  12832. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  12833. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  12834. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  12835. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  12836. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  12837. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  12838. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  12839. do { \
  12840. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  12841. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  12842. } while (0)
  12843. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  12844. do { \
  12845. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  12846. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  12847. } while (0)
  12848. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  12849. do { \
  12850. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  12851. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  12852. } while (0)
  12853. /**
  12854. * @brief target -> host SRING setup done message
  12855. *
  12856. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  12857. *
  12858. * @details
  12859. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  12860. * SRNG ring setup is done
  12861. *
  12862. * This message indicates whether the last setup operation is successful.
  12863. * It will be sent to host when host set respose_required bit in
  12864. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  12865. * The message would appear as follows:
  12866. *
  12867. * |31 24|23 16|15 8|7 0|
  12868. * |--------------- +----------------+----------------+----------------|
  12869. * | setup_status | ring_id | pdev_id | msg_type |
  12870. * |-------------------------------------------------------------------|
  12871. *
  12872. * The message is interpreted as follows:
  12873. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  12874. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  12875. * b'8:15 - pdev_id:
  12876. * 0 (for rings at SOC/UMAC level),
  12877. * 1/2/3 mac id (for rings at LMAC level)
  12878. * b'16:23 - ring_id: Identify the ring which is set up
  12879. * More details can be got from enum htt_srng_ring_id
  12880. * b'24:31 - setup_status: Indicate status of setup operation
  12881. * Refer to htt_ring_setup_status
  12882. */
  12883. PREPACK struct htt_sring_setup_done_t {
  12884. A_UINT32 msg_type: 8,
  12885. pdev_id: 8,
  12886. ring_id: 8,
  12887. setup_status: 8;
  12888. } POSTPACK;
  12889. enum htt_ring_setup_status {
  12890. htt_ring_setup_status_ok = 0,
  12891. htt_ring_setup_status_error,
  12892. };
  12893. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  12894. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  12895. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  12896. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  12897. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  12898. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  12899. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  12900. do { \
  12901. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  12902. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12903. } while (0)
  12904. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  12905. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  12906. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  12907. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  12908. HTT_SRING_SETUP_DONE_RING_ID_S)
  12909. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  12910. do { \
  12911. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  12912. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  12913. } while (0)
  12914. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  12915. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  12916. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  12917. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  12918. HTT_SRING_SETUP_DONE_STATUS_S)
  12919. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  12920. do { \
  12921. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  12922. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  12923. } while (0)
  12924. /**
  12925. * @brief target -> flow map flow info
  12926. *
  12927. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  12928. *
  12929. * @details
  12930. * HTT TX map flow entry with tqm flow pointer
  12931. * Sent from firmware to host to add tqm flow pointer in corresponding
  12932. * flow search entry. Flow metadata is replayed back to host as part of this
  12933. * struct to enable host to find the specific flow search entry
  12934. *
  12935. * The message would appear as follows:
  12936. *
  12937. * |31 28|27 18|17 14|13 8|7 0|
  12938. * |-------+------------------------------------------+----------------|
  12939. * | rsvd0 | fse_hsh_idx | msg_type |
  12940. * |-------------------------------------------------------------------|
  12941. * | rsvd1 | tid | peer_id |
  12942. * |-------------------------------------------------------------------|
  12943. * | tqm_flow_pntr_lo |
  12944. * |-------------------------------------------------------------------|
  12945. * | tqm_flow_pntr_hi |
  12946. * |-------------------------------------------------------------------|
  12947. * | fse_meta_data |
  12948. * |-------------------------------------------------------------------|
  12949. *
  12950. * The message is interpreted as follows:
  12951. *
  12952. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  12953. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  12954. *
  12955. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  12956. * for this flow entry
  12957. *
  12958. * dword0 - b'28:31 - rsvd0: Reserved for future use
  12959. *
  12960. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  12961. *
  12962. * dword1 - b'14:17 - tid
  12963. *
  12964. * dword1 - b'18:31 - rsvd1: Reserved for future use
  12965. *
  12966. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  12967. *
  12968. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  12969. *
  12970. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  12971. * given by host
  12972. */
  12973. PREPACK struct htt_tx_map_flow_info {
  12974. A_UINT32
  12975. msg_type: 8,
  12976. fse_hsh_idx: 20,
  12977. rsvd0: 4;
  12978. A_UINT32
  12979. peer_id: 14,
  12980. tid: 4,
  12981. rsvd1: 14;
  12982. A_UINT32 tqm_flow_pntr_lo;
  12983. A_UINT32 tqm_flow_pntr_hi;
  12984. struct htt_tx_flow_metadata fse_meta_data;
  12985. } POSTPACK;
  12986. /* DWORD 0 */
  12987. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  12988. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  12989. /* DWORD 1 */
  12990. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  12991. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  12992. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  12993. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  12994. /* DWORD 0 */
  12995. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  12996. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  12997. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  12998. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  12999. do { \
  13000. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13001. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13002. } while (0)
  13003. /* DWORD 1 */
  13004. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13005. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13006. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13007. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13008. do { \
  13009. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13010. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13011. } while (0)
  13012. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13013. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13014. HTT_TX_MAP_FLOW_INFO_TID_S)
  13015. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13016. do { \
  13017. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13018. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13019. } while (0)
  13020. /*
  13021. * htt_dbg_ext_stats_status -
  13022. * present - The requested stats have been delivered in full.
  13023. * This indicates that either the stats information was contained
  13024. * in its entirety within this message, or else this message
  13025. * completes the delivery of the requested stats info that was
  13026. * partially delivered through earlier STATS_CONF messages.
  13027. * partial - The requested stats have been delivered in part.
  13028. * One or more subsequent STATS_CONF messages with the same
  13029. * cookie value will be sent to deliver the remainder of the
  13030. * information.
  13031. * error - The requested stats could not be delivered, for example due
  13032. * to a shortage of memory to construct a message holding the
  13033. * requested stats.
  13034. * invalid - The requested stat type is either not recognized, or the
  13035. * target is configured to not gather the stats type in question.
  13036. */
  13037. enum htt_dbg_ext_stats_status {
  13038. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13039. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13040. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13041. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13042. };
  13043. /**
  13044. * @brief target -> host ppdu stats upload
  13045. *
  13046. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13047. *
  13048. * @details
  13049. * The following field definitions describe the format of the HTT target
  13050. * to host ppdu stats indication message.
  13051. *
  13052. *
  13053. * |31 16|15 12|11 10|9 8|7 0 |
  13054. * |----------------------------------------------------------------------|
  13055. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13056. * |----------------------------------------------------------------------|
  13057. * | ppdu_id |
  13058. * |----------------------------------------------------------------------|
  13059. * | Timestamp in us |
  13060. * |----------------------------------------------------------------------|
  13061. * | reserved |
  13062. * |----------------------------------------------------------------------|
  13063. * | type-specific stats info |
  13064. * | (see htt_ppdu_stats.h) |
  13065. * |----------------------------------------------------------------------|
  13066. * Header fields:
  13067. * - MSG_TYPE
  13068. * Bits 7:0
  13069. * Purpose: Identifies this is a PPDU STATS indication
  13070. * message.
  13071. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13072. * - mac_id
  13073. * Bits 9:8
  13074. * Purpose: mac_id of this ppdu_id
  13075. * Value: 0-3
  13076. * - pdev_id
  13077. * Bits 11:10
  13078. * Purpose: pdev_id of this ppdu_id
  13079. * Value: 0-3
  13080. * 0 (for rings at SOC level),
  13081. * 1/2/3 PDEV -> 0/1/2
  13082. * - payload_size
  13083. * Bits 31:16
  13084. * Purpose: total tlv size
  13085. * Value: payload_size in bytes
  13086. */
  13087. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13088. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13089. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13090. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13091. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13092. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13093. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13094. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13095. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13096. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13097. do { \
  13098. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13099. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13100. } while (0)
  13101. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13102. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13103. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13104. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13105. do { \
  13106. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13107. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13108. } while (0)
  13109. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13110. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13111. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13112. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13113. do { \
  13114. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13115. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13116. } while (0)
  13117. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13118. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13119. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13120. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13121. do { \
  13122. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13123. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13124. } while (0)
  13125. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13126. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13127. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13128. /* htt_t2h_ppdu_stats_ind_hdr_t
  13129. * This struct contains the fields within the header of the
  13130. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13131. * stats info.
  13132. * This struct assumes little-endian layout, and thus is only
  13133. * suitable for use within processors known to be little-endian
  13134. * (such as the target).
  13135. * In contrast, the above macros provide endian-portable methods
  13136. * to get and set the bitfields within this PPDU_STATS_IND header.
  13137. */
  13138. typedef struct {
  13139. A_UINT32 msg_type: 8, /* bits 7:0 */
  13140. mac_id: 2, /* bits 9:8 */
  13141. pdev_id: 2, /* bits 11:10 */
  13142. reserved1: 4, /* bits 15:12 */
  13143. payload_size: 16; /* bits 31:16 */
  13144. A_UINT32 ppdu_id;
  13145. A_UINT32 timestamp_us;
  13146. A_UINT32 reserved2;
  13147. } htt_t2h_ppdu_stats_ind_hdr_t;
  13148. /**
  13149. * @brief target -> host extended statistics upload
  13150. *
  13151. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  13152. *
  13153. * @details
  13154. * The following field definitions describe the format of the HTT target
  13155. * to host stats upload confirmation message.
  13156. * The message contains a cookie echoed from the HTT host->target stats
  13157. * upload request, which identifies which request the confirmation is
  13158. * for, and a single stats can span over multiple HTT stats indication
  13159. * due to the HTT message size limitation so every HTT ext stats indication
  13160. * will have tag-length-value stats information elements.
  13161. * The tag-length header for each HTT stats IND message also includes a
  13162. * status field, to indicate whether the request for the stat type in
  13163. * question was fully met, partially met, unable to be met, or invalid
  13164. * (if the stat type in question is disabled in the target).
  13165. * A Done bit 1's indicate the end of the of stats info elements.
  13166. *
  13167. *
  13168. * |31 16|15 12|11|10 8|7 5|4 0|
  13169. * |--------------------------------------------------------------|
  13170. * | reserved | msg type |
  13171. * |--------------------------------------------------------------|
  13172. * | cookie LSBs |
  13173. * |--------------------------------------------------------------|
  13174. * | cookie MSBs |
  13175. * |--------------------------------------------------------------|
  13176. * | stats entry length | rsvd | D| S | stat type |
  13177. * |--------------------------------------------------------------|
  13178. * | type-specific stats info |
  13179. * | (see htt_stats.h) |
  13180. * |--------------------------------------------------------------|
  13181. * Header fields:
  13182. * - MSG_TYPE
  13183. * Bits 7:0
  13184. * Purpose: Identifies this is a extended statistics upload confirmation
  13185. * message.
  13186. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  13187. * - COOKIE_LSBS
  13188. * Bits 31:0
  13189. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13190. * message with its preceding host->target stats request message.
  13191. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13192. * - COOKIE_MSBS
  13193. * Bits 31:0
  13194. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13195. * message with its preceding host->target stats request message.
  13196. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13197. *
  13198. * Stats Information Element tag-length header fields:
  13199. * - STAT_TYPE
  13200. * Bits 7:0
  13201. * Purpose: identifies the type of statistics info held in the
  13202. * following information element
  13203. * Value: htt_dbg_ext_stats_type
  13204. * - STATUS
  13205. * Bits 10:8
  13206. * Purpose: indicate whether the requested stats are present
  13207. * Value: htt_dbg_ext_stats_status
  13208. * - DONE
  13209. * Bits 11
  13210. * Purpose:
  13211. * Indicates the completion of the stats entry, this will be the last
  13212. * stats conf HTT segment for the requested stats type.
  13213. * Value:
  13214. * 0 -> the stats retrieval is ongoing
  13215. * 1 -> the stats retrieval is complete
  13216. * - LENGTH
  13217. * Bits 31:16
  13218. * Purpose: indicate the stats information size
  13219. * Value: This field specifies the number of bytes of stats information
  13220. * that follows the element tag-length header.
  13221. * It is expected but not required that this length is a multiple of
  13222. * 4 bytes.
  13223. */
  13224. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  13225. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  13226. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  13227. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  13228. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  13229. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  13230. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  13231. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  13232. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  13233. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13234. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  13235. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  13236. do { \
  13237. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  13238. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  13239. } while (0)
  13240. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  13241. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  13242. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  13243. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  13244. do { \
  13245. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  13246. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  13247. } while (0)
  13248. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  13249. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  13250. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  13251. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  13252. do { \
  13253. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  13254. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  13255. } while (0)
  13256. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  13257. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  13258. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  13259. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13260. do { \
  13261. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  13262. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  13263. } while (0)
  13264. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  13265. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  13266. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  13267. typedef enum {
  13268. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  13269. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  13270. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  13271. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  13272. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  13273. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  13274. /* Reserved from 128 - 255 for target internal use.*/
  13275. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  13276. } HTT_PEER_TYPE;
  13277. /** macro to convert MAC address from char array to HTT word format */
  13278. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  13279. (phtt_mac_addr)->mac_addr31to0 = \
  13280. (((c_macaddr)[0] << 0) | \
  13281. ((c_macaddr)[1] << 8) | \
  13282. ((c_macaddr)[2] << 16) | \
  13283. ((c_macaddr)[3] << 24)); \
  13284. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  13285. } while (0)
  13286. /**
  13287. * @brief target -> host monitor mac header indication message
  13288. *
  13289. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  13290. *
  13291. * @details
  13292. * The following diagram shows the format of the monitor mac header message
  13293. * sent from the target to the host.
  13294. * This message is primarily sent when promiscuous rx mode is enabled.
  13295. * One message is sent per rx PPDU.
  13296. *
  13297. * |31 24|23 16|15 8|7 0|
  13298. * |-------------------------------------------------------------|
  13299. * | peer_id | reserved0 | msg_type |
  13300. * |-------------------------------------------------------------|
  13301. * | reserved1 | num_mpdu |
  13302. * |-------------------------------------------------------------|
  13303. * | struct hw_rx_desc |
  13304. * | (see wal_rx_desc.h) |
  13305. * |-------------------------------------------------------------|
  13306. * | struct ieee80211_frame_addr4 |
  13307. * | (see ieee80211_defs.h) |
  13308. * |-------------------------------------------------------------|
  13309. * | struct ieee80211_frame_addr4 |
  13310. * | (see ieee80211_defs.h) |
  13311. * |-------------------------------------------------------------|
  13312. * | ...... |
  13313. * |-------------------------------------------------------------|
  13314. *
  13315. * Header fields:
  13316. * - msg_type
  13317. * Bits 7:0
  13318. * Purpose: Identifies this is a monitor mac header indication message.
  13319. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  13320. * - peer_id
  13321. * Bits 31:16
  13322. * Purpose: Software peer id given by host during association,
  13323. * During promiscuous mode, the peer ID will be invalid (0xFF)
  13324. * for rx PPDUs received from unassociated peers.
  13325. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  13326. * - num_mpdu
  13327. * Bits 15:0
  13328. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  13329. * delivered within the message.
  13330. * Value: 1 to 32
  13331. * num_mpdu is limited to a maximum value of 32, due to buffer
  13332. * size limits. For PPDUs with more than 32 MPDUs, only the
  13333. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  13334. * the PPDU will be provided.
  13335. */
  13336. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  13337. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  13338. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  13339. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  13340. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  13341. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  13342. do { \
  13343. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  13344. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  13345. } while (0)
  13346. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  13347. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  13348. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  13349. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  13350. do { \
  13351. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  13352. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  13353. } while (0)
  13354. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  13355. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  13356. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  13357. /**
  13358. * @brief target -> host flow pool resize Message
  13359. *
  13360. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  13361. *
  13362. * @details
  13363. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  13364. * the flow pool associated with the specified ID is resized
  13365. *
  13366. * The message would appear as follows:
  13367. *
  13368. * |31 16|15 8|7 0|
  13369. * |---------------------------------+----------------+----------------|
  13370. * | reserved0 | Msg type |
  13371. * |-------------------------------------------------------------------|
  13372. * | flow pool new size | flow pool ID |
  13373. * |-------------------------------------------------------------------|
  13374. *
  13375. * The message is interpreted as follows:
  13376. * b'0:7 - msg_type: This will be set to 0x21
  13377. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  13378. *
  13379. * b'0:15 - flow pool ID: Existing flow pool ID
  13380. *
  13381. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  13382. *
  13383. */
  13384. PREPACK struct htt_flow_pool_resize_t {
  13385. A_UINT32 msg_type:8,
  13386. reserved0:24;
  13387. A_UINT32 flow_pool_id:16,
  13388. flow_pool_new_size:16;
  13389. } POSTPACK;
  13390. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  13391. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  13392. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  13393. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  13394. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  13395. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  13396. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  13397. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  13398. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  13399. do { \
  13400. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  13401. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  13402. } while (0)
  13403. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  13404. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  13405. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  13406. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  13407. do { \
  13408. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  13409. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  13410. } while (0)
  13411. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  13412. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  13413. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  13414. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  13415. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  13416. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  13417. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  13418. /*
  13419. * The read and write indices point to the data within the host buffer.
  13420. * Because the first 4 bytes of the host buffer is used for the read index and
  13421. * the next 4 bytes for the write index, the data itself starts at offset 8.
  13422. * The read index and write index are the byte offsets from the base of the
  13423. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  13424. * Refer the ASCII text picture below.
  13425. */
  13426. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  13427. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  13428. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  13429. /*
  13430. ***************************************************************************
  13431. *
  13432. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13433. *
  13434. ***************************************************************************
  13435. *
  13436. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  13437. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  13438. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  13439. * written into the Host memory region mentioned below.
  13440. *
  13441. * Read index is updated by the Host. At any point of time, the read index will
  13442. * indicate the index that will next be read by the Host. The read index is
  13443. * in units of bytes offset from the base of the meta-data buffer.
  13444. *
  13445. * Write index is updated by the FW. At any point of time, the write index will
  13446. * indicate from where the FW can start writing any new data. The write index is
  13447. * in units of bytes offset from the base of the meta-data buffer.
  13448. *
  13449. * If the Host is not fast enough in reading the CFR data, any new capture data
  13450. * would be dropped if there is no space left to write the new captures.
  13451. *
  13452. * The last 4 bytes of the memory region will have the magic pattern
  13453. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  13454. * not overrun the host buffer.
  13455. *
  13456. * ,--------------------. read and write indices store the
  13457. * | | byte offset from the base of the
  13458. * | ,--------+--------. meta-data buffer to the next
  13459. * | | | | location within the data buffer
  13460. * | | v v that will be read / written
  13461. * ************************************************************************
  13462. * * Read * Write * * Magic *
  13463. * * index * index * CFR data1 ...... CFR data N * pattern *
  13464. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  13465. * ************************************************************************
  13466. * |<---------- data buffer ---------->|
  13467. *
  13468. * |<----------------- meta-data buffer allocated in Host ----------------|
  13469. *
  13470. * Note:
  13471. * - Considering the 4 bytes needed to store the Read index (R) and the
  13472. * Write index (W), the initial value is as follows:
  13473. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  13474. * - Buffer empty condition:
  13475. * R = W
  13476. *
  13477. * Regarding CFR data format:
  13478. * --------------------------
  13479. *
  13480. * Each CFR tone is stored in HW as 16-bits with the following format:
  13481. * {bits[15:12], bits[11:6], bits[5:0]} =
  13482. * {unsigned exponent (4 bits),
  13483. * signed mantissa_real (6 bits),
  13484. * signed mantissa_imag (6 bits)}
  13485. *
  13486. * CFR_real = mantissa_real * 2^(exponent-5)
  13487. * CFR_imag = mantissa_imag * 2^(exponent-5)
  13488. *
  13489. *
  13490. * The CFR data is written to the 16-bit unsigned output array (buff) in
  13491. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  13492. *
  13493. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  13494. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  13495. * .
  13496. * .
  13497. * .
  13498. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  13499. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  13500. */
  13501. /* Bandwidth of peer CFR captures */
  13502. typedef enum {
  13503. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  13504. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  13505. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  13506. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  13507. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  13508. HTT_PEER_CFR_CAPTURE_BW_MAX,
  13509. } HTT_PEER_CFR_CAPTURE_BW;
  13510. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  13511. * was captured
  13512. */
  13513. typedef enum {
  13514. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  13515. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  13516. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  13517. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  13518. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  13519. } HTT_PEER_CFR_CAPTURE_MODE;
  13520. typedef enum {
  13521. /* This message type is currently used for the below purpose:
  13522. *
  13523. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  13524. * wmi_peer_cfr_capture_cmd.
  13525. * If payload_present bit is set to 0 then the associated memory region
  13526. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  13527. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  13528. * message; the CFR dump will be present at the end of the message,
  13529. * after the chan_phy_mode.
  13530. */
  13531. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  13532. /* Always keep this last */
  13533. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  13534. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  13535. /**
  13536. * @brief target -> host CFR dump completion indication message definition
  13537. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  13538. *
  13539. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  13540. *
  13541. * @details
  13542. * The following diagram shows the format of the Channel Frequency Response
  13543. * (CFR) dump completion indication. This inidcation is sent to the Host when
  13544. * the channel capture of a peer is copied by Firmware into the Host memory
  13545. *
  13546. * **************************************************************************
  13547. *
  13548. * Message format when the CFR capture message type is
  13549. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13550. *
  13551. * **************************************************************************
  13552. *
  13553. * |31 16|15 |8|7 0|
  13554. * |----------------------------------------------------------------|
  13555. * header: | reserved |P| msg_type |
  13556. * word 0 | | | |
  13557. * |----------------------------------------------------------------|
  13558. * payload: | cfr_capture_msg_type |
  13559. * word 1 | |
  13560. * |----------------------------------------------------------------|
  13561. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  13562. * word 2 | | | | | | | | |
  13563. * |----------------------------------------------------------------|
  13564. * | mac_addr31to0 |
  13565. * word 3 | |
  13566. * |----------------------------------------------------------------|
  13567. * | unused / reserved | mac_addr47to32 |
  13568. * word 4 | | |
  13569. * |----------------------------------------------------------------|
  13570. * | index |
  13571. * word 5 | |
  13572. * |----------------------------------------------------------------|
  13573. * | length |
  13574. * word 6 | |
  13575. * |----------------------------------------------------------------|
  13576. * | timestamp |
  13577. * word 7 | |
  13578. * |----------------------------------------------------------------|
  13579. * | counter |
  13580. * word 8 | |
  13581. * |----------------------------------------------------------------|
  13582. * | chan_mhz |
  13583. * word 9 | |
  13584. * |----------------------------------------------------------------|
  13585. * | band_center_freq1 |
  13586. * word 10 | |
  13587. * |----------------------------------------------------------------|
  13588. * | band_center_freq2 |
  13589. * word 11 | |
  13590. * |----------------------------------------------------------------|
  13591. * | chan_phy_mode |
  13592. * word 12 | |
  13593. * |----------------------------------------------------------------|
  13594. * where,
  13595. * P - payload present bit (payload_present explained below)
  13596. * req_id - memory request id (mem_req_id explained below)
  13597. * S - status field (status explained below)
  13598. * capbw - capture bandwidth (capture_bw explained below)
  13599. * mode - mode of capture (mode explained below)
  13600. * sts - space time streams (sts_count explained below)
  13601. * chbw - channel bandwidth (channel_bw explained below)
  13602. * captype - capture type (cap_type explained below)
  13603. *
  13604. * The following field definitions describe the format of the CFR dump
  13605. * completion indication sent from the target to the host
  13606. *
  13607. * Header fields:
  13608. *
  13609. * Word 0
  13610. * - msg_type
  13611. * Bits 7:0
  13612. * Purpose: Identifies this as CFR TX completion indication
  13613. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  13614. * - payload_present
  13615. * Bit 8
  13616. * Purpose: Identifies how CFR data is sent to host
  13617. * Value: 0 - If CFR Payload is written to host memory
  13618. * 1 - If CFR Payload is sent as part of HTT message
  13619. * (This is the requirement for SDIO/USB where it is
  13620. * not possible to write CFR data to host memory)
  13621. * - reserved
  13622. * Bits 31:9
  13623. * Purpose: Reserved
  13624. * Value: 0
  13625. *
  13626. * Payload fields:
  13627. *
  13628. * Word 1
  13629. * - cfr_capture_msg_type
  13630. * Bits 31:0
  13631. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  13632. * to specify the format used for the remainder of the message
  13633. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13634. * (currently only MSG_TYPE_1 is defined)
  13635. *
  13636. * Word 2
  13637. * - mem_req_id
  13638. * Bits 6:0
  13639. * Purpose: Contain the mem request id of the region where the CFR capture
  13640. * has been stored - of type WMI_HOST_MEM_REQ_ID
  13641. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  13642. this value is invalid)
  13643. * - status
  13644. * Bit 7
  13645. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  13646. * Value: 1 (True) - Successful; 0 (False) - Not successful
  13647. * - capture_bw
  13648. * Bits 10:8
  13649. * Purpose: Carry the bandwidth of the CFR capture
  13650. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  13651. * - mode
  13652. * Bits 13:11
  13653. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  13654. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  13655. * - sts_count
  13656. * Bits 16:14
  13657. * Purpose: Carry the number of space time streams
  13658. * Value: Number of space time streams
  13659. * - channel_bw
  13660. * Bits 19:17
  13661. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  13662. * measurement
  13663. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  13664. * - cap_type
  13665. * Bits 23:20
  13666. * Purpose: Carry the type of the capture
  13667. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  13668. * - vdev_id
  13669. * Bits 31:24
  13670. * Purpose: Carry the virtual device id
  13671. * Value: vdev ID
  13672. *
  13673. * Word 3
  13674. * - mac_addr31to0
  13675. * Bits 31:0
  13676. * Purpose: Contain the bits 31:0 of the peer MAC address
  13677. * Value: Bits 31:0 of the peer MAC address
  13678. *
  13679. * Word 4
  13680. * - mac_addr47to32
  13681. * Bits 15:0
  13682. * Purpose: Contain the bits 47:32 of the peer MAC address
  13683. * Value: Bits 47:32 of the peer MAC address
  13684. *
  13685. * Word 5
  13686. * - index
  13687. * Bits 31:0
  13688. * Purpose: Contain the index at which this CFR dump was written in the Host
  13689. * allocated memory. This index is the number of bytes from the base address.
  13690. * Value: Index position
  13691. *
  13692. * Word 6
  13693. * - length
  13694. * Bits 31:0
  13695. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  13696. * Value: Length of the CFR capture of the peer
  13697. *
  13698. * Word 7
  13699. * - timestamp
  13700. * Bits 31:0
  13701. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  13702. * clock used for this timestamp is private to the target and not visible to
  13703. * the host i.e., Host can interpret only the relative timestamp deltas from
  13704. * one message to the next, but can't interpret the absolute timestamp from a
  13705. * single message.
  13706. * Value: Timestamp in microseconds
  13707. *
  13708. * Word 8
  13709. * - counter
  13710. * Bits 31:0
  13711. * Purpose: Carry the count of the current CFR capture from FW. This is
  13712. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  13713. * in host memory)
  13714. * Value: Count of the current CFR capture
  13715. *
  13716. * Word 9
  13717. * - chan_mhz
  13718. * Bits 31:0
  13719. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  13720. * Value: Primary 20 channel frequency
  13721. *
  13722. * Word 10
  13723. * - band_center_freq1
  13724. * Bits 31:0
  13725. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  13726. * Value: Center frequency 1 in MHz
  13727. *
  13728. * Word 11
  13729. * - band_center_freq2
  13730. * Bits 31:0
  13731. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  13732. * the VDEV
  13733. * 80plus80 mode
  13734. * Value: Center frequency 2 in MHz
  13735. *
  13736. * Word 12
  13737. * - chan_phy_mode
  13738. * Bits 31:0
  13739. * Purpose: Carry the phy mode of the channel, of the VDEV
  13740. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  13741. */
  13742. PREPACK struct htt_cfr_dump_ind_type_1 {
  13743. A_UINT32 mem_req_id:7,
  13744. status:1,
  13745. capture_bw:3,
  13746. mode:3,
  13747. sts_count:3,
  13748. channel_bw:3,
  13749. cap_type:4,
  13750. vdev_id:8;
  13751. htt_mac_addr addr;
  13752. A_UINT32 index;
  13753. A_UINT32 length;
  13754. A_UINT32 timestamp;
  13755. A_UINT32 counter;
  13756. struct htt_chan_change_msg chan;
  13757. } POSTPACK;
  13758. PREPACK struct htt_cfr_dump_compl_ind {
  13759. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  13760. union {
  13761. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  13762. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  13763. /* If there is a need to change the memory layout and its associated
  13764. * HTT indication format, a new CFR capture message type can be
  13765. * introduced and added into this union.
  13766. */
  13767. };
  13768. } POSTPACK;
  13769. /*
  13770. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  13771. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13772. */
  13773. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  13774. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  13775. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  13776. do { \
  13777. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  13778. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  13779. } while(0)
  13780. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  13781. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  13782. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  13783. /*
  13784. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  13785. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13786. */
  13787. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  13788. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  13789. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  13790. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  13791. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  13792. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  13793. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  13794. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  13795. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  13796. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  13797. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  13798. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  13799. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  13800. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  13801. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  13802. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  13803. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  13804. do { \
  13805. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  13806. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  13807. } while (0)
  13808. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  13809. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  13810. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  13811. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  13812. do { \
  13813. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  13814. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  13815. } while (0)
  13816. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  13817. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  13818. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  13819. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  13820. do { \
  13821. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  13822. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  13823. } while (0)
  13824. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  13825. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  13826. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  13827. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  13828. do { \
  13829. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  13830. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  13831. } while (0)
  13832. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  13833. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  13834. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  13835. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  13836. do { \
  13837. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  13838. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  13839. } while (0)
  13840. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  13841. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  13842. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  13843. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  13844. do { \
  13845. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  13846. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  13847. } while (0)
  13848. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  13849. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  13850. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  13851. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  13852. do { \
  13853. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  13854. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  13855. } while (0)
  13856. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  13857. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  13858. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  13859. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  13860. do { \
  13861. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  13862. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  13863. } while (0)
  13864. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  13865. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  13866. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  13867. /**
  13868. * @brief target -> host peer (PPDU) stats message
  13869. *
  13870. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  13871. *
  13872. * @details
  13873. * This message is generated by FW when FW is sending stats to host
  13874. * about one or more PPDUs that the FW has transmitted to one or more peers.
  13875. * This message is sent autonomously by the target rather than upon request
  13876. * by the host.
  13877. * The following field definitions describe the format of the HTT target
  13878. * to host peer stats indication message.
  13879. *
  13880. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  13881. * or more PPDU stats records.
  13882. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  13883. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  13884. * then the message would start with the
  13885. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  13886. * below.
  13887. *
  13888. * |31 16|15|14|13 11|10 9|8|7 0|
  13889. * |-------------------------------------------------------------|
  13890. * | reserved |MSG_TYPE |
  13891. * |-------------------------------------------------------------|
  13892. * rec 0 | TLV header |
  13893. * rec 0 |-------------------------------------------------------------|
  13894. * rec 0 | ppdu successful bytes |
  13895. * rec 0 |-------------------------------------------------------------|
  13896. * rec 0 | ppdu retry bytes |
  13897. * rec 0 |-------------------------------------------------------------|
  13898. * rec 0 | ppdu failed bytes |
  13899. * rec 0 |-------------------------------------------------------------|
  13900. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  13901. * rec 0 |-------------------------------------------------------------|
  13902. * rec 0 | retried MSDUs | successful MSDUs |
  13903. * rec 0 |-------------------------------------------------------------|
  13904. * rec 0 | TX duration | failed MSDUs |
  13905. * rec 0 |-------------------------------------------------------------|
  13906. * ...
  13907. * |-------------------------------------------------------------|
  13908. * rec N | TLV header |
  13909. * rec N |-------------------------------------------------------------|
  13910. * rec N | ppdu successful bytes |
  13911. * rec N |-------------------------------------------------------------|
  13912. * rec N | ppdu retry bytes |
  13913. * rec N |-------------------------------------------------------------|
  13914. * rec N | ppdu failed bytes |
  13915. * rec N |-------------------------------------------------------------|
  13916. * rec N | peer id | S|SG| BW | BA |A|rate code|
  13917. * rec N |-------------------------------------------------------------|
  13918. * rec N | retried MSDUs | successful MSDUs |
  13919. * rec N |-------------------------------------------------------------|
  13920. * rec N | TX duration | failed MSDUs |
  13921. * rec N |-------------------------------------------------------------|
  13922. *
  13923. * where:
  13924. * A = is A-MPDU flag
  13925. * BA = block-ack failure flags
  13926. * BW = bandwidth spec
  13927. * SG = SGI enabled spec
  13928. * S = skipped rate ctrl
  13929. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  13930. *
  13931. * Header
  13932. * ------
  13933. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  13934. * dword0 - b'8:31 - reserved : Reserved for future use
  13935. *
  13936. * payload include below peer_stats information
  13937. * --------------------------------------------
  13938. * @TLV : HTT_PPDU_STATS_INFO_TLV
  13939. * @tx_success_bytes : total successful bytes in the PPDU.
  13940. * @tx_retry_bytes : total retried bytes in the PPDU.
  13941. * @tx_failed_bytes : total failed bytes in the PPDU.
  13942. * @tx_ratecode : rate code used for the PPDU.
  13943. * @is_ampdu : Indicates PPDU is AMPDU or not.
  13944. * @ba_ack_failed : BA/ACK failed for this PPDU
  13945. * b00 -> BA received
  13946. * b01 -> BA failed once
  13947. * b10 -> BA failed twice, when HW retry is enabled.
  13948. * @bw : BW
  13949. * b00 -> 20 MHz
  13950. * b01 -> 40 MHz
  13951. * b10 -> 80 MHz
  13952. * b11 -> 160 MHz (or 80+80)
  13953. * @sg : SGI enabled
  13954. * @s : skipped ratectrl
  13955. * @peer_id : peer id
  13956. * @tx_success_msdus : successful MSDUs
  13957. * @tx_retry_msdus : retried MSDUs
  13958. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  13959. * @tx_duration : Tx duration for the PPDU (microsecond units)
  13960. */
  13961. /**
  13962. * @brief target -> host backpressure event
  13963. *
  13964. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  13965. *
  13966. * @details
  13967. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  13968. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  13969. * This message will only be sent if the backpressure condition has existed
  13970. * continuously for an initial period (100 ms).
  13971. * Repeat messages with updated information will be sent after each
  13972. * subsequent period (100 ms) as long as the backpressure remains unabated.
  13973. * This message indicates the ring id along with current head and tail index
  13974. * locations (i.e. write and read indices).
  13975. * The backpressure time indicates the time in ms for which continous
  13976. * backpressure has been observed in the ring.
  13977. *
  13978. * The message format is as follows:
  13979. *
  13980. * |31 24|23 16|15 8|7 0|
  13981. * |----------------+----------------+----------------+----------------|
  13982. * | ring_id | ring_type | pdev_id | msg_type |
  13983. * |-------------------------------------------------------------------|
  13984. * | tail_idx | head_idx |
  13985. * |-------------------------------------------------------------------|
  13986. * | backpressure_time_ms |
  13987. * |-------------------------------------------------------------------|
  13988. *
  13989. * The message is interpreted as follows:
  13990. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  13991. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  13992. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  13993. * 1, 2, 3 indicates pdev_id 0,1,2 and
  13994. the msg is for LMAC ring.
  13995. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  13996. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  13997. * htt_backpressure_lmac_ring_id. This represents
  13998. * the ring id for which continous backpressure is seen
  13999. *
  14000. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14001. * the ring indicated by the ring_id
  14002. *
  14003. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14004. * the ring indicated by the ring id
  14005. *
  14006. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14007. * backpressure has been seen in the ring
  14008. * indicated by the ring_id.
  14009. * Units = milliseconds
  14010. */
  14011. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14012. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14013. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14014. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14015. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14016. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14017. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14018. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14019. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14020. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14021. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14022. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14023. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14024. do { \
  14025. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14026. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14027. } while (0)
  14028. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14029. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14030. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14031. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14032. do { \
  14033. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14034. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14035. } while (0)
  14036. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14037. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14038. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14039. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14040. do { \
  14041. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14042. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14043. } while (0)
  14044. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14045. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14046. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14047. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14048. do { \
  14049. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14050. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14051. } while (0)
  14052. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14053. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14054. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14055. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14056. do { \
  14057. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14058. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14059. } while (0)
  14060. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14061. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14062. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14063. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14064. do { \
  14065. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14066. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14067. } while (0)
  14068. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14069. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14070. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14071. enum htt_backpressure_ring_type {
  14072. HTT_SW_RING_TYPE_UMAC,
  14073. HTT_SW_RING_TYPE_LMAC,
  14074. HTT_SW_RING_TYPE_MAX,
  14075. };
  14076. /* Ring id for which the message is sent to host */
  14077. enum htt_backpressure_umac_ringid {
  14078. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14079. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14080. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14081. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14082. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14083. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14084. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14085. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14086. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14087. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14088. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14089. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14090. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14091. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14092. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14093. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14094. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14095. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14096. HTT_SW_UMAC_RING_IDX_MAX,
  14097. };
  14098. enum htt_backpressure_lmac_ringid {
  14099. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14100. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14101. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14102. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14103. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14104. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14105. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14106. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14107. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14108. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14109. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14110. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14111. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14112. HTT_SW_LMAC_RING_IDX_MAX,
  14113. };
  14114. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14115. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14116. pdev_id: 8,
  14117. ring_type: 8, /* htt_backpressure_ring_type */
  14118. /*
  14119. * ring_id holds an enum value from either
  14120. * htt_backpressure_umac_ringid or
  14121. * htt_backpressure_lmac_ringid, based on
  14122. * the ring_type setting.
  14123. */
  14124. ring_id: 8;
  14125. A_UINT16 head_idx;
  14126. A_UINT16 tail_idx;
  14127. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14128. } POSTPACK;
  14129. /*
  14130. * Defines two 32 bit words that can be used by the target to indicate a per
  14131. * user RU allocation and rate information.
  14132. *
  14133. * This information is currently provided in the "sw_response_reference_ptr"
  14134. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14135. * "rx_ppdu_end_user_stats" TLV.
  14136. *
  14137. * VALID:
  14138. * The consumer of these words must explicitly check the valid bit,
  14139. * and only attempt interpretation of any of the remaining fields if
  14140. * the valid bit is set to 1.
  14141. *
  14142. * VERSION:
  14143. * The consumer of these words must also explicitly check the version bit,
  14144. * and only use the V0 definition if the VERSION field is set to 0.
  14145. *
  14146. * Version 1 is currently undefined, with the exception of the VALID and
  14147. * VERSION fields.
  14148. *
  14149. * Version 0:
  14150. *
  14151. * The fields below are duplicated per BW.
  14152. *
  14153. * The consumer must determine which BW field to use, based on the UL OFDMA
  14154. * PPDU BW indicated by HW.
  14155. *
  14156. * RU_START: RU26 start index for the user.
  14157. * Note that this is always using the RU26 index, regardless
  14158. * of the actual RU assigned to the user
  14159. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  14160. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  14161. *
  14162. * For example, 20MHz (the value in the top row is RU_START)
  14163. *
  14164. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  14165. * RU Size 1 (52): | | | | | |
  14166. * RU Size 2 (106): | | | |
  14167. * RU Size 3 (242): | |
  14168. *
  14169. * RU_SIZE: Indicates the RU size, as defined by enum
  14170. * htt_ul_ofdma_user_info_ru_size.
  14171. *
  14172. * LDPC: LDPC enabled (if 0, BCC is used)
  14173. *
  14174. * DCM: DCM enabled
  14175. *
  14176. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  14177. * |---------------------------------+--------------------------------|
  14178. * |Ver|Valid| FW internal |
  14179. * |---------------------------------+--------------------------------|
  14180. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  14181. * |---------------------------------+--------------------------------|
  14182. */
  14183. enum htt_ul_ofdma_user_info_ru_size {
  14184. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  14185. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  14186. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  14187. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  14188. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  14189. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  14190. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  14191. };
  14192. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  14193. struct htt_ul_ofdma_user_info_v0 {
  14194. A_UINT32 word0;
  14195. A_UINT32 word1;
  14196. };
  14197. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  14198. A_UINT32 w0_fw_rsvd:30; \
  14199. A_UINT32 w0_valid:1; \
  14200. A_UINT32 w0_version:1;
  14201. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  14202. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14203. };
  14204. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  14205. A_UINT32 w1_nss:3; \
  14206. A_UINT32 w1_mcs:4; \
  14207. A_UINT32 w1_ldpc:1; \
  14208. A_UINT32 w1_dcm:1; \
  14209. A_UINT32 w1_ru_start:7; \
  14210. A_UINT32 w1_ru_size:3; \
  14211. A_UINT32 w1_trig_type:4; \
  14212. A_UINT32 w1_unused:9;
  14213. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  14214. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14215. };
  14216. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  14217. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  14218. union {
  14219. A_UINT32 word0;
  14220. struct {
  14221. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14222. };
  14223. };
  14224. union {
  14225. A_UINT32 word1;
  14226. struct {
  14227. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14228. };
  14229. };
  14230. } POSTPACK;
  14231. enum HTT_UL_OFDMA_TRIG_TYPE {
  14232. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  14233. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  14234. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  14235. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  14236. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  14237. };
  14238. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  14239. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  14240. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  14241. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  14242. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  14243. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  14244. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  14245. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  14246. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  14247. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  14248. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  14249. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  14250. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  14251. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  14252. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  14253. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  14254. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  14255. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  14256. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  14257. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  14258. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  14259. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  14260. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  14261. /*--- word 0 ---*/
  14262. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  14263. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  14264. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  14265. do { \
  14266. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  14267. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  14268. } while (0)
  14269. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  14270. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  14271. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  14272. do { \
  14273. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  14274. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  14275. } while (0)
  14276. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  14277. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  14278. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  14279. do { \
  14280. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  14281. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  14282. } while (0)
  14283. /*--- word 1 ---*/
  14284. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  14285. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  14286. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  14287. do { \
  14288. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  14289. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  14290. } while (0)
  14291. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  14292. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  14293. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  14294. do { \
  14295. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  14296. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  14297. } while (0)
  14298. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  14299. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  14300. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  14301. do { \
  14302. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  14303. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  14304. } while (0)
  14305. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  14306. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  14307. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  14308. do { \
  14309. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  14310. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  14311. } while (0)
  14312. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  14313. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  14314. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  14315. do { \
  14316. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  14317. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  14318. } while (0)
  14319. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  14320. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  14321. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  14322. do { \
  14323. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  14324. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  14325. } while (0)
  14326. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  14327. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  14328. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  14329. do { \
  14330. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  14331. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  14332. } while (0)
  14333. /**
  14334. * @brief target -> host channel calibration data message
  14335. *
  14336. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  14337. *
  14338. * @brief host -> target channel calibration data message
  14339. *
  14340. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  14341. *
  14342. * @details
  14343. * The following field definitions describe the format of the channel
  14344. * calibration data message sent from the target to the host when
  14345. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  14346. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  14347. * The message is defined as htt_chan_caldata_msg followed by a variable
  14348. * number of 32-bit character values.
  14349. *
  14350. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  14351. * |------------------------------------------------------------------|
  14352. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  14353. * |------------------------------------------------------------------|
  14354. * | payload size | mhz |
  14355. * |------------------------------------------------------------------|
  14356. * | center frequency 2 | center frequency 1 |
  14357. * |------------------------------------------------------------------|
  14358. * | check sum |
  14359. * |------------------------------------------------------------------|
  14360. * | payload |
  14361. * |------------------------------------------------------------------|
  14362. * message info field:
  14363. * - MSG_TYPE
  14364. * Bits 7:0
  14365. * Purpose: identifies this as a channel calibration data message
  14366. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  14367. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  14368. * - SUB_TYPE
  14369. * Bits 11:8
  14370. * Purpose: T2H: indicates whether target is providing chan cal data
  14371. * to the host to store, or requesting that the host
  14372. * download previously-stored data.
  14373. * H2T: indicates whether the host is providing the requested
  14374. * channel cal data, or if it is rejecting the data
  14375. * request because it does not have the requested data.
  14376. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  14377. * - CHKSUM_VALID
  14378. * Bit 12
  14379. * Purpose: indicates if the checksum field is valid
  14380. * value:
  14381. * - FRAG
  14382. * Bit 19:16
  14383. * Purpose: indicates the fragment index for message
  14384. * value: 0 for first fragment, 1 for second fragment, ...
  14385. * - APPEND
  14386. * Bit 20
  14387. * Purpose: indicates if this is the last fragment
  14388. * value: 0 = final fragment, 1 = more fragments will be appended
  14389. *
  14390. * channel and payload size field
  14391. * - MHZ
  14392. * Bits 15:0
  14393. * Purpose: indicates the channel primary frequency
  14394. * Value:
  14395. * - PAYLOAD_SIZE
  14396. * Bits 31:16
  14397. * Purpose: indicates the bytes of calibration data in payload
  14398. * Value:
  14399. *
  14400. * center frequency field
  14401. * - CENTER FREQUENCY 1
  14402. * Bits 15:0
  14403. * Purpose: indicates the channel center frequency
  14404. * Value: channel center frequency, in MHz units
  14405. * - CENTER FREQUENCY 2
  14406. * Bits 31:16
  14407. * Purpose: indicates the secondary channel center frequency,
  14408. * only for 11acvht 80plus80 mode
  14409. * Value: secondary channel center frequeny, in MHz units, if applicable
  14410. *
  14411. * checksum field
  14412. * - CHECK_SUM
  14413. * Bits 31:0
  14414. * Purpose: check the payload data, it is just for this fragment.
  14415. * This is intended for the target to check that the channel
  14416. * calibration data returned by the host is the unmodified data
  14417. * that was previously provided to the host by the target.
  14418. * value: checksum of fragment payload
  14419. */
  14420. PREPACK struct htt_chan_caldata_msg {
  14421. /* DWORD 0: message info */
  14422. A_UINT32
  14423. msg_type: 8,
  14424. sub_type: 4 ,
  14425. chksum_valid: 1, /** 1:valid, 0:invalid */
  14426. reserved1: 3,
  14427. frag_idx: 4, /** fragment index for calibration data */
  14428. appending: 1, /** 0: no fragment appending,
  14429. * 1: extra fragment appending */
  14430. reserved2: 11;
  14431. /* DWORD 1: channel and payload size */
  14432. A_UINT32
  14433. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  14434. payload_size: 16; /** unit: bytes */
  14435. /* DWORD 2: center frequency */
  14436. A_UINT32
  14437. band_center_freq1: 16, /** Center frequency 1 in MHz */
  14438. band_center_freq2: 16; /** Center frequency 2 in MHz,
  14439. * valid only for 11acvht 80plus80 mode */
  14440. /* DWORD 3: check sum */
  14441. A_UINT32 chksum;
  14442. /* variable length for calibration data */
  14443. A_UINT32 payload[1/* or more */];
  14444. } POSTPACK;
  14445. /* T2H SUBTYPE */
  14446. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  14447. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  14448. /* H2T SUBTYPE */
  14449. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  14450. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  14451. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  14452. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  14453. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  14454. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  14455. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  14456. do { \
  14457. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  14458. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  14459. } while (0)
  14460. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  14461. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  14462. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  14463. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  14464. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  14465. do { \
  14466. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  14467. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  14468. } while (0)
  14469. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  14470. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  14471. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  14472. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  14473. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  14474. do { \
  14475. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  14476. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  14477. } while (0)
  14478. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  14479. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  14480. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  14481. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  14482. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  14483. do { \
  14484. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  14485. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  14486. } while (0)
  14487. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  14488. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  14489. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  14490. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  14491. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  14492. do { \
  14493. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  14494. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  14495. } while (0)
  14496. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  14497. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  14498. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  14499. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  14500. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  14501. do { \
  14502. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  14503. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  14504. } while (0)
  14505. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  14506. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  14507. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  14508. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  14509. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  14510. do { \
  14511. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  14512. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  14513. } while (0)
  14514. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  14515. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  14516. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  14517. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  14518. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  14519. do { \
  14520. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  14521. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  14522. } while (0)
  14523. /**
  14524. * @brief target -> host FSE CMEM based send
  14525. *
  14526. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  14527. *
  14528. * @details
  14529. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  14530. * FSE placement in CMEM is enabled.
  14531. *
  14532. * This message sends the non-secure CMEM base address.
  14533. * It will be sent to host in response to message
  14534. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  14535. * The message would appear as follows:
  14536. *
  14537. * |31 24|23 16|15 8|7 0|
  14538. * |----------------+----------------+----------------+----------------|
  14539. * | reserved | num_entries | msg_type |
  14540. * |----------------+----------------+----------------+----------------|
  14541. * | base_address_lo |
  14542. * |----------------+----------------+----------------+----------------|
  14543. * | base_address_hi |
  14544. * |-------------------------------------------------------------------|
  14545. *
  14546. * The message is interpreted as follows:
  14547. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  14548. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  14549. * b'8:15 - number_entries: Indicated the number of entries
  14550. * programmed.
  14551. * b'16:31 - reserved.
  14552. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  14553. * CMEM base address
  14554. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  14555. * CMEM base address
  14556. */
  14557. PREPACK struct htt_cmem_base_send_t {
  14558. A_UINT32 msg_type: 8,
  14559. num_entries: 8,
  14560. reserved: 16;
  14561. A_UINT32 base_address_lo;
  14562. A_UINT32 base_address_hi;
  14563. } POSTPACK;
  14564. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  14565. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  14566. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  14567. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  14568. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  14569. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  14570. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  14571. do { \
  14572. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  14573. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14574. } while (0)
  14575. /**
  14576. * @brief - HTT PPDU ID format
  14577. *
  14578. * @details
  14579. * The following field definitions describe the format of the PPDU ID.
  14580. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  14581. *
  14582. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  14583. * +--------------------------------------------------------------------------
  14584. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  14585. * +--------------------------------------------------------------------------
  14586. *
  14587. * sch id :Schedule command id
  14588. * Bits [11 : 0] : monotonically increasing counter to track the
  14589. * PPDU posted to a specific transmit queue.
  14590. *
  14591. * hwq_id: Hardware Queue ID.
  14592. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  14593. *
  14594. * mac_id: MAC ID
  14595. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  14596. *
  14597. * seq_idx: Sequence index.
  14598. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  14599. * a particular TXOP.
  14600. *
  14601. * tqm_cmd: HWSCH/TQM flag.
  14602. * Bit [23] : Always set to 0.
  14603. *
  14604. * seq_cmd_type: Sequence command type.
  14605. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  14606. * Refer to enum HTT_STATS_FTYPE for values.
  14607. */
  14608. PREPACK struct htt_ppdu_id {
  14609. A_UINT32
  14610. sch_id: 12,
  14611. hwq_id: 5,
  14612. mac_id: 2,
  14613. seq_idx: 2,
  14614. reserved1: 2,
  14615. tqm_cmd: 1,
  14616. seq_cmd_type: 6,
  14617. reserved2: 2;
  14618. } POSTPACK;
  14619. #define HTT_PPDU_ID_SCH_ID_S 0
  14620. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  14621. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  14622. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  14623. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  14624. do { \
  14625. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  14626. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  14627. } while (0)
  14628. #define HTT_PPDU_ID_HWQ_ID_S 12
  14629. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  14630. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  14631. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  14632. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  14633. do { \
  14634. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  14635. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  14636. } while (0)
  14637. #define HTT_PPDU_ID_MAC_ID_S 17
  14638. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  14639. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  14640. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  14641. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  14642. do { \
  14643. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  14644. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  14645. } while (0)
  14646. #define HTT_PPDU_ID_SEQ_IDX_S 19
  14647. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  14648. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  14649. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  14650. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  14651. do { \
  14652. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  14653. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  14654. } while (0)
  14655. #define HTT_PPDU_ID_TQM_CMD_S 23
  14656. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  14657. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  14658. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  14659. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  14660. do { \
  14661. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  14662. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  14663. } while (0)
  14664. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  14665. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  14666. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  14667. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  14668. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  14669. do { \
  14670. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  14671. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  14672. } while (0)
  14673. /**
  14674. * @brief target -> RX PEER METADATA V0 format
  14675. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14676. * message from target, and will confirm to the target which peer metadata
  14677. * version to use in the wmi_init message.
  14678. *
  14679. * The following diagram shows the format of the RX PEER METADATA.
  14680. *
  14681. * |31 24|23 16|15 8|7 0|
  14682. * |-----------------------------------------------------------------------|
  14683. * | Reserved | VDEV ID | PEER ID |
  14684. * |-----------------------------------------------------------------------|
  14685. */
  14686. PREPACK struct htt_rx_peer_metadata_v0 {
  14687. A_UINT32
  14688. peer_id: 16,
  14689. vdev_id: 8,
  14690. reserved1: 8;
  14691. } POSTPACK;
  14692. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  14693. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  14694. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  14695. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  14696. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  14697. do { \
  14698. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  14699. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  14700. } while (0)
  14701. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  14702. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  14703. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  14704. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  14705. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  14706. do { \
  14707. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  14708. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  14709. } while (0)
  14710. /**
  14711. * @brief target -> RX PEER METADATA V1 format
  14712. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14713. * message from target, and will confirm to the target which peer metadata
  14714. * version to use in the wmi_init message.
  14715. *
  14716. * The following diagram shows the format of the RX PEER METADATA V1 format.
  14717. *
  14718. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  14719. * |-----------------------------------------------------------------------|
  14720. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  14721. * |-----------------------------------------------------------------------|
  14722. */
  14723. PREPACK struct htt_rx_peer_metadata_v1 {
  14724. A_UINT32
  14725. peer_id: 13,
  14726. ml_peer_valid: 1,
  14727. reserved1: 2,
  14728. vdev_id: 8,
  14729. lmac_id: 2,
  14730. chip_id: 3,
  14731. reserved2: 3;
  14732. } POSTPACK;
  14733. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  14734. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  14735. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  14736. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  14737. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  14738. do { \
  14739. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  14740. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  14741. } while (0)
  14742. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  14743. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  14744. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  14745. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  14746. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  14747. do { \
  14748. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  14749. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  14750. } while (0)
  14751. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  14752. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  14753. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  14754. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  14755. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  14756. do { \
  14757. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  14758. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  14759. } while (0)
  14760. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  14761. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  14762. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  14763. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  14764. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  14765. do { \
  14766. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  14767. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  14768. } while (0)
  14769. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  14770. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  14771. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  14772. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  14773. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  14774. do { \
  14775. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  14776. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  14777. } while (0)
  14778. /*
  14779. * In some systems, the host SW wants to specify priorities between
  14780. * different MSDU / flow queues within the same peer-TID.
  14781. * The below enums are used for the host to identify to the target
  14782. * which MSDU queue's priority it wants to adjust.
  14783. */
  14784. /*
  14785. * The MSDUQ index describe index of TCL HW, where each index is
  14786. * used for queuing particular types of MSDUs.
  14787. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  14788. */
  14789. enum HTT_MSDUQ_INDEX {
  14790. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  14791. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  14792. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  14793. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  14794. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  14795. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  14796. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  14797. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  14798. HTT_MSDUQ_MAX_INDEX,
  14799. };
  14800. /* MSDU qtype definition */
  14801. enum HTT_MSDU_QTYPE {
  14802. /*
  14803. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  14804. * relative priority. Instead, the relative priority of CRIT_0 versus
  14805. * CRIT_1 is controlled by the FW, through the configuration parameters
  14806. * it applies to the queues.
  14807. */
  14808. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  14809. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  14810. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  14811. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  14812. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  14813. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  14814. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  14815. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  14816. /* New MSDU_QTYPE should be added above this line */
  14817. /*
  14818. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  14819. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  14820. * any host/target message definitions. The QTYPE_MAX value can
  14821. * only be used internally within the host or within the target.
  14822. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  14823. * it must regard the unexpected value as a default qtype value,
  14824. * or ignore it.
  14825. */
  14826. HTT_MSDU_QTYPE_MAX,
  14827. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  14828. };
  14829. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  14830. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  14831. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  14832. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  14833. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  14834. };
  14835. /**
  14836. * @brief target -> host mlo timestamp offset indication
  14837. *
  14838. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14839. *
  14840. * @details
  14841. * The following field definitions describe the format of the HTT target
  14842. * to host mlo timestamp offset indication message.
  14843. *
  14844. *
  14845. * |31 16|15 12|11 10|9 8|7 0 |
  14846. * |----------------------------------------------------------------------|
  14847. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  14848. * |----------------------------------------------------------------------|
  14849. * | Sync time stamp lo in us |
  14850. * |----------------------------------------------------------------------|
  14851. * | Sync time stamp hi in us |
  14852. * |----------------------------------------------------------------------|
  14853. * | mlo time stamp offset lo in us |
  14854. * |----------------------------------------------------------------------|
  14855. * | mlo time stamp offset hi in us |
  14856. * |----------------------------------------------------------------------|
  14857. * | mlo time stamp offset clocks in clock ticks |
  14858. * |----------------------------------------------------------------------|
  14859. * |31 26|25 16|15 0 |
  14860. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  14861. * | | compensation in clks | |
  14862. * |----------------------------------------------------------------------|
  14863. * |31 22|21 0 |
  14864. * | rsvd 3 | mlo time stamp comp timer period |
  14865. * |----------------------------------------------------------------------|
  14866. * The message is interpreted as follows:
  14867. *
  14868. * dword0 - b'0:7 - msg_type: This will be set to
  14869. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14870. * value: 0x28
  14871. *
  14872. * dword0 - b'9:8 - pdev_id
  14873. *
  14874. * dword0 - b'11:10 - chip_id
  14875. *
  14876. * dword0 - b'15:12 - rsvd1: Reserved for future use
  14877. *
  14878. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  14879. *
  14880. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  14881. * which last sync interrupt was received
  14882. *
  14883. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  14884. * which last sync interrupt was received
  14885. *
  14886. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  14887. *
  14888. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  14889. *
  14890. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  14891. *
  14892. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  14893. *
  14894. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  14895. * for sub us resolution
  14896. *
  14897. * dword6 - b'31:26 - rsvd2: Reserved for future use
  14898. *
  14899. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  14900. * is applied, in us
  14901. *
  14902. * dword7 - b'31:22 - rsvd3: Reserved for future use
  14903. */
  14904. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  14905. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  14906. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  14907. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  14908. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  14909. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  14910. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  14911. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  14912. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  14913. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  14914. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  14915. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  14916. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  14917. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  14918. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  14919. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  14920. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  14921. do { \
  14922. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  14923. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  14924. } while (0)
  14925. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  14926. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  14927. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  14928. do { \
  14929. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  14930. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  14931. } while (0)
  14932. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  14933. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  14934. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  14935. do { \
  14936. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  14937. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  14938. } while (0)
  14939. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  14940. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  14941. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  14942. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  14943. do { \
  14944. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  14945. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  14946. } while (0)
  14947. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  14948. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  14949. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  14950. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  14951. do { \
  14952. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  14953. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  14954. } while (0)
  14955. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  14956. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  14957. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  14958. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  14959. do { \
  14960. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  14961. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  14962. } while (0)
  14963. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  14964. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  14965. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  14966. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  14967. do { \
  14968. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  14969. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  14970. } while (0)
  14971. typedef struct {
  14972. A_UINT32 msg_type: 8, /* bits 7:0 */
  14973. pdev_id: 2, /* bits 9:8 */
  14974. chip_id: 2, /* bits 11:10 */
  14975. reserved1: 4, /* bits 15:12 */
  14976. mac_clk_freq_mhz: 16; /* bits 31:16 */
  14977. A_UINT32 sync_timestamp_lo_us;
  14978. A_UINT32 sync_timestamp_hi_us;
  14979. A_UINT32 mlo_timestamp_offset_lo_us;
  14980. A_UINT32 mlo_timestamp_offset_hi_us;
  14981. A_UINT32 mlo_timestamp_offset_clks;
  14982. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  14983. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  14984. reserved2: 6; /* bits 31:26 */
  14985. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  14986. reserved3: 10; /* bits 31:22 */
  14987. } htt_t2h_mlo_offset_ind_t;
  14988. /*
  14989. * @brief target -> host VDEV TX RX STATS
  14990. *
  14991. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  14992. *
  14993. * @details
  14994. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  14995. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  14996. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  14997. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  14998. * periodically by target even in the absence of any further HTT request
  14999. * messages from host.
  15000. *
  15001. * The message is formatted as follows:
  15002. *
  15003. * |31 16|15 8|7 0|
  15004. * |---------------------------------+----------------+----------------|
  15005. * | payload_size | pdev_id | msg_type |
  15006. * |---------------------------------+----------------+----------------|
  15007. * | reserved0 |
  15008. * |-------------------------------------------------------------------|
  15009. * | reserved1 |
  15010. * |-------------------------------------------------------------------|
  15011. * | reserved2 |
  15012. * |-------------------------------------------------------------------|
  15013. * | |
  15014. * | VDEV specific Tx Rx stats info |
  15015. * | |
  15016. * |-------------------------------------------------------------------|
  15017. *
  15018. * The message is interpreted as follows:
  15019. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15020. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15021. * b'8:15 - pdev_id
  15022. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15023. * message header fields (msg_type through reserved2)
  15024. * dword1 - b'0:31 - reserved0.
  15025. * dword2 - b'0:31 - reserved1.
  15026. * dword3 - b'0:31 - reserved2.
  15027. */
  15028. typedef struct {
  15029. A_UINT32 msg_type: 8,
  15030. pdev_id: 8,
  15031. payload_size: 16;
  15032. A_UINT32 reserved0;
  15033. A_UINT32 reserved1;
  15034. A_UINT32 reserved2;
  15035. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15036. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15037. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15038. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15039. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15040. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15041. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15042. do { \
  15043. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15044. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15045. } while (0)
  15046. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15047. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15048. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15049. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15050. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15051. do { \
  15052. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15053. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15054. } while (0)
  15055. /* SOC related stats */
  15056. typedef struct {
  15057. htt_tlv_hdr_t tlv_hdr;
  15058. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15059. * This can be due to either the peer is deleted or deletion is ongoing
  15060. * */
  15061. A_UINT32 inv_peers_msdu_drop_count_lo;
  15062. A_UINT32 inv_peers_msdu_drop_count_hi;
  15063. } htt_t2h_soc_txrx_stats_common_tlv;
  15064. /* VDEV HW Tx/Rx stats */
  15065. typedef struct {
  15066. htt_tlv_hdr_t tlv_hdr;
  15067. A_UINT32 vdev_id;
  15068. /* Rx msdu byte cnt */
  15069. A_UINT32 rx_msdu_byte_cnt_lo;
  15070. A_UINT32 rx_msdu_byte_cnt_hi;
  15071. /* Rx msdu cnt */
  15072. A_UINT32 rx_msdu_cnt_lo;
  15073. A_UINT32 rx_msdu_cnt_hi;
  15074. /* tx msdu byte cnt */
  15075. A_UINT32 tx_msdu_byte_cnt_lo;
  15076. A_UINT32 tx_msdu_byte_cnt_hi;
  15077. /* tx msdu cnt */
  15078. A_UINT32 tx_msdu_cnt_lo;
  15079. A_UINT32 tx_msdu_cnt_hi;
  15080. /* tx excessive retry discarded msdu cnt*/
  15081. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15082. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15083. /* TX congestion ctrl msdu drop cnt */
  15084. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15085. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15086. /* discarded tx msdus cnt coz of time to live expiry */
  15087. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15088. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15089. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15090. #endif