htt.h 764 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713
  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_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  632. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  633. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  634. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  635. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  636. HTT_STATS_MAX_TAG,
  637. } htt_tlv_tag_t;
  638. #define HTT_STATS_TLV_TAG_M 0x00000fff
  639. #define HTT_STATS_TLV_TAG_S 0
  640. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  641. #define HTT_STATS_TLV_LENGTH_S 12
  642. #define HTT_STATS_TLV_TAG_GET(_var) \
  643. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  644. HTT_STATS_TLV_TAG_S)
  645. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  646. do { \
  647. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  648. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  649. } while (0)
  650. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  651. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  652. HTT_STATS_TLV_LENGTH_S)
  653. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  654. do { \
  655. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  656. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  657. } while (0)
  658. /*=== host -> target messages ===============================================*/
  659. enum htt_h2t_msg_type {
  660. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  661. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  662. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  663. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  664. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  665. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  666. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  667. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  668. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  669. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  670. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  671. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  672. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  673. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  674. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  675. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  676. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  677. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  678. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  679. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  680. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  681. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  682. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  683. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  684. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  685. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  686. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  687. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  688. /* keep this last */
  689. HTT_H2T_NUM_MSGS
  690. };
  691. /*
  692. * HTT host to target message type -
  693. * stored in bits 7:0 of the first word of the message
  694. */
  695. #define HTT_H2T_MSG_TYPE_M 0xff
  696. #define HTT_H2T_MSG_TYPE_S 0
  697. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  698. do { \
  699. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  700. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  701. } while (0)
  702. #define HTT_H2T_MSG_TYPE_GET(word) \
  703. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  704. /**
  705. * @brief host -> target version number request message definition
  706. *
  707. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  708. *
  709. *
  710. * |31 24|23 16|15 8|7 0|
  711. * |----------------+----------------+----------------+----------------|
  712. * | reserved | msg type |
  713. * |-------------------------------------------------------------------|
  714. * : option request TLV (optional) |
  715. * :...................................................................:
  716. *
  717. * The VER_REQ message may consist of a single 4-byte word, or may be
  718. * extended with TLVs that specify which HTT options the host is requesting
  719. * from the target.
  720. * The following option TLVs may be appended to the VER_REQ message:
  721. * - HL_SUPPRESS_TX_COMPL_IND
  722. * - HL_MAX_TX_QUEUE_GROUPS
  723. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  724. * may be appended to the VER_REQ message (but only one TLV of each type).
  725. *
  726. * Header fields:
  727. * - MSG_TYPE
  728. * Bits 7:0
  729. * Purpose: identifies this as a version number request message
  730. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  731. */
  732. #define HTT_VER_REQ_BYTES 4
  733. /* TBDXXX: figure out a reasonable number */
  734. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  735. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  736. /**
  737. * @brief HTT tx MSDU descriptor
  738. *
  739. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  740. *
  741. * @details
  742. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  743. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  744. * the target firmware needs for the FW's tx processing, particularly
  745. * for creating the HW msdu descriptor.
  746. * The same HTT tx descriptor is used for HL and LL systems, though
  747. * a few fields within the tx descriptor are used only by LL or
  748. * only by HL.
  749. * The HTT tx descriptor is defined in two manners: by a struct with
  750. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  751. * definitions.
  752. * The target should use the struct def, for simplicitly and clarity,
  753. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  754. * neutral. Specifically, the host shall use the get/set macros built
  755. * around the mask + shift defs.
  756. */
  757. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  758. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  759. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  760. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  761. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  762. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  763. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  764. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  765. #define HTT_TX_VDEV_ID_WORD 0
  766. #define HTT_TX_VDEV_ID_MASK 0x3f
  767. #define HTT_TX_VDEV_ID_SHIFT 16
  768. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  769. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  770. #define HTT_TX_MSDU_LEN_DWORD 1
  771. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  772. /*
  773. * HTT_VAR_PADDR macros
  774. * Allow physical / bus addresses to be either a single 32-bit value,
  775. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  776. */
  777. #define HTT_VAR_PADDR32(var_name) \
  778. A_UINT32 var_name
  779. #define HTT_VAR_PADDR64_LE(var_name) \
  780. struct { \
  781. /* little-endian: lo precedes hi */ \
  782. A_UINT32 lo; \
  783. A_UINT32 hi; \
  784. } var_name
  785. /*
  786. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  787. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  788. * addresses are stored in a XXX-bit field.
  789. * This macro is used to define both htt_tx_msdu_desc32_t and
  790. * htt_tx_msdu_desc64_t structs.
  791. */
  792. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  793. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  794. { \
  795. /* DWORD 0: flags and meta-data */ \
  796. A_UINT32 \
  797. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  798. \
  799. /* pkt_subtype - \
  800. * Detailed specification of the tx frame contents, extending the \
  801. * general specification provided by pkt_type. \
  802. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  803. * pkt_type | pkt_subtype \
  804. * ============================================================== \
  805. * 802.3 | bit 0:3 - Reserved \
  806. * | bit 4: 0x0 - Copy-Engine Classification Results \
  807. * | not appended to the HTT message \
  808. * | 0x1 - Copy-Engine Classification Results \
  809. * | appended to the HTT message in the \
  810. * | format: \
  811. * | [HTT tx desc, frame header, \
  812. * | CE classification results] \
  813. * | The CE classification results begin \
  814. * | at the next 4-byte boundary after \
  815. * | the frame header. \
  816. * ------------+------------------------------------------------- \
  817. * Eth2 | bit 0:3 - Reserved \
  818. * | bit 4: 0x0 - Copy-Engine Classification Results \
  819. * | not appended to the HTT message \
  820. * | 0x1 - Copy-Engine Classification Results \
  821. * | appended to the HTT message. \
  822. * | See the above specification of the \
  823. * | CE classification results location. \
  824. * ------------+------------------------------------------------- \
  825. * native WiFi | bit 0:3 - Reserved \
  826. * | bit 4: 0x0 - Copy-Engine Classification Results \
  827. * | not appended to the HTT message \
  828. * | 0x1 - Copy-Engine Classification Results \
  829. * | appended to the HTT message. \
  830. * | See the above specification of the \
  831. * | CE classification results location. \
  832. * ------------+------------------------------------------------- \
  833. * mgmt | 0x0 - 802.11 MAC header absent \
  834. * | 0x1 - 802.11 MAC header present \
  835. * ------------+------------------------------------------------- \
  836. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  837. * | 0x1 - 802.11 MAC header present \
  838. * | bit 1: 0x0 - allow aggregation \
  839. * | 0x1 - don't allow aggregation \
  840. * | bit 2: 0x0 - perform encryption \
  841. * | 0x1 - don't perform encryption \
  842. * | bit 3: 0x0 - perform tx classification / queuing \
  843. * | 0x1 - don't perform tx classification; \
  844. * | insert the frame into the "misc" \
  845. * | tx queue \
  846. * | bit 4: 0x0 - Copy-Engine Classification Results \
  847. * | not appended to the HTT message \
  848. * | 0x1 - Copy-Engine Classification Results \
  849. * | appended to the HTT message. \
  850. * | See the above specification of the \
  851. * | CE classification results location. \
  852. */ \
  853. pkt_subtype: 5, \
  854. \
  855. /* pkt_type - \
  856. * General specification of the tx frame contents. \
  857. * The htt_pkt_type enum should be used to specify and check the \
  858. * value of this field. \
  859. */ \
  860. pkt_type: 3, \
  861. \
  862. /* vdev_id - \
  863. * ID for the vdev that is sending this tx frame. \
  864. * For certain non-standard packet types, e.g. pkt_type == raw \
  865. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  866. * This field is used primarily for determining where to queue \
  867. * broadcast and multicast frames. \
  868. */ \
  869. vdev_id: 6, \
  870. /* ext_tid - \
  871. * The extended traffic ID. \
  872. * If the TID is unknown, the extended TID is set to \
  873. * HTT_TX_EXT_TID_INVALID. \
  874. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  875. * value of the QoS TID. \
  876. * If the tx frame is non-QoS data, then the extended TID is set to \
  877. * HTT_TX_EXT_TID_NON_QOS. \
  878. * If the tx frame is multicast or broadcast, then the extended TID \
  879. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  880. */ \
  881. ext_tid: 5, \
  882. \
  883. /* postponed - \
  884. * This flag indicates whether the tx frame has been downloaded to \
  885. * the target before but discarded by the target, and now is being \
  886. * downloaded again; or if this is a new frame that is being \
  887. * downloaded for the first time. \
  888. * This flag allows the target to determine the correct order for \
  889. * transmitting new vs. old frames. \
  890. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  891. * This flag only applies to HL systems, since in LL systems, \
  892. * the tx flow control is handled entirely within the target. \
  893. */ \
  894. postponed: 1, \
  895. \
  896. /* extension - \
  897. * This flag indicates whether a HTT tx MSDU extension descriptor \
  898. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  899. * \
  900. * 0x0 - no extension MSDU descriptor is present \
  901. * 0x1 - an extension MSDU descriptor immediately follows the \
  902. * regular MSDU descriptor \
  903. */ \
  904. extension: 1, \
  905. \
  906. /* cksum_offload - \
  907. * This flag indicates whether checksum offload is enabled or not \
  908. * for this frame. Target FW use this flag to turn on HW checksumming \
  909. * 0x0 - No checksum offload \
  910. * 0x1 - L3 header checksum only \
  911. * 0x2 - L4 checksum only \
  912. * 0x3 - L3 header checksum + L4 checksum \
  913. */ \
  914. cksum_offload: 2, \
  915. \
  916. /* tx_comp_req - \
  917. * This flag indicates whether Tx Completion \
  918. * from fw is required or not. \
  919. * This flag is only relevant if tx completion is not \
  920. * universally enabled. \
  921. * For all LL systems, tx completion is mandatory, \
  922. * so this flag will be irrelevant. \
  923. * For HL systems tx completion is optional, but HL systems in which \
  924. * the bus throughput exceeds the WLAN throughput will \
  925. * probably want to always use tx completion, and thus \
  926. * would not check this flag. \
  927. * This flag is required when tx completions are not used universally, \
  928. * but are still required for certain tx frames for which \
  929. * an OTA delivery acknowledgment is needed by the host. \
  930. * In practice, this would be for HL systems in which the \
  931. * bus throughput is less than the WLAN throughput. \
  932. * \
  933. * 0x0 - Tx Completion Indication from Fw not required \
  934. * 0x1 - Tx Completion Indication from Fw is required \
  935. */ \
  936. tx_compl_req: 1; \
  937. \
  938. \
  939. /* DWORD 1: MSDU length and ID */ \
  940. A_UINT32 \
  941. len: 16, /* MSDU length, in bytes */ \
  942. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  943. * and this id is used to calculate fragmentation \
  944. * descriptor pointer inside the target based on \
  945. * the base address, configured inside the target. \
  946. */ \
  947. \
  948. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  949. /* frags_desc_ptr - \
  950. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  951. * where the tx frame's fragments reside in memory. \
  952. * This field only applies to LL systems, since in HL systems the \
  953. * (degenerate single-fragment) fragmentation descriptor is created \
  954. * within the target. \
  955. */ \
  956. _paddr__frags_desc_ptr_; \
  957. \
  958. /* DWORD 3 (or 4): peerid, chanfreq */ \
  959. /* \
  960. * Peer ID : Target can use this value to know which peer-id packet \
  961. * destined to. \
  962. * It's intended to be specified by host in case of NAWDS. \
  963. */ \
  964. A_UINT16 peerid; \
  965. \
  966. /* \
  967. * Channel frequency: This identifies the desired channel \
  968. * frequency (in mhz) for tx frames. This is used by FW to help \
  969. * determine when it is safe to transmit or drop frames for \
  970. * off-channel operation. \
  971. * The default value of zero indicates to FW that the corresponding \
  972. * VDEV's home channel (if there is one) is the desired channel \
  973. * frequency. \
  974. */ \
  975. A_UINT16 chanfreq; \
  976. \
  977. /* Reason reserved is commented is increasing the htt structure size \
  978. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  979. * A_UINT32 reserved_dword3_bits0_31; \
  980. */ \
  981. } POSTPACK
  982. /* define a htt_tx_msdu_desc32_t type */
  983. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  984. /* define a htt_tx_msdu_desc64_t type */
  985. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  986. /*
  987. * Make htt_tx_msdu_desc_t be an alias for either
  988. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  989. */
  990. #if HTT_PADDR64
  991. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  992. #else
  993. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  994. #endif
  995. /* decriptor information for Management frame*/
  996. /*
  997. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  998. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  999. */
  1000. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1001. extern A_UINT32 mgmt_hdr_len;
  1002. PREPACK struct htt_mgmt_tx_desc_t {
  1003. A_UINT32 msg_type;
  1004. #if HTT_PADDR64
  1005. A_UINT64 frag_paddr; /* DMAble address of the data */
  1006. #else
  1007. A_UINT32 frag_paddr; /* DMAble address of the data */
  1008. #endif
  1009. A_UINT32 desc_id; /* returned to host during completion
  1010. * to free the meory*/
  1011. A_UINT32 len; /* Fragment length */
  1012. A_UINT32 vdev_id; /* virtual device ID*/
  1013. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1014. } POSTPACK;
  1015. PREPACK struct htt_mgmt_tx_compl_ind {
  1016. A_UINT32 desc_id;
  1017. A_UINT32 status;
  1018. } POSTPACK;
  1019. /*
  1020. * This SDU header size comes from the summation of the following:
  1021. * 1. Max of:
  1022. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1023. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1024. * b. 802.11 header, for raw frames: 36 bytes
  1025. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1026. * QoS header, HT header)
  1027. * c. 802.3 header, for ethernet frames: 14 bytes
  1028. * (destination address, source address, ethertype / length)
  1029. * 2. Max of:
  1030. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1031. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1032. * 3. 802.1Q VLAN header: 4 bytes
  1033. * 4. LLC/SNAP header: 8 bytes
  1034. */
  1035. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1036. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1037. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1038. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1039. A_COMPILE_TIME_ASSERT(
  1040. htt_encap_hdr_size_max_check_nwifi,
  1041. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1042. A_COMPILE_TIME_ASSERT(
  1043. htt_encap_hdr_size_max_check_enet,
  1044. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1045. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1046. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1047. #define HTT_TX_HDR_SIZE_802_1Q 4
  1048. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1049. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1050. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1051. HTT_TX_HDR_SIZE_802_1Q + \
  1052. HTT_TX_HDR_SIZE_LLC_SNAP)
  1053. #define HTT_HL_TX_FRM_HDR_LEN \
  1054. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1055. #define HTT_LL_TX_FRM_HDR_LEN \
  1056. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1057. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1058. /* dword 0 */
  1059. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1060. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1061. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1062. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1063. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1064. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1065. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1066. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1067. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1068. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1069. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1070. #define HTT_TX_DESC_PKT_TYPE_S 13
  1071. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1072. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1073. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1074. #define HTT_TX_DESC_VDEV_ID_S 16
  1075. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1076. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1077. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1078. #define HTT_TX_DESC_EXT_TID_S 22
  1079. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1080. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1081. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1082. #define HTT_TX_DESC_POSTPONED_S 27
  1083. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1084. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1085. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1086. #define HTT_TX_DESC_EXTENSION_S 28
  1087. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1088. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1089. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1090. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1091. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1092. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1093. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1094. #define HTT_TX_DESC_TX_COMP_S 31
  1095. /* dword 1 */
  1096. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1097. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1098. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1099. #define HTT_TX_DESC_FRM_LEN_S 0
  1100. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1101. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1102. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1103. #define HTT_TX_DESC_FRM_ID_S 16
  1104. /* dword 2 */
  1105. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1106. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1107. /* for systems using 64-bit format for bus addresses */
  1108. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1109. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1110. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1111. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1112. /* for systems using 32-bit format for bus addresses */
  1113. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1114. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1115. /* dword 3 */
  1116. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1117. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1118. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1119. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1120. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1121. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1122. #if HTT_PADDR64
  1123. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1124. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1125. #else
  1126. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1127. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1128. #endif
  1129. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1130. #define HTT_TX_DESC_PEER_ID_S 0
  1131. /*
  1132. * TEMPORARY:
  1133. * The original definitions for the PEER_ID fields contained typos
  1134. * (with _DESC_PADDR appended to this PEER_ID field name).
  1135. * Retain deprecated original names for PEER_ID fields until all code that
  1136. * refers to them has been updated.
  1137. */
  1138. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1139. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1140. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1141. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1142. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1143. HTT_TX_DESC_PEER_ID_M
  1144. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1145. HTT_TX_DESC_PEER_ID_S
  1146. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1147. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1148. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1149. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1150. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1151. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1152. #if HTT_PADDR64
  1153. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1154. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1155. #else
  1156. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1157. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1158. #endif
  1159. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1160. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1161. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1162. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1163. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1164. do { \
  1165. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1166. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1167. } while (0)
  1168. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1169. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1170. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1171. do { \
  1172. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1173. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1174. } while (0)
  1175. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1176. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1177. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1178. do { \
  1179. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1180. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1181. } while (0)
  1182. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1183. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1184. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1185. do { \
  1186. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1187. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1188. } while (0)
  1189. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1190. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1191. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1192. do { \
  1193. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1194. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1195. } while (0)
  1196. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1197. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1198. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1199. do { \
  1200. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1201. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1202. } while (0)
  1203. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1204. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1205. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1206. do { \
  1207. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1208. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1209. } while (0)
  1210. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1211. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1212. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1213. do { \
  1214. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1215. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1216. } while (0)
  1217. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1218. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1219. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1220. do { \
  1221. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1222. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1223. } while (0)
  1224. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1225. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1226. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1227. do { \
  1228. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1229. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1230. } while (0)
  1231. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1232. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1233. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1234. do { \
  1235. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1236. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1237. } while (0)
  1238. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1239. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1240. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1241. do { \
  1242. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1243. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1244. } while (0)
  1245. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1246. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1247. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1248. do { \
  1249. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1250. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1251. } while (0)
  1252. /* enums used in the HTT tx MSDU extension descriptor */
  1253. enum {
  1254. htt_tx_guard_interval_regular = 0,
  1255. htt_tx_guard_interval_short = 1,
  1256. };
  1257. enum {
  1258. htt_tx_preamble_type_ofdm = 0,
  1259. htt_tx_preamble_type_cck = 1,
  1260. htt_tx_preamble_type_ht = 2,
  1261. htt_tx_preamble_type_vht = 3,
  1262. };
  1263. enum {
  1264. htt_tx_bandwidth_5MHz = 0,
  1265. htt_tx_bandwidth_10MHz = 1,
  1266. htt_tx_bandwidth_20MHz = 2,
  1267. htt_tx_bandwidth_40MHz = 3,
  1268. htt_tx_bandwidth_80MHz = 4,
  1269. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1270. };
  1271. /**
  1272. * @brief HTT tx MSDU extension descriptor
  1273. * @details
  1274. * If the target supports HTT tx MSDU extension descriptors, the host has
  1275. * the option of appending the following struct following the regular
  1276. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1277. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1278. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1279. * tx specs for each frame.
  1280. */
  1281. PREPACK struct htt_tx_msdu_desc_ext_t {
  1282. /* DWORD 0: flags */
  1283. A_UINT32
  1284. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1285. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1286. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1287. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1288. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1289. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1290. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1291. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1292. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1293. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1294. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1295. /* DWORD 1: tx power, tx rate, tx BW */
  1296. A_UINT32
  1297. /* pwr -
  1298. * Specify what power the tx frame needs to be transmitted at.
  1299. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1300. * The value needs to be appropriately sign-extended when extracting
  1301. * the value from the message and storing it in a variable that is
  1302. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1303. * automatically handles this sign-extension.)
  1304. * If the transmission uses multiple tx chains, this power spec is
  1305. * the total transmit power, assuming incoherent combination of
  1306. * per-chain power to produce the total power.
  1307. */
  1308. pwr: 8,
  1309. /* mcs_mask -
  1310. * Specify the allowable values for MCS index (modulation and coding)
  1311. * to use for transmitting the frame.
  1312. *
  1313. * For HT / VHT preamble types, this mask directly corresponds to
  1314. * the HT or VHT MCS indices that are allowed. For each bit N set
  1315. * within the mask, MCS index N is allowed for transmitting the frame.
  1316. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1317. * rates versus OFDM rates, so the host has the option of specifying
  1318. * that the target must transmit the frame with CCK or OFDM rates
  1319. * (not HT or VHT), but leaving the decision to the target whether
  1320. * to use CCK or OFDM.
  1321. *
  1322. * For CCK and OFDM, the bits within this mask are interpreted as
  1323. * follows:
  1324. * bit 0 -> CCK 1 Mbps rate is allowed
  1325. * bit 1 -> CCK 2 Mbps rate is allowed
  1326. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1327. * bit 3 -> CCK 11 Mbps rate is allowed
  1328. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1329. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1330. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1331. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1332. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1333. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1334. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1335. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1336. *
  1337. * The MCS index specification needs to be compatible with the
  1338. * bandwidth mask specification. For example, a MCS index == 9
  1339. * specification is inconsistent with a preamble type == VHT,
  1340. * Nss == 1, and channel bandwidth == 20 MHz.
  1341. *
  1342. * Furthermore, the host has only a limited ability to specify to
  1343. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1344. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1345. */
  1346. mcs_mask: 12,
  1347. /* nss_mask -
  1348. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1349. * Each bit in this mask corresponds to a Nss value:
  1350. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1351. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1352. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1353. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1354. * The values in the Nss mask must be suitable for the recipient, e.g.
  1355. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1356. * recipient which only supports 2x2 MIMO.
  1357. */
  1358. nss_mask: 4,
  1359. /* guard_interval -
  1360. * Specify a htt_tx_guard_interval enum value to indicate whether
  1361. * the transmission should use a regular guard interval or a
  1362. * short guard interval.
  1363. */
  1364. guard_interval: 1,
  1365. /* preamble_type_mask -
  1366. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1367. * may choose from for transmitting this frame.
  1368. * The bits in this mask correspond to the values in the
  1369. * htt_tx_preamble_type enum. For example, to allow the target
  1370. * to transmit the frame as either CCK or OFDM, this field would
  1371. * be set to
  1372. * (1 << htt_tx_preamble_type_ofdm) |
  1373. * (1 << htt_tx_preamble_type_cck)
  1374. */
  1375. preamble_type_mask: 4,
  1376. reserved1_31_29: 3; /* unused, set to 0x0 */
  1377. /* DWORD 2: tx chain mask, tx retries */
  1378. A_UINT32
  1379. /* chain_mask - specify which chains to transmit from */
  1380. chain_mask: 4,
  1381. /* retry_limit -
  1382. * Specify the maximum number of transmissions, including the
  1383. * initial transmission, to attempt before giving up if no ack
  1384. * is received.
  1385. * If the tx rate is specified, then all retries shall use the
  1386. * same rate as the initial transmission.
  1387. * If no tx rate is specified, the target can choose whether to
  1388. * retain the original rate during the retransmissions, or to
  1389. * fall back to a more robust rate.
  1390. */
  1391. retry_limit: 4,
  1392. /* bandwidth_mask -
  1393. * Specify what channel widths may be used for the transmission.
  1394. * A value of zero indicates "don't care" - the target may choose
  1395. * the transmission bandwidth.
  1396. * The bits within this mask correspond to the htt_tx_bandwidth
  1397. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1398. * The bandwidth_mask must be consistent with the preamble_type_mask
  1399. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1400. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1401. */
  1402. bandwidth_mask: 6,
  1403. reserved2_31_14: 18; /* unused, set to 0x0 */
  1404. /* DWORD 3: tx expiry time (TSF) LSBs */
  1405. A_UINT32 expire_tsf_lo;
  1406. /* DWORD 4: tx expiry time (TSF) MSBs */
  1407. A_UINT32 expire_tsf_hi;
  1408. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1409. } POSTPACK;
  1410. /* DWORD 0 */
  1411. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1412. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1413. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1414. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1415. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1416. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1417. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1418. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1419. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1420. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1421. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1422. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1423. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1424. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1425. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1426. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1427. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1428. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1429. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1430. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1431. /* DWORD 1 */
  1432. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1433. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1434. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1435. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1436. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1437. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1438. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1439. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1440. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1441. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1442. /* DWORD 2 */
  1443. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1444. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1445. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1446. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1447. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1448. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1449. /* DWORD 0 */
  1450. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1451. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1452. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1453. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1454. do { \
  1455. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1456. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1457. } while (0)
  1458. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1459. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1460. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1461. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1462. do { \
  1463. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1464. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1465. } while (0)
  1466. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1467. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1468. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1469. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1470. do { \
  1471. HTT_CHECK_SET_VAL( \
  1472. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1473. ((_var) |= ((_val) \
  1474. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1475. } while (0)
  1476. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1477. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1478. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1479. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1480. do { \
  1481. HTT_CHECK_SET_VAL( \
  1482. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1483. ((_var) |= ((_val) \
  1484. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1485. } while (0)
  1486. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1487. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1488. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1489. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1490. do { \
  1491. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1492. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1493. } while (0)
  1494. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1495. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1496. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1497. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1498. do { \
  1499. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1500. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1501. } while (0)
  1502. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1503. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1504. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1505. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1506. do { \
  1507. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1508. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1509. } while (0)
  1510. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1511. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1512. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1514. do { \
  1515. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1516. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1517. } while (0)
  1518. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1519. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1520. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1521. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1522. do { \
  1523. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1524. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1525. } while (0)
  1526. /* DWORD 1 */
  1527. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1528. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1529. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1530. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1531. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1532. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1533. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1534. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1535. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1536. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1537. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1538. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1539. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1540. do { \
  1541. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1542. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1543. } while (0)
  1544. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1545. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1546. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1547. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1548. do { \
  1549. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1550. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1551. } while (0)
  1552. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1553. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1554. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1555. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1556. do { \
  1557. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1558. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1559. } while (0)
  1560. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1561. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1562. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1563. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1564. do { \
  1565. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1566. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1567. } while (0)
  1568. /* DWORD 2 */
  1569. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1570. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1571. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1572. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1573. do { \
  1574. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1575. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1576. } while (0)
  1577. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1578. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1579. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1580. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1581. do { \
  1582. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1583. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1584. } while (0)
  1585. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1586. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1587. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1588. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1589. do { \
  1590. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1591. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1592. } while (0)
  1593. typedef enum {
  1594. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1595. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1596. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1597. } htt_11ax_ltf_subtype_t;
  1598. typedef enum {
  1599. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1600. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1601. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1602. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1603. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1604. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1605. } htt_tx_ext2_preamble_type_t;
  1606. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1607. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1608. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1609. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1610. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1611. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1612. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1613. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1614. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1615. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1616. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1617. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1618. /**
  1619. * @brief HTT tx MSDU extension descriptor v2
  1620. * @details
  1621. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1622. * is received as tcl_exit_base->host_meta_info in firmware.
  1623. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1624. * are already part of tcl_exit_base.
  1625. */
  1626. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1627. /* DWORD 0: flags */
  1628. A_UINT32
  1629. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1630. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1631. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1632. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1633. valid_retries : 1, /* if set, tx retries spec is valid */
  1634. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1635. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1636. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1637. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1638. valid_key_flags : 1, /* if set, key flags is valid */
  1639. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1640. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1641. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1642. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1643. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1644. 1 = ENCRYPT,
  1645. 2 ~ 3 - Reserved */
  1646. /* retry_limit -
  1647. * Specify the maximum number of transmissions, including the
  1648. * initial transmission, to attempt before giving up if no ack
  1649. * is received.
  1650. * If the tx rate is specified, then all retries shall use the
  1651. * same rate as the initial transmission.
  1652. * If no tx rate is specified, the target can choose whether to
  1653. * retain the original rate during the retransmissions, or to
  1654. * fall back to a more robust rate.
  1655. */
  1656. retry_limit : 4,
  1657. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1658. * Valid only for 11ax preamble types HE_SU
  1659. * and HE_EXT_SU
  1660. */
  1661. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1662. * Valid only for 11ax preamble types HE_SU
  1663. * and HE_EXT_SU
  1664. */
  1665. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1666. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1667. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1668. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1669. */
  1670. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1671. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1672. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1673. * Use cases:
  1674. * Any time firmware uses TQM-BYPASS for Data
  1675. * TID, firmware expect host to set this bit.
  1676. */
  1677. /* DWORD 1: tx power, tx rate */
  1678. A_UINT32
  1679. power : 8, /* unit of the power field is 0.5 dbm
  1680. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1681. * signed value ranging from -64dbm to 63.5 dbm
  1682. */
  1683. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1684. * Setting more than one MCS isn't currently
  1685. * supported by the target (but is supported
  1686. * in the interface in case in the future
  1687. * the target supports specifications of
  1688. * a limited set of MCS values.
  1689. */
  1690. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1691. * Setting more than one Nss isn't currently
  1692. * supported by the target (but is supported
  1693. * in the interface in case in the future
  1694. * the target supports specifications of
  1695. * a limited set of Nss values.
  1696. */
  1697. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1698. update_peer_cache : 1; /* When set these custom values will be
  1699. * used for all packets, until the next
  1700. * update via this ext header.
  1701. * This is to make sure not all packets
  1702. * need to include this header.
  1703. */
  1704. /* DWORD 2: tx chain mask, tx retries */
  1705. A_UINT32
  1706. /* chain_mask - specify which chains to transmit from */
  1707. chain_mask : 8,
  1708. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1709. * TODO: Update Enum values for key_flags
  1710. */
  1711. /*
  1712. * Channel frequency: This identifies the desired channel
  1713. * frequency (in MHz) for tx frames. This is used by FW to help
  1714. * determine when it is safe to transmit or drop frames for
  1715. * off-channel operation.
  1716. * The default value of zero indicates to FW that the corresponding
  1717. * VDEV's home channel (if there is one) is the desired channel
  1718. * frequency.
  1719. */
  1720. chanfreq : 16;
  1721. /* DWORD 3: tx expiry time (TSF) LSBs */
  1722. A_UINT32 expire_tsf_lo;
  1723. /* DWORD 4: tx expiry time (TSF) MSBs */
  1724. A_UINT32 expire_tsf_hi;
  1725. /* DWORD 5: flags to control routing / processing of the MSDU */
  1726. A_UINT32
  1727. /* learning_frame
  1728. * When this flag is set, this frame will be dropped by FW
  1729. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1730. */
  1731. learning_frame : 1,
  1732. /* send_as_standalone
  1733. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1734. * i.e. with no A-MSDU or A-MPDU aggregation.
  1735. * The scope is extended to other use-cases.
  1736. */
  1737. send_as_standalone : 1,
  1738. /* is_host_opaque_valid
  1739. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1740. * with valid information.
  1741. */
  1742. is_host_opaque_valid : 1,
  1743. rsvd0 : 29;
  1744. /* DWORD 6 : Host opaque cookie for special frames */
  1745. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1746. rsvd1 : 16;
  1747. /*
  1748. * This structure can be expanded further up to 40 bytes
  1749. * by adding further DWORDs as needed.
  1750. */
  1751. } POSTPACK;
  1752. /* DWORD 0 */
  1753. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1754. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1755. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1756. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1757. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1758. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1759. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1760. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1761. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1762. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1763. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1764. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1765. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1766. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1767. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1768. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1769. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1770. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1771. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1772. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1773. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1774. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1775. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1776. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1777. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1778. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1779. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1780. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1781. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1782. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1783. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1784. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1785. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1786. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1787. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1788. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1789. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1790. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1791. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1792. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1793. /* DWORD 1 */
  1794. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1795. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1796. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1797. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1798. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1799. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1800. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1801. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1802. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1803. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1804. /* DWORD 2 */
  1805. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1806. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1807. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1808. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1809. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1810. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1811. /* DWORD 5 */
  1812. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1813. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1814. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1815. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1816. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1818. /* DWORD 6 */
  1819. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1820. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1821. /* DWORD 0 */
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1823. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1824. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1826. do { \
  1827. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1828. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1829. } while (0)
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1831. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1832. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1833. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1834. do { \
  1835. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1836. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1837. } while (0)
  1838. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1839. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1840. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1841. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1842. do { \
  1843. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1844. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1845. } while (0)
  1846. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1847. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1848. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1849. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1850. do { \
  1851. HTT_CHECK_SET_VAL( \
  1852. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1853. ((_var) |= ((_val) \
  1854. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1855. } while (0)
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1857. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1858. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1860. do { \
  1861. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1862. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1863. } while (0)
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1865. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1866. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1868. do { \
  1869. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1870. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1871. } while (0)
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1873. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1874. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1876. do { \
  1877. HTT_CHECK_SET_VAL( \
  1878. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1879. ((_var) |= ((_val) \
  1880. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1881. } while (0)
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1883. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1884. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1885. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1886. do { \
  1887. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1888. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1889. } while (0)
  1890. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1891. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1892. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1893. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1894. do { \
  1895. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1896. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1897. } while (0)
  1898. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1899. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1900. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1901. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1902. do { \
  1903. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1904. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1905. } while (0)
  1906. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1907. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1908. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1909. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1910. do { \
  1911. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1912. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1913. } while (0)
  1914. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1915. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1916. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1917. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1918. do { \
  1919. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1920. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1921. } while (0)
  1922. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1923. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1924. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1926. do { \
  1927. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1928. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1929. } while (0)
  1930. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1931. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1932. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1933. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1934. do { \
  1935. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1936. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1937. } while (0)
  1938. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1939. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1940. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  1941. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  1942. do { \
  1943. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  1944. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  1945. } while (0)
  1946. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  1947. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  1948. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  1949. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  1950. do { \
  1951. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  1952. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  1953. } while (0)
  1954. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  1955. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  1956. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  1957. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  1958. do { \
  1959. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  1960. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  1961. } while (0)
  1962. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  1963. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  1964. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  1965. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  1966. do { \
  1967. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  1968. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  1969. } while (0)
  1970. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  1971. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  1972. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  1973. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  1974. do { \
  1975. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  1976. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  1977. } while (0)
  1978. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  1979. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  1980. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  1981. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  1982. do { \
  1983. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  1984. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  1985. } while (0)
  1986. /* DWORD 1 */
  1987. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  1988. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  1989. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  1990. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  1991. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  1992. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  1993. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  1994. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  1995. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  1996. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  1997. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  1998. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  1999. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2000. do { \
  2001. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2002. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2003. } while (0)
  2004. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2005. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2006. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2007. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2008. do { \
  2009. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2010. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2011. } while (0)
  2012. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2013. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2014. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2015. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2016. do { \
  2017. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2018. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2019. } while (0)
  2020. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2021. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2022. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2023. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2024. do { \
  2025. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2026. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2027. } while (0)
  2028. /* DWORD 2 */
  2029. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2030. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2031. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2032. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2033. do { \
  2034. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2035. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2036. } while (0)
  2037. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2038. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2039. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2040. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2041. do { \
  2042. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2043. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2044. } while (0)
  2045. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2046. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2047. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2048. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2049. do { \
  2050. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2051. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2052. } while (0)
  2053. /* DWORD 5 */
  2054. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2055. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2056. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2057. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2058. do { \
  2059. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2060. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2061. } while (0)
  2062. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2063. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2064. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2065. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2066. do { \
  2067. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2068. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2069. } while (0)
  2070. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2071. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2072. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2073. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2074. do { \
  2075. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2076. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2077. } while (0)
  2078. /* DWORD 6 */
  2079. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2080. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2081. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2082. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2083. do { \
  2084. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2085. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2086. } while (0)
  2087. typedef enum {
  2088. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2089. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2090. } htt_tcl_metadata_type;
  2091. /**
  2092. * @brief HTT TCL command number format
  2093. * @details
  2094. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2095. * available to firmware as tcl_exit_base->tcl_status_number.
  2096. * For regular / multicast packets host will send vdev and mac id and for
  2097. * NAWDS packets, host will send peer id.
  2098. * A_UINT32 is used to avoid endianness conversion problems.
  2099. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2100. */
  2101. typedef struct {
  2102. A_UINT32
  2103. type: 1, /* vdev_id based or peer_id based */
  2104. rsvd: 31;
  2105. } htt_tx_tcl_vdev_or_peer_t;
  2106. typedef struct {
  2107. A_UINT32
  2108. type: 1, /* vdev_id based or peer_id based */
  2109. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2110. vdev_id: 8,
  2111. pdev_id: 2,
  2112. host_inspected:1,
  2113. rsvd: 19;
  2114. } htt_tx_tcl_vdev_metadata;
  2115. typedef struct {
  2116. A_UINT32
  2117. type: 1, /* vdev_id based or peer_id based */
  2118. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2119. peer_id: 14,
  2120. rsvd: 16;
  2121. } htt_tx_tcl_peer_metadata;
  2122. PREPACK struct htt_tx_tcl_metadata {
  2123. union {
  2124. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2125. htt_tx_tcl_vdev_metadata vdev_meta;
  2126. htt_tx_tcl_peer_metadata peer_meta;
  2127. };
  2128. } POSTPACK;
  2129. /* DWORD 0 */
  2130. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2131. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2132. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2133. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2134. /* VDEV metadata */
  2135. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2136. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2137. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2138. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2139. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2140. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2141. /* PEER metadata */
  2142. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2143. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2144. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2145. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2146. HTT_TX_TCL_METADATA_TYPE_S)
  2147. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2148. do { \
  2149. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2150. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2151. } while (0)
  2152. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2153. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2154. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2155. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2156. do { \
  2157. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2158. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2159. } while (0)
  2160. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2161. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2162. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2163. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2166. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2167. } while (0)
  2168. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2169. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2170. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2171. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2172. do { \
  2173. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2174. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2175. } while (0)
  2176. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2177. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2178. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2179. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2180. do { \
  2181. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2182. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2183. } while (0)
  2184. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2185. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2186. HTT_TX_TCL_METADATA_PEER_ID_S)
  2187. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2188. do { \
  2189. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2190. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2191. } while (0)
  2192. typedef enum {
  2193. HTT_TX_FW2WBM_TX_STATUS_OK,
  2194. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2195. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2196. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2197. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2198. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2199. HTT_TX_FW2WBM_TX_STATUS_MAX
  2200. } htt_tx_fw2wbm_tx_status_t;
  2201. typedef enum {
  2202. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2203. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2204. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2205. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2206. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2207. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2208. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2209. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2210. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2211. } htt_tx_fw2wbm_reinject_reason_t;
  2212. /**
  2213. * @brief HTT TX WBM Completion from firmware to host
  2214. * @details
  2215. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2216. * DWORD 3 and 4 for software based completions (Exception frames and
  2217. * TQM bypass frames)
  2218. * For software based completions, wbm_release_ring->release_source_module will
  2219. * be set to release_source_fw
  2220. */
  2221. PREPACK struct htt_tx_wbm_completion {
  2222. A_UINT32
  2223. sch_cmd_id: 24,
  2224. exception_frame: 1, /* If set, this packet was queued via exception path */
  2225. rsvd0_31_25: 7;
  2226. A_UINT32
  2227. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2228. * reception of an ACK or BA, this field indicates
  2229. * the RSSI of the received ACK or BA frame.
  2230. * When the frame is removed as result of a direct
  2231. * remove command from the SW, this field is set
  2232. * to 0x0 (which is never a valid value when real
  2233. * RSSI is available).
  2234. * Units: dB w.r.t noise floor
  2235. */
  2236. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2237. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2238. rsvd1_31_16: 16;
  2239. } POSTPACK;
  2240. /* DWORD 0 */
  2241. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2242. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2243. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2244. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2245. /* DWORD 1 */
  2246. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2247. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2248. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2249. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2250. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2251. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2252. /* DWORD 0 */
  2253. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2254. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2255. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2256. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2257. do { \
  2258. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2259. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2260. } while (0)
  2261. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2262. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2263. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2264. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2265. do { \
  2266. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2267. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2268. } while (0)
  2269. /* DWORD 1 */
  2270. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2271. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2272. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2273. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2274. do { \
  2275. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2276. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2277. } while (0)
  2278. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2279. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2280. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2281. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2282. do { \
  2283. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2284. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2285. } while (0)
  2286. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2287. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2288. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2289. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2290. do { \
  2291. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2292. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2293. } while (0)
  2294. /**
  2295. * @brief HTT TX WBM Completion from firmware to host
  2296. * @details
  2297. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2298. * (WBM) offload HW.
  2299. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2300. * For software based completions, release_source_module will
  2301. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2302. * struct wbm_release_ring and then switch to this after looking at
  2303. * release_source_module.
  2304. */
  2305. PREPACK struct htt_tx_wbm_completion_v2 {
  2306. A_UINT32
  2307. used_by_hw0; /* Refer to struct wbm_release_ring */
  2308. A_UINT32
  2309. used_by_hw1; /* Refer to struct wbm_release_ring */
  2310. A_UINT32
  2311. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2312. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2313. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2314. exception_frame: 1,
  2315. rsvd0: 12, /* For future use */
  2316. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2317. rsvd1: 1; /* For future use */
  2318. A_UINT32
  2319. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2320. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2321. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2322. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2323. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2324. */
  2325. A_UINT32
  2326. data1: 32;
  2327. A_UINT32
  2328. data2: 32;
  2329. A_UINT32
  2330. used_by_hw3; /* Refer to struct wbm_release_ring */
  2331. } POSTPACK;
  2332. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2333. /* DWORD 3 */
  2334. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2335. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2336. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2337. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2338. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2339. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2340. /* DWORD 3 */
  2341. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2342. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2343. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2344. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2345. do { \
  2346. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2347. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2348. } while (0)
  2349. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2350. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2351. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2352. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2353. do { \
  2354. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2355. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2356. } while (0)
  2357. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2358. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2359. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2360. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2361. do { \
  2362. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2363. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2364. } while (0)
  2365. /**
  2366. * @brief HTT TX WBM transmit status from firmware to host
  2367. * @details
  2368. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2369. * (WBM) offload HW.
  2370. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2371. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2372. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2373. */
  2374. PREPACK struct htt_tx_wbm_transmit_status {
  2375. A_UINT32
  2376. sch_cmd_id: 24,
  2377. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2378. * reception of an ACK or BA, this field indicates
  2379. * the RSSI of the received ACK or BA frame.
  2380. * When the frame is removed as result of a direct
  2381. * remove command from the SW, this field is set
  2382. * to 0x0 (which is never a valid value when real
  2383. * RSSI is available).
  2384. * Units: dB w.r.t noise floor
  2385. */
  2386. A_UINT32
  2387. sw_peer_id: 16,
  2388. tid_num: 5,
  2389. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2390. * and tid_num fields contain valid data.
  2391. * If this "valid" flag is not set, the
  2392. * sw_peer_id and tid_num fields must be ignored.
  2393. */
  2394. mcast: 1,
  2395. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2396. * contains valid data.
  2397. */
  2398. reserved0: 8;
  2399. A_UINT32
  2400. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2401. * packets in the wbm completion path
  2402. */
  2403. } POSTPACK;
  2404. /* DWORD 4 */
  2405. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2406. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2407. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2408. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2409. /* DWORD 5 */
  2410. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2411. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2412. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2413. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2414. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2415. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2416. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2417. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2418. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2419. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2420. /* DWORD 4 */
  2421. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2422. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2423. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2424. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2425. do { \
  2426. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2427. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2428. } while (0)
  2429. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2430. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2431. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2432. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2433. do { \
  2434. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2435. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2436. } while (0)
  2437. /* DWORD 5 */
  2438. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2439. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2440. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2441. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2442. do { \
  2443. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2444. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2445. } while (0)
  2446. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2447. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2448. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2449. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2450. do { \
  2451. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2452. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2453. } while (0)
  2454. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2455. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2456. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2457. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2458. do { \
  2459. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2460. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2461. } while (0)
  2462. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2463. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2464. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2465. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2466. do { \
  2467. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2468. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2469. } while (0)
  2470. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2471. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2472. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2473. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2474. do { \
  2475. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2476. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2477. } while (0)
  2478. /**
  2479. * @brief HTT TX WBM reinject status from firmware to host
  2480. * @details
  2481. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2482. * (WBM) offload HW.
  2483. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2484. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2485. */
  2486. PREPACK struct htt_tx_wbm_reinject_status {
  2487. A_UINT32
  2488. reserved0: 32;
  2489. A_UINT32
  2490. reserved1: 32;
  2491. A_UINT32
  2492. reserved2: 32;
  2493. } POSTPACK;
  2494. /**
  2495. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2496. * @details
  2497. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2498. * (WBM) offload HW.
  2499. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2500. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2501. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2502. * STA side.
  2503. */
  2504. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2505. A_UINT32
  2506. mec_sa_addr_31_0;
  2507. A_UINT32
  2508. mec_sa_addr_47_32: 16,
  2509. sa_ast_index: 16;
  2510. A_UINT32
  2511. vdev_id: 8,
  2512. reserved0: 24;
  2513. } POSTPACK;
  2514. /* DWORD 4 - mec_sa_addr_31_0 */
  2515. /* DWORD 5 */
  2516. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2517. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2518. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2519. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2520. /* DWORD 6 */
  2521. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2522. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2523. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2524. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2525. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2526. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2527. do { \
  2528. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2529. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2530. } while (0)
  2531. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2532. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2533. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2534. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2535. do { \
  2536. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2537. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2538. } while (0)
  2539. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2540. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2541. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2542. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2543. do { \
  2544. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2545. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2546. } while (0)
  2547. typedef enum {
  2548. TX_FLOW_PRIORITY_BE,
  2549. TX_FLOW_PRIORITY_HIGH,
  2550. TX_FLOW_PRIORITY_LOW,
  2551. } htt_tx_flow_priority_t;
  2552. typedef enum {
  2553. TX_FLOW_LATENCY_SENSITIVE,
  2554. TX_FLOW_LATENCY_INSENSITIVE,
  2555. } htt_tx_flow_latency_t;
  2556. typedef enum {
  2557. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2558. TX_FLOW_INTERACTIVE_TRAFFIC,
  2559. TX_FLOW_PERIODIC_TRAFFIC,
  2560. TX_FLOW_BURSTY_TRAFFIC,
  2561. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2562. } htt_tx_flow_traffic_pattern_t;
  2563. /**
  2564. * @brief HTT TX Flow search metadata format
  2565. * @details
  2566. * Host will set this metadata in flow table's flow search entry along with
  2567. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2568. * firmware and TQM ring if the flow search entry wins.
  2569. * This metadata is available to firmware in that first MSDU's
  2570. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2571. * to one of the available flows for specific tid and returns the tqm flow
  2572. * pointer as part of htt_tx_map_flow_info message.
  2573. */
  2574. PREPACK struct htt_tx_flow_metadata {
  2575. A_UINT32
  2576. rsvd0_1_0: 2,
  2577. tid: 4,
  2578. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2579. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2580. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2581. * Else choose final tid based on latency, priority.
  2582. */
  2583. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2584. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2585. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2586. } POSTPACK;
  2587. /* DWORD 0 */
  2588. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2589. #define HTT_TX_FLOW_METADATA_TID_S 2
  2590. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2591. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2592. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2593. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2594. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2595. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2596. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2597. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2598. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2599. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2600. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2601. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2602. /* DWORD 0 */
  2603. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2604. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2605. HTT_TX_FLOW_METADATA_TID_S)
  2606. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2607. do { \
  2608. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2609. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2610. } while (0)
  2611. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2612. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2613. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2614. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2615. do { \
  2616. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2617. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2618. } while (0)
  2619. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2620. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2621. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2622. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2623. do { \
  2624. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2625. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2626. } while (0)
  2627. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2628. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2629. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2630. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2631. do { \
  2632. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2633. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2634. } while (0)
  2635. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2636. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2637. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2638. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2639. do { \
  2640. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2641. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2642. } while (0)
  2643. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2644. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2645. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2646. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2647. do { \
  2648. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2649. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2650. } while (0)
  2651. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2652. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2653. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2654. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2655. do { \
  2656. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2657. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2658. } while (0)
  2659. /**
  2660. * @brief host -> target ADD WDS Entry
  2661. *
  2662. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2663. *
  2664. * @brief host -> target DELETE WDS Entry
  2665. *
  2666. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2667. *
  2668. * @details
  2669. * HTT wds entry from source port learning
  2670. * Host will learn wds entries from rx and send this message to firmware
  2671. * to enable firmware to configure/delete AST entries for wds clients.
  2672. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2673. * and when SA's entry is deleted, firmware removes this AST entry
  2674. *
  2675. * The message would appear as follows:
  2676. *
  2677. * |31 30|29 |17 16|15 8|7 0|
  2678. * |----------------+----------------+----------------+----------------|
  2679. * | rsvd0 |PDVID| vdev_id | msg_type |
  2680. * |-------------------------------------------------------------------|
  2681. * | sa_addr_31_0 |
  2682. * |-------------------------------------------------------------------|
  2683. * | | ta_peer_id | sa_addr_47_32 |
  2684. * |-------------------------------------------------------------------|
  2685. * Where PDVID = pdev_id
  2686. *
  2687. * The message is interpreted as follows:
  2688. *
  2689. * dword0 - b'0:7 - msg_type: This will be set to
  2690. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2691. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2692. *
  2693. * dword0 - b'8:15 - vdev_id
  2694. *
  2695. * dword0 - b'16:17 - pdev_id
  2696. *
  2697. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2698. *
  2699. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  2700. *
  2701. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  2702. *
  2703. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  2704. */
  2705. PREPACK struct htt_wds_entry {
  2706. A_UINT32
  2707. msg_type: 8,
  2708. vdev_id: 8,
  2709. pdev_id: 2,
  2710. rsvd0: 14;
  2711. A_UINT32 sa_addr_31_0;
  2712. A_UINT32
  2713. sa_addr_47_32: 16,
  2714. ta_peer_id: 14,
  2715. rsvd2: 2;
  2716. } POSTPACK;
  2717. /* DWORD 0 */
  2718. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  2719. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  2720. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  2721. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  2722. /* DWORD 2 */
  2723. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  2724. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  2725. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  2726. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  2727. /* DWORD 0 */
  2728. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  2729. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  2730. HTT_WDS_ENTRY_VDEV_ID_S)
  2731. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  2732. do { \
  2733. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  2734. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  2735. } while (0)
  2736. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  2737. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  2738. HTT_WDS_ENTRY_PDEV_ID_S)
  2739. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  2740. do { \
  2741. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  2742. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  2743. } while (0)
  2744. /* DWORD 2 */
  2745. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  2746. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  2747. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  2748. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  2749. do { \
  2750. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  2751. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  2752. } while (0)
  2753. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  2754. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  2755. HTT_WDS_ENTRY_TA_PEER_ID_S)
  2756. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  2757. do { \
  2758. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  2759. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  2760. } while (0)
  2761. /**
  2762. * @brief MAC DMA rx ring setup specification
  2763. *
  2764. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  2765. *
  2766. * @details
  2767. * To allow for dynamic rx ring reconfiguration and to avoid race
  2768. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  2769. * it uses. Instead, it sends this message to the target, indicating how
  2770. * the rx ring used by the host should be set up and maintained.
  2771. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  2772. * specifications.
  2773. *
  2774. * |31 16|15 8|7 0|
  2775. * |---------------------------------------------------------------|
  2776. * header: | reserved | num rings | msg type |
  2777. * |---------------------------------------------------------------|
  2778. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  2779. #if HTT_PADDR64
  2780. * | FW_IDX shadow register physical address (bits 63:32) |
  2781. #endif
  2782. * |---------------------------------------------------------------|
  2783. * | rx ring base physical address (bits 31:0) |
  2784. #if HTT_PADDR64
  2785. * | rx ring base physical address (bits 63:32) |
  2786. #endif
  2787. * |---------------------------------------------------------------|
  2788. * | rx ring buffer size | rx ring length |
  2789. * |---------------------------------------------------------------|
  2790. * | FW_IDX initial value | enabled flags |
  2791. * |---------------------------------------------------------------|
  2792. * | MSDU payload offset | 802.11 header offset |
  2793. * |---------------------------------------------------------------|
  2794. * | PPDU end offset | PPDU start offset |
  2795. * |---------------------------------------------------------------|
  2796. * | MPDU end offset | MPDU start offset |
  2797. * |---------------------------------------------------------------|
  2798. * | MSDU end offset | MSDU start offset |
  2799. * |---------------------------------------------------------------|
  2800. * | frag info offset | rx attention offset |
  2801. * |---------------------------------------------------------------|
  2802. * payload 2, if present, has the same format as payload 1
  2803. * Header fields:
  2804. * - MSG_TYPE
  2805. * Bits 7:0
  2806. * Purpose: identifies this as an rx ring configuration message
  2807. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  2808. * - NUM_RINGS
  2809. * Bits 15:8
  2810. * Purpose: indicates whether the host is setting up one rx ring or two
  2811. * Value: 1 or 2
  2812. * Payload:
  2813. * for systems using 64-bit format for bus addresses:
  2814. * - IDX_SHADOW_REG_PADDR_LO
  2815. * Bits 31:0
  2816. * Value: lower 4 bytes of physical address of the host's
  2817. * FW_IDX shadow register
  2818. * - IDX_SHADOW_REG_PADDR_HI
  2819. * Bits 31:0
  2820. * Value: upper 4 bytes of physical address of the host's
  2821. * FW_IDX shadow register
  2822. * - RING_BASE_PADDR_LO
  2823. * Bits 31:0
  2824. * Value: lower 4 bytes of physical address of the host's rx ring
  2825. * - RING_BASE_PADDR_HI
  2826. * Bits 31:0
  2827. * Value: uppper 4 bytes of physical address of the host's rx ring
  2828. * for systems using 32-bit format for bus addresses:
  2829. * - IDX_SHADOW_REG_PADDR
  2830. * Bits 31:0
  2831. * Value: physical address of the host's FW_IDX shadow register
  2832. * - RING_BASE_PADDR
  2833. * Bits 31:0
  2834. * Value: physical address of the host's rx ring
  2835. * - RING_LEN
  2836. * Bits 15:0
  2837. * Value: number of elements in the rx ring
  2838. * - RING_BUF_SZ
  2839. * Bits 31:16
  2840. * Value: size of the buffers referenced by the rx ring, in byte units
  2841. * - ENABLED_FLAGS
  2842. * Bits 15:0
  2843. * Value: 1-bit flags to show whether different rx fields are enabled
  2844. * bit 0: 802.11 header enabled (1) or disabled (0)
  2845. * bit 1: MSDU payload enabled (1) or disabled (0)
  2846. * bit 2: PPDU start enabled (1) or disabled (0)
  2847. * bit 3: PPDU end enabled (1) or disabled (0)
  2848. * bit 4: MPDU start enabled (1) or disabled (0)
  2849. * bit 5: MPDU end enabled (1) or disabled (0)
  2850. * bit 6: MSDU start enabled (1) or disabled (0)
  2851. * bit 7: MSDU end enabled (1) or disabled (0)
  2852. * bit 8: rx attention enabled (1) or disabled (0)
  2853. * bit 9: frag info enabled (1) or disabled (0)
  2854. * bit 10: unicast rx enabled (1) or disabled (0)
  2855. * bit 11: multicast rx enabled (1) or disabled (0)
  2856. * bit 12: ctrl rx enabled (1) or disabled (0)
  2857. * bit 13: mgmt rx enabled (1) or disabled (0)
  2858. * bit 14: null rx enabled (1) or disabled (0)
  2859. * bit 15: phy data rx enabled (1) or disabled (0)
  2860. * - IDX_INIT_VAL
  2861. * Bits 31:16
  2862. * Purpose: Specify the initial value for the FW_IDX.
  2863. * Value: the number of buffers initially present in the host's rx ring
  2864. * - OFFSET_802_11_HDR
  2865. * Bits 15:0
  2866. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  2867. * - OFFSET_MSDU_PAYLOAD
  2868. * Bits 31:16
  2869. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  2870. * - OFFSET_PPDU_START
  2871. * Bits 15:0
  2872. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  2873. * - OFFSET_PPDU_END
  2874. * Bits 31:16
  2875. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  2876. * - OFFSET_MPDU_START
  2877. * Bits 15:0
  2878. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  2879. * - OFFSET_MPDU_END
  2880. * Bits 31:16
  2881. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  2882. * - OFFSET_MSDU_START
  2883. * Bits 15:0
  2884. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  2885. * - OFFSET_MSDU_END
  2886. * Bits 31:16
  2887. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  2888. * - OFFSET_RX_ATTN
  2889. * Bits 15:0
  2890. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  2891. * - OFFSET_FRAG_INFO
  2892. * Bits 31:16
  2893. * Value: offset in QUAD-bytes of frag info table
  2894. */
  2895. /* header fields */
  2896. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  2897. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  2898. /* payload fields */
  2899. /* for systems using a 64-bit format for bus addresses */
  2900. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  2901. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  2902. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  2903. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  2904. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  2905. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  2906. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  2907. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  2908. /* for systems using a 32-bit format for bus addresses */
  2909. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  2910. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  2911. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  2912. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  2913. #define HTT_RX_RING_CFG_LEN_M 0xffff
  2914. #define HTT_RX_RING_CFG_LEN_S 0
  2915. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  2916. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  2917. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  2918. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  2919. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  2920. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  2921. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  2922. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  2923. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  2924. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  2925. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  2926. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  2927. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  2928. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  2929. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  2930. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  2931. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  2932. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  2933. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  2934. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  2935. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  2936. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  2937. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  2938. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  2939. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  2940. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  2941. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  2942. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  2943. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  2944. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  2945. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  2946. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  2947. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  2948. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  2949. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  2950. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  2951. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  2952. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  2953. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  2954. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  2955. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  2956. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  2957. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  2958. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  2959. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  2960. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  2961. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  2962. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  2963. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  2964. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  2965. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  2966. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  2967. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  2968. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  2969. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  2970. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  2971. #define HTT_RX_RING_CFG_HDR_BYTES 4
  2972. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  2973. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  2974. #if HTT_PADDR64
  2975. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  2976. #else
  2977. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  2978. #endif
  2979. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  2980. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  2981. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  2982. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  2983. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  2984. do { \
  2985. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  2986. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  2987. } while (0)
  2988. /* degenerate case for 32-bit fields */
  2989. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  2990. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  2991. ((_var) = (_val))
  2992. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  2993. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  2994. ((_var) = (_val))
  2995. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  2996. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  2997. ((_var) = (_val))
  2998. /* degenerate case for 32-bit fields */
  2999. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3000. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3001. ((_var) = (_val))
  3002. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3003. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3004. ((_var) = (_val))
  3005. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3006. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3007. ((_var) = (_val))
  3008. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3009. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3010. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3011. do { \
  3012. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3013. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3014. } while (0)
  3015. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3016. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3017. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3018. do { \
  3019. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3020. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3021. } while (0)
  3022. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3023. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3024. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3025. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3026. do { \
  3027. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3028. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3029. } while (0)
  3030. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3031. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3032. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3033. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3034. do { \
  3035. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3036. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3037. } while (0)
  3038. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3039. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3040. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3041. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3042. do { \
  3043. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3044. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3045. } while (0)
  3046. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3047. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3048. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3049. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3050. do { \
  3051. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3052. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3053. } while (0)
  3054. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3055. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3056. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3057. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3058. do { \
  3059. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3060. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3061. } while (0)
  3062. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3063. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3064. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3065. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3066. do { \
  3067. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3068. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3069. } while (0)
  3070. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3071. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3072. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3073. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3074. do { \
  3075. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3076. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3077. } while (0)
  3078. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3079. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3080. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3081. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3082. do { \
  3083. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3084. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3085. } while (0)
  3086. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3087. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3088. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3089. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3090. do { \
  3091. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3092. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3093. } while (0)
  3094. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3095. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3096. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3097. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3098. do { \
  3099. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3100. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3101. } while (0)
  3102. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3103. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3104. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3105. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3106. do { \
  3107. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3108. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3109. } while (0)
  3110. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3111. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3112. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3113. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3114. do { \
  3115. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3116. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3117. } while (0)
  3118. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3119. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3120. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3121. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3122. do { \
  3123. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3124. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3125. } while (0)
  3126. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3127. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3128. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3129. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3130. do { \
  3131. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3132. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3133. } while (0)
  3134. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3135. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3136. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3137. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3138. do { \
  3139. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3140. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3141. } while (0)
  3142. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3143. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3144. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3145. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3146. do { \
  3147. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3148. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3149. } while (0)
  3150. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3151. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3152. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3153. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3154. do { \
  3155. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3156. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3157. } while (0)
  3158. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3159. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3160. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3161. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3162. do { \
  3163. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3164. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3165. } while (0)
  3166. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3167. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3168. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3169. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3170. do { \
  3171. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3172. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3173. } while (0)
  3174. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3175. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3176. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3177. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3178. do { \
  3179. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3180. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3181. } while (0)
  3182. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3183. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3184. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3185. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3186. do { \
  3187. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3188. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3189. } while (0)
  3190. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3191. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3192. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3193. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3194. do { \
  3195. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3196. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3197. } while (0)
  3198. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3199. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3200. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3201. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3202. do { \
  3203. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3204. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3205. } while (0)
  3206. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3207. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3208. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3209. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3210. do { \
  3211. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3212. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3213. } while (0)
  3214. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3215. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3216. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3217. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3218. do { \
  3219. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3220. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3221. } while (0)
  3222. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3223. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3224. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3225. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3226. do { \
  3227. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3228. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3229. } while (0)
  3230. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3231. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3232. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3233. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3234. do { \
  3235. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3236. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3237. } while (0)
  3238. /**
  3239. * @brief host -> target FW statistics retrieve
  3240. *
  3241. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3242. *
  3243. * @details
  3244. * The following field definitions describe the format of the HTT host
  3245. * to target FW stats retrieve message. The message specifies the type of
  3246. * stats host wants to retrieve.
  3247. *
  3248. * |31 24|23 16|15 8|7 0|
  3249. * |-----------------------------------------------------------|
  3250. * | stats types request bitmask | msg type |
  3251. * |-----------------------------------------------------------|
  3252. * | stats types reset bitmask | reserved |
  3253. * |-----------------------------------------------------------|
  3254. * | stats type | config value |
  3255. * |-----------------------------------------------------------|
  3256. * | cookie LSBs |
  3257. * |-----------------------------------------------------------|
  3258. * | cookie MSBs |
  3259. * |-----------------------------------------------------------|
  3260. * Header fields:
  3261. * - MSG_TYPE
  3262. * Bits 7:0
  3263. * Purpose: identifies this is a stats upload request message
  3264. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3265. * - UPLOAD_TYPES
  3266. * Bits 31:8
  3267. * Purpose: identifies which types of FW statistics to upload
  3268. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3269. * - RESET_TYPES
  3270. * Bits 31:8
  3271. * Purpose: identifies which types of FW statistics to reset
  3272. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3273. * - CFG_VAL
  3274. * Bits 23:0
  3275. * Purpose: give an opaque configuration value to the specified stats type
  3276. * Value: stats-type specific configuration value
  3277. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3278. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3279. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3280. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3281. * - CFG_STAT_TYPE
  3282. * Bits 31:24
  3283. * Purpose: specify which stats type (if any) the config value applies to
  3284. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3285. * a valid configuration specification
  3286. * - COOKIE_LSBS
  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: LSBs of the opaque cookie specified by the host-side requestor
  3291. * - COOKIE_MSBS
  3292. * Bits 31:0
  3293. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3294. * message with its preceding host->target stats request message.
  3295. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3296. */
  3297. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3298. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3299. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3300. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3301. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3302. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3303. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3304. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3305. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3306. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3307. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3308. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3309. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3310. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3311. do { \
  3312. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3313. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3314. } while (0)
  3315. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3316. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3317. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3318. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3319. do { \
  3320. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3321. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3322. } while (0)
  3323. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3324. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3325. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3326. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3327. do { \
  3328. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3329. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3330. } while (0)
  3331. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3332. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3333. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3334. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3335. do { \
  3336. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3337. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3338. } while (0)
  3339. /**
  3340. * @brief host -> target HTT out-of-band sync request
  3341. *
  3342. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3343. *
  3344. * @details
  3345. * The HTT SYNC tells the target to suspend processing of subsequent
  3346. * HTT host-to-target messages until some other target agent locally
  3347. * informs the target HTT FW that the current sync counter is equal to
  3348. * or greater than (in a modulo sense) the sync counter specified in
  3349. * the SYNC message.
  3350. * This allows other host-target components to synchronize their operation
  3351. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3352. * security key has been downloaded to and activated by the target.
  3353. * In the absence of any explicit synchronization counter value
  3354. * specification, the target HTT FW will use zero as the default current
  3355. * sync value.
  3356. *
  3357. * |31 24|23 16|15 8|7 0|
  3358. * |-----------------------------------------------------------|
  3359. * | reserved | sync count | msg type |
  3360. * |-----------------------------------------------------------|
  3361. * Header fields:
  3362. * - MSG_TYPE
  3363. * Bits 7:0
  3364. * Purpose: identifies this as a sync message
  3365. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3366. * - SYNC_COUNT
  3367. * Bits 15:8
  3368. * Purpose: specifies what sync value the HTT FW will wait for from
  3369. * an out-of-band specification to resume its operation
  3370. * Value: in-band sync counter value to compare against the out-of-band
  3371. * counter spec.
  3372. * The HTT target FW will suspend its host->target message processing
  3373. * as long as
  3374. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3375. */
  3376. #define HTT_H2T_SYNC_MSG_SZ 4
  3377. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3378. #define HTT_H2T_SYNC_COUNT_S 8
  3379. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3380. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3381. HTT_H2T_SYNC_COUNT_S)
  3382. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3383. do { \
  3384. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3385. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3386. } while (0)
  3387. /**
  3388. * @brief host -> target HTT aggregation configuration
  3389. *
  3390. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3391. */
  3392. #define HTT_AGGR_CFG_MSG_SZ 4
  3393. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3394. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3395. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3396. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3397. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3398. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3399. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3400. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3401. do { \
  3402. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3403. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3404. } while (0)
  3405. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3406. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3407. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3408. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3409. do { \
  3410. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3411. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3412. } while (0)
  3413. /**
  3414. * @brief host -> target HTT configure max amsdu info per vdev
  3415. *
  3416. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3417. *
  3418. * @details
  3419. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3420. *
  3421. * |31 21|20 16|15 8|7 0|
  3422. * |-----------------------------------------------------------|
  3423. * | reserved | vdev id | max amsdu | msg type |
  3424. * |-----------------------------------------------------------|
  3425. * Header fields:
  3426. * - MSG_TYPE
  3427. * Bits 7:0
  3428. * Purpose: identifies this as a aggr cfg ex message
  3429. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3430. * - MAX_NUM_AMSDU_SUBFRM
  3431. * Bits 15:8
  3432. * Purpose: max MSDUs per A-MSDU
  3433. * - VDEV_ID
  3434. * Bits 20:16
  3435. * Purpose: ID of the vdev to which this limit is applied
  3436. */
  3437. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3438. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3439. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3440. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3441. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3442. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3443. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3444. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3445. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3446. do { \
  3447. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3448. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3449. } while (0)
  3450. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3451. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3452. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3453. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3454. do { \
  3455. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3456. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3457. } while (0)
  3458. /**
  3459. * @brief HTT WDI_IPA Config Message
  3460. *
  3461. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3462. *
  3463. * @details
  3464. * The HTT WDI_IPA config message is created/sent by host at driver
  3465. * init time. It contains information about data structures used on
  3466. * WDI_IPA TX and RX path.
  3467. * TX CE ring is used for pushing packet metadata from IPA uC
  3468. * to WLAN FW
  3469. * TX Completion ring is used for generating TX completions from
  3470. * WLAN FW to IPA uC
  3471. * RX Indication ring is used for indicating RX packets from FW
  3472. * to IPA uC
  3473. * RX Ring2 is used as either completion ring or as second
  3474. * indication ring. when Ring2 is used as completion ring, IPA uC
  3475. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3476. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3477. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3478. * indicated in RX Indication ring. Please see WDI_IPA specification
  3479. * for more details.
  3480. * |31 24|23 16|15 8|7 0|
  3481. * |----------------+----------------+----------------+----------------|
  3482. * | tx pkt pool size | Rsvd | msg_type |
  3483. * |-------------------------------------------------------------------|
  3484. * | tx comp ring base (bits 31:0) |
  3485. #if HTT_PADDR64
  3486. * | tx comp ring base (bits 63:32) |
  3487. #endif
  3488. * |-------------------------------------------------------------------|
  3489. * | tx comp ring size |
  3490. * |-------------------------------------------------------------------|
  3491. * | tx comp WR_IDX physical address (bits 31:0) |
  3492. #if HTT_PADDR64
  3493. * | tx comp WR_IDX physical address (bits 63:32) |
  3494. #endif
  3495. * |-------------------------------------------------------------------|
  3496. * | tx CE WR_IDX physical address (bits 31:0) |
  3497. #if HTT_PADDR64
  3498. * | tx CE WR_IDX physical address (bits 63:32) |
  3499. #endif
  3500. * |-------------------------------------------------------------------|
  3501. * | rx indication ring base (bits 31:0) |
  3502. #if HTT_PADDR64
  3503. * | rx indication ring base (bits 63:32) |
  3504. #endif
  3505. * |-------------------------------------------------------------------|
  3506. * | rx indication ring size |
  3507. * |-------------------------------------------------------------------|
  3508. * | rx ind RD_IDX physical address (bits 31:0) |
  3509. #if HTT_PADDR64
  3510. * | rx ind RD_IDX physical address (bits 63:32) |
  3511. #endif
  3512. * |-------------------------------------------------------------------|
  3513. * | rx ind WR_IDX physical address (bits 31:0) |
  3514. #if HTT_PADDR64
  3515. * | rx ind WR_IDX physical address (bits 63:32) |
  3516. #endif
  3517. * |-------------------------------------------------------------------|
  3518. * |-------------------------------------------------------------------|
  3519. * | rx ring2 base (bits 31:0) |
  3520. #if HTT_PADDR64
  3521. * | rx ring2 base (bits 63:32) |
  3522. #endif
  3523. * |-------------------------------------------------------------------|
  3524. * | rx ring2 size |
  3525. * |-------------------------------------------------------------------|
  3526. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3527. #if HTT_PADDR64
  3528. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3529. #endif
  3530. * |-------------------------------------------------------------------|
  3531. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3532. #if HTT_PADDR64
  3533. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3534. #endif
  3535. * |-------------------------------------------------------------------|
  3536. *
  3537. * Header fields:
  3538. * Header fields:
  3539. * - MSG_TYPE
  3540. * Bits 7:0
  3541. * Purpose: Identifies this as WDI_IPA config message
  3542. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3543. * - TX_PKT_POOL_SIZE
  3544. * Bits 15:0
  3545. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3546. * WDI_IPA TX path
  3547. * For systems using 32-bit format for bus addresses:
  3548. * - TX_COMP_RING_BASE_ADDR
  3549. * Bits 31:0
  3550. * Purpose: TX Completion Ring base address in DDR
  3551. * - TX_COMP_RING_SIZE
  3552. * Bits 31:0
  3553. * Purpose: TX Completion Ring size (must be power of 2)
  3554. * - TX_COMP_WR_IDX_ADDR
  3555. * Bits 31:0
  3556. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3557. * updates the Write Index for WDI_IPA TX completion ring
  3558. * - TX_CE_WR_IDX_ADDR
  3559. * Bits 31:0
  3560. * Purpose: DDR address where IPA uC
  3561. * updates the WR Index for TX CE ring
  3562. * (needed for fusion platforms)
  3563. * - RX_IND_RING_BASE_ADDR
  3564. * Bits 31:0
  3565. * Purpose: RX Indication Ring base address in DDR
  3566. * - RX_IND_RING_SIZE
  3567. * Bits 31:0
  3568. * Purpose: RX Indication Ring size
  3569. * - RX_IND_RD_IDX_ADDR
  3570. * Bits 31:0
  3571. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3572. * RX indication ring
  3573. * - RX_IND_WR_IDX_ADDR
  3574. * Bits 31:0
  3575. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3576. * updates the Write Index for WDI_IPA RX indication ring
  3577. * - RX_RING2_BASE_ADDR
  3578. * Bits 31:0
  3579. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3580. * - RX_RING2_SIZE
  3581. * Bits 31:0
  3582. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3583. * - RX_RING2_RD_IDX_ADDR
  3584. * Bits 31:0
  3585. * Purpose: If Second RX ring is Indication ring, DDR address where
  3586. * IPA uC updates the Read Index for Ring2.
  3587. * If Second RX ring is completion ring, this is NOT used
  3588. * - RX_RING2_WR_IDX_ADDR
  3589. * Bits 31:0
  3590. * Purpose: If Second RX ring is Indication ring, DDR address where
  3591. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3592. * If second RX ring is completion ring, DDR address where
  3593. * IPA uC updates the Write Index for Ring 2.
  3594. * For systems using 64-bit format for bus addresses:
  3595. * - TX_COMP_RING_BASE_ADDR_LO
  3596. * Bits 31:0
  3597. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3598. * - TX_COMP_RING_BASE_ADDR_HI
  3599. * Bits 31:0
  3600. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3601. * - TX_COMP_RING_SIZE
  3602. * Bits 31:0
  3603. * Purpose: TX Completion Ring size (must be power of 2)
  3604. * - TX_COMP_WR_IDX_ADDR_LO
  3605. * Bits 31:0
  3606. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3607. * Lower 4 bytes of DDR address where WIFI FW
  3608. * updates the Write Index for WDI_IPA TX completion ring
  3609. * - TX_COMP_WR_IDX_ADDR_HI
  3610. * Bits 31:0
  3611. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3612. * Higher 4 bytes of DDR address where WIFI FW
  3613. * updates the Write Index for WDI_IPA TX completion ring
  3614. * - TX_CE_WR_IDX_ADDR_LO
  3615. * Bits 31:0
  3616. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3617. * updates the WR Index for TX CE ring
  3618. * (needed for fusion platforms)
  3619. * - TX_CE_WR_IDX_ADDR_HI
  3620. * Bits 31:0
  3621. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3622. * updates the WR Index for TX CE ring
  3623. * (needed for fusion platforms)
  3624. * - RX_IND_RING_BASE_ADDR_LO
  3625. * Bits 31:0
  3626. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3627. * - RX_IND_RING_BASE_ADDR_HI
  3628. * Bits 31:0
  3629. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3630. * - RX_IND_RING_SIZE
  3631. * Bits 31:0
  3632. * Purpose: RX Indication Ring size
  3633. * - RX_IND_RD_IDX_ADDR_LO
  3634. * Bits 31:0
  3635. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3636. * for WDI_IPA RX indication ring
  3637. * - RX_IND_RD_IDX_ADDR_HI
  3638. * Bits 31:0
  3639. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3640. * for WDI_IPA RX indication ring
  3641. * - RX_IND_WR_IDX_ADDR_LO
  3642. * Bits 31:0
  3643. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3644. * Lower 4 bytes of DDR address where WIFI FW
  3645. * updates the Write Index for WDI_IPA RX indication ring
  3646. * - RX_IND_WR_IDX_ADDR_HI
  3647. * Bits 31:0
  3648. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3649. * Higher 4 bytes of DDR address where WIFI FW
  3650. * updates the Write Index for WDI_IPA RX indication ring
  3651. * - RX_RING2_BASE_ADDR_LO
  3652. * Bits 31:0
  3653. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3654. * - RX_RING2_BASE_ADDR_HI
  3655. * Bits 31:0
  3656. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3657. * - RX_RING2_SIZE
  3658. * Bits 31:0
  3659. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3660. * - RX_RING2_RD_IDX_ADDR_LO
  3661. * Bits 31:0
  3662. * Purpose: If Second RX ring is Indication ring, lower 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_RD_IDX_ADDR_HI
  3666. * Bits 31:0
  3667. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3668. * DDR address where IPA uC updates the Read Index for Ring2.
  3669. * If Second RX ring is completion ring, this is NOT used
  3670. * - RX_RING2_WR_IDX_ADDR_LO
  3671. * Bits 31:0
  3672. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3673. * DDR address where WIFI FW updates the Write Index
  3674. * for WDI_IPA RX ring2
  3675. * If second RX ring is completion ring, lower 4 bytes of
  3676. * DDR address where IPA uC updates the Write Index for Ring 2.
  3677. * - RX_RING2_WR_IDX_ADDR_HI
  3678. * Bits 31:0
  3679. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3680. * DDR address where WIFI FW updates the Write Index
  3681. * for WDI_IPA RX ring2
  3682. * If second RX ring is completion ring, higher 4 bytes of
  3683. * DDR address where IPA uC updates the Write Index for Ring 2.
  3684. */
  3685. #if HTT_PADDR64
  3686. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3687. #else
  3688. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3689. #endif
  3690. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3691. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3692. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3693. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3694. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3695. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3696. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3697. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3698. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  3699. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  3700. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  3701. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  3702. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  3703. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  3704. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  3705. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  3706. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  3707. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  3708. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  3709. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  3710. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  3711. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  3712. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  3713. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  3714. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  3715. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  3716. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  3717. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  3718. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  3719. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  3720. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  3721. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  3722. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  3723. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  3724. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  3725. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  3726. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  3727. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  3728. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  3729. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  3730. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  3731. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  3732. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  3733. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  3734. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  3735. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  3736. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  3737. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  3738. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  3739. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  3740. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  3741. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  3742. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  3743. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  3744. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  3745. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  3746. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  3747. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  3748. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  3749. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  3750. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  3751. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  3752. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  3753. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  3754. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  3755. do { \
  3756. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  3757. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  3758. } while (0)
  3759. /* for systems using 32-bit format for bus addr */
  3760. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  3761. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  3762. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  3763. do { \
  3764. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  3765. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  3766. } while (0)
  3767. /* for systems using 64-bit format for bus addr */
  3768. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  3769. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  3770. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  3771. do { \
  3772. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  3773. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  3774. } while (0)
  3775. /* for systems using 64-bit format for bus addr */
  3776. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  3777. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  3778. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  3779. do { \
  3780. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  3781. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  3782. } while (0)
  3783. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  3784. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  3785. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  3786. do { \
  3787. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  3788. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  3789. } while (0)
  3790. /* for systems using 32-bit format for bus addr */
  3791. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  3792. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  3793. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  3794. do { \
  3795. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  3796. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  3797. } while (0)
  3798. /* for systems using 64-bit format for bus addr */
  3799. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  3800. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  3801. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  3802. do { \
  3803. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  3804. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  3805. } while (0)
  3806. /* for systems using 64-bit format for bus addr */
  3807. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  3808. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  3809. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  3810. do { \
  3811. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  3812. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  3813. } while (0)
  3814. /* for systems using 32-bit format for bus addr */
  3815. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  3816. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  3817. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  3818. do { \
  3819. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  3820. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  3821. } while (0)
  3822. /* for systems using 64-bit format for bus addr */
  3823. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  3824. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  3825. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  3826. do { \
  3827. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  3828. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  3829. } while (0)
  3830. /* for systems using 64-bit format for bus addr */
  3831. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  3832. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  3833. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  3834. do { \
  3835. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  3836. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  3837. } while (0)
  3838. /* for systems using 32-bit format for bus addr */
  3839. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  3840. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  3841. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  3842. do { \
  3843. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  3844. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  3845. } while (0)
  3846. /* for systems using 64-bit format for bus addr */
  3847. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  3848. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  3849. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  3850. do { \
  3851. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  3852. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  3853. } while (0)
  3854. /* for systems using 64-bit format for bus addr */
  3855. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  3856. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  3857. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  3858. do { \
  3859. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  3860. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  3861. } while (0)
  3862. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  3863. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  3864. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  3865. do { \
  3866. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  3867. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  3868. } while (0)
  3869. /* for systems using 32-bit format for bus addr */
  3870. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  3871. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  3872. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  3873. do { \
  3874. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  3875. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  3876. } while (0)
  3877. /* for systems using 64-bit format for bus addr */
  3878. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  3879. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  3880. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  3881. do { \
  3882. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  3883. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  3884. } while (0)
  3885. /* for systems using 64-bit format for bus addr */
  3886. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  3887. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  3888. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  3889. do { \
  3890. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  3891. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  3892. } while (0)
  3893. /* for systems using 32-bit format for bus addr */
  3894. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  3895. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  3896. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  3897. do { \
  3898. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  3899. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  3900. } while (0)
  3901. /* for systems using 64-bit format for bus addr */
  3902. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  3903. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  3904. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  3905. do { \
  3906. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  3907. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  3908. } while (0)
  3909. /* for systems using 64-bit format for bus addr */
  3910. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  3911. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  3912. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  3913. do { \
  3914. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  3915. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  3916. } while (0)
  3917. /* for systems using 32-bit format for bus addr */
  3918. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  3919. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  3920. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  3921. do { \
  3922. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  3923. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  3924. } while (0)
  3925. /* for systems using 64-bit format for bus addr */
  3926. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  3927. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  3928. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  3929. do { \
  3930. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  3931. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  3932. } while (0)
  3933. /* for systems using 64-bit format for bus addr */
  3934. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  3935. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  3936. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  3937. do { \
  3938. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  3939. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  3940. } while (0)
  3941. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  3942. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  3943. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  3944. do { \
  3945. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  3946. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  3947. } while (0)
  3948. /* for systems using 32-bit format for bus addr */
  3949. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  3950. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  3951. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  3952. do { \
  3953. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  3954. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  3955. } while (0)
  3956. /* for systems using 64-bit format for bus addr */
  3957. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  3958. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  3959. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  3960. do { \
  3961. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  3962. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  3963. } while (0)
  3964. /* for systems using 64-bit format for bus addr */
  3965. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  3966. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  3967. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  3968. do { \
  3969. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  3970. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  3971. } while (0)
  3972. /* for systems using 32-bit format for bus addr */
  3973. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  3974. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  3975. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  3976. do { \
  3977. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  3978. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  3979. } while (0)
  3980. /* for systems using 64-bit format for bus addr */
  3981. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  3982. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  3983. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  3984. do { \
  3985. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  3986. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  3987. } while (0)
  3988. /* for systems using 64-bit format for bus addr */
  3989. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  3990. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  3991. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  3992. do { \
  3993. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  3994. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  3995. } while (0)
  3996. /*
  3997. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  3998. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  3999. * addresses are stored in a XXX-bit field.
  4000. * This macro is used to define both htt_wdi_ipa_config32_t and
  4001. * htt_wdi_ipa_config64_t structs.
  4002. */
  4003. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4004. _paddr__tx_comp_ring_base_addr_, \
  4005. _paddr__tx_comp_wr_idx_addr_, \
  4006. _paddr__tx_ce_wr_idx_addr_, \
  4007. _paddr__rx_ind_ring_base_addr_, \
  4008. _paddr__rx_ind_rd_idx_addr_, \
  4009. _paddr__rx_ind_wr_idx_addr_, \
  4010. _paddr__rx_ring2_base_addr_,\
  4011. _paddr__rx_ring2_rd_idx_addr_,\
  4012. _paddr__rx_ring2_wr_idx_addr_) \
  4013. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4014. { \
  4015. /* DWORD 0: flags and meta-data */ \
  4016. A_UINT32 \
  4017. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4018. reserved: 8, \
  4019. tx_pkt_pool_size: 16;\
  4020. /* DWORD 1 */\
  4021. _paddr__tx_comp_ring_base_addr_;\
  4022. /* DWORD 2 (or 3)*/\
  4023. A_UINT32 tx_comp_ring_size;\
  4024. /* DWORD 3 (or 4)*/\
  4025. _paddr__tx_comp_wr_idx_addr_;\
  4026. /* DWORD 4 (or 6)*/\
  4027. _paddr__tx_ce_wr_idx_addr_;\
  4028. /* DWORD 5 (or 8)*/\
  4029. _paddr__rx_ind_ring_base_addr_;\
  4030. /* DWORD 6 (or 10)*/\
  4031. A_UINT32 rx_ind_ring_size;\
  4032. /* DWORD 7 (or 11)*/\
  4033. _paddr__rx_ind_rd_idx_addr_;\
  4034. /* DWORD 8 (or 13)*/\
  4035. _paddr__rx_ind_wr_idx_addr_;\
  4036. /* DWORD 9 (or 15)*/\
  4037. _paddr__rx_ring2_base_addr_;\
  4038. /* DWORD 10 (or 17) */\
  4039. A_UINT32 rx_ring2_size;\
  4040. /* DWORD 11 (or 18) */\
  4041. _paddr__rx_ring2_rd_idx_addr_;\
  4042. /* DWORD 12 (or 20) */\
  4043. _paddr__rx_ring2_wr_idx_addr_;\
  4044. } POSTPACK
  4045. /* define a htt_wdi_ipa_config32_t type */
  4046. 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));
  4047. /* define a htt_wdi_ipa_config64_t type */
  4048. 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));
  4049. #if HTT_PADDR64
  4050. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4051. #else
  4052. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4053. #endif
  4054. enum htt_wdi_ipa_op_code {
  4055. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4056. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4057. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4058. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4059. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4060. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4061. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4062. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4063. /* keep this last */
  4064. HTT_WDI_IPA_OPCODE_MAX
  4065. };
  4066. /**
  4067. * @brief HTT WDI_IPA Operation Request Message
  4068. *
  4069. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4070. *
  4071. * @details
  4072. * HTT WDI_IPA Operation Request message is sent by host
  4073. * to either suspend or resume WDI_IPA TX or RX path.
  4074. * |31 24|23 16|15 8|7 0|
  4075. * |----------------+----------------+----------------+----------------|
  4076. * | op_code | Rsvd | msg_type |
  4077. * |-------------------------------------------------------------------|
  4078. *
  4079. * Header fields:
  4080. * - MSG_TYPE
  4081. * Bits 7:0
  4082. * Purpose: Identifies this as WDI_IPA Operation Request message
  4083. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4084. * - OP_CODE
  4085. * Bits 31:16
  4086. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4087. * value: = enum htt_wdi_ipa_op_code
  4088. */
  4089. PREPACK struct htt_wdi_ipa_op_request_t
  4090. {
  4091. /* DWORD 0: flags and meta-data */
  4092. A_UINT32
  4093. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4094. reserved: 8,
  4095. op_code: 16;
  4096. } POSTPACK;
  4097. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4098. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4099. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4100. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4101. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4102. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4103. do { \
  4104. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4105. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4106. } while (0)
  4107. /*
  4108. * @brief host -> target HTT_SRING_SETUP message
  4109. *
  4110. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4111. *
  4112. * @details
  4113. * After target is booted up, Host can send SRING setup message for
  4114. * each host facing LMAC SRING. Target setups up HW registers based
  4115. * on setup message and confirms back to Host if response_required is set.
  4116. * Host should wait for confirmation message before sending new SRING
  4117. * setup message
  4118. *
  4119. * The message would appear as follows:
  4120. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4121. * |--------------- +-----------------+-----------------+-----------------|
  4122. * | ring_type | ring_id | pdev_id | msg_type |
  4123. * |----------------------------------------------------------------------|
  4124. * | ring_base_addr_lo |
  4125. * |----------------------------------------------------------------------|
  4126. * | ring_base_addr_hi |
  4127. * |----------------------------------------------------------------------|
  4128. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4129. * |----------------------------------------------------------------------|
  4130. * | ring_head_offset32_remote_addr_lo |
  4131. * |----------------------------------------------------------------------|
  4132. * | ring_head_offset32_remote_addr_hi |
  4133. * |----------------------------------------------------------------------|
  4134. * | ring_tail_offset32_remote_addr_lo |
  4135. * |----------------------------------------------------------------------|
  4136. * | ring_tail_offset32_remote_addr_hi |
  4137. * |----------------------------------------------------------------------|
  4138. * | ring_msi_addr_lo |
  4139. * |----------------------------------------------------------------------|
  4140. * | ring_msi_addr_hi |
  4141. * |----------------------------------------------------------------------|
  4142. * | ring_msi_data |
  4143. * |----------------------------------------------------------------------|
  4144. * | intr_timer_th |IM| intr_batch_counter_th |
  4145. * |----------------------------------------------------------------------|
  4146. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4147. * |----------------------------------------------------------------------|
  4148. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4149. * |----------------------------------------------------------------------|
  4150. * Where
  4151. * IM = sw_intr_mode
  4152. * RR = response_required
  4153. * PTCF = prefetch_timer_cfg
  4154. * IP = IPA drop flag
  4155. *
  4156. * The message is interpreted as follows:
  4157. * dword0 - b'0:7 - msg_type: This will be set to
  4158. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4159. * b'8:15 - pdev_id:
  4160. * 0 (for rings at SOC/UMAC level),
  4161. * 1/2/3 mac id (for rings at LMAC level)
  4162. * b'16:23 - ring_id: identify which ring is to setup,
  4163. * more details can be got from enum htt_srng_ring_id
  4164. * b'24:31 - ring_type: identify type of host rings,
  4165. * more details can be got from enum htt_srng_ring_type
  4166. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4167. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4168. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4169. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4170. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4171. * SW_TO_HW_RING.
  4172. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4173. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4174. * Lower 32 bits of memory address of the remote variable
  4175. * storing the 4-byte word offset that identifies the head
  4176. * element within the ring.
  4177. * (The head offset variable has type A_UINT32.)
  4178. * Valid for HW_TO_SW and SW_TO_SW rings.
  4179. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4180. * Upper 32 bits of memory address of the remote variable
  4181. * storing the 4-byte word offset that identifies the head
  4182. * element within the ring.
  4183. * (The head offset variable has type A_UINT32.)
  4184. * Valid for HW_TO_SW and SW_TO_SW rings.
  4185. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4186. * Lower 32 bits of memory address of the remote variable
  4187. * storing the 4-byte word offset that identifies the tail
  4188. * element within the ring.
  4189. * (The tail offset variable has type A_UINT32.)
  4190. * Valid for HW_TO_SW and SW_TO_SW rings.
  4191. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4192. * Upper 32 bits of memory address of the remote variable
  4193. * storing the 4-byte word offset that identifies the tail
  4194. * element within the ring.
  4195. * (The tail offset variable has type A_UINT32.)
  4196. * Valid for HW_TO_SW and SW_TO_SW rings.
  4197. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4198. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4199. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4200. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4201. * dword10 - b'0:31 - ring_msi_data: MSI data
  4202. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4203. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4204. * dword11 - b'0:14 - intr_batch_counter_th:
  4205. * batch counter threshold is in units of 4-byte words.
  4206. * HW internally maintains and increments batch count.
  4207. * (see SRING spec for detail description).
  4208. * When batch count reaches threshold value, an interrupt
  4209. * is generated by HW.
  4210. * b'15 - sw_intr_mode:
  4211. * This configuration shall be static.
  4212. * Only programmed at power up.
  4213. * 0: generate pulse style sw interrupts
  4214. * 1: generate level style sw interrupts
  4215. * b'16:31 - intr_timer_th:
  4216. * The timer init value when timer is idle or is
  4217. * initialized to start downcounting.
  4218. * In 8us units (to cover a range of 0 to 524 ms)
  4219. * dword12 - b'0:15 - intr_low_threshold:
  4220. * Used only by Consumer ring to generate ring_sw_int_p.
  4221. * Ring entries low threshold water mark, that is used
  4222. * in combination with the interrupt timer as well as
  4223. * the the clearing of the level interrupt.
  4224. * b'16:18 - prefetch_timer_cfg:
  4225. * Used only by Consumer ring to set timer mode to
  4226. * support Application prefetch handling.
  4227. * The external tail offset/pointer will be updated
  4228. * at following intervals:
  4229. * 3'b000: (Prefetch feature disabled; used only for debug)
  4230. * 3'b001: 1 usec
  4231. * 3'b010: 4 usec
  4232. * 3'b011: 8 usec (default)
  4233. * 3'b100: 16 usec
  4234. * Others: Reserverd
  4235. * b'19 - response_required:
  4236. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4237. * b'20 - ipa_drop_flag:
  4238. Indicates that host will config ipa drop threshold percentage
  4239. * b'21:31 - reserved: reserved for future use
  4240. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4241. * b'8:15 - ipa drop high threshold percentage:
  4242. * b'16:31 - Reserved
  4243. */
  4244. PREPACK struct htt_sring_setup_t {
  4245. A_UINT32 msg_type: 8,
  4246. pdev_id: 8,
  4247. ring_id: 8,
  4248. ring_type: 8;
  4249. A_UINT32 ring_base_addr_lo;
  4250. A_UINT32 ring_base_addr_hi;
  4251. A_UINT32 ring_size: 16,
  4252. ring_entry_size: 8,
  4253. ring_misc_cfg_flag: 8;
  4254. A_UINT32 ring_head_offset32_remote_addr_lo;
  4255. A_UINT32 ring_head_offset32_remote_addr_hi;
  4256. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4257. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4258. A_UINT32 ring_msi_addr_lo;
  4259. A_UINT32 ring_msi_addr_hi;
  4260. A_UINT32 ring_msi_data;
  4261. A_UINT32 intr_batch_counter_th: 15,
  4262. sw_intr_mode: 1,
  4263. intr_timer_th: 16;
  4264. A_UINT32 intr_low_threshold: 16,
  4265. prefetch_timer_cfg: 3,
  4266. response_required: 1,
  4267. ipa_drop_flag: 1,
  4268. reserved1: 11;
  4269. A_UINT32 ipa_drop_low_threshold: 8,
  4270. ipa_drop_high_threshold: 8,
  4271. reserved: 16;
  4272. } POSTPACK;
  4273. enum htt_srng_ring_type {
  4274. HTT_HW_TO_SW_RING = 0,
  4275. HTT_SW_TO_HW_RING,
  4276. HTT_SW_TO_SW_RING,
  4277. /* Insert new ring types above this line */
  4278. };
  4279. enum htt_srng_ring_id {
  4280. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4281. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4282. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4283. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4284. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4285. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4286. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4287. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4288. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4289. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4290. HTT_TX_MON_MON2HOST_DEST_RING0, /* Used by monitor to fill status buffers and provide to host */
  4291. HTT_TX_MON_MON2HOST_DEST_RING1, /* Used by monitor to fill status buffers and provide to host */
  4292. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4293. HTT_RX_MON_MON2HOST_DEST_RING0, /* Used by monitor to fill status buffers and provide to host */
  4294. HTT_RX_MON_MON2HOST_DEST_RING1, /* Used by monitor to fill status buffers and provide to host */
  4295. /* Add Other SRING which can't be directly configured by host software above this line */
  4296. };
  4297. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4298. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4299. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4300. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4301. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4302. HTT_SRING_SETUP_PDEV_ID_S)
  4303. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4304. do { \
  4305. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4306. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4307. } while (0)
  4308. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4309. #define HTT_SRING_SETUP_RING_ID_S 16
  4310. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4311. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4312. HTT_SRING_SETUP_RING_ID_S)
  4313. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4314. do { \
  4315. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4316. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4317. } while (0)
  4318. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4319. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4320. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4321. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4322. HTT_SRING_SETUP_RING_TYPE_S)
  4323. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4324. do { \
  4325. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4326. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4327. } while (0)
  4328. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4329. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4330. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4331. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4332. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4333. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4334. do { \
  4335. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4336. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4337. } while (0)
  4338. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4339. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4340. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4341. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4342. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4343. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4344. do { \
  4345. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4346. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4347. } while (0)
  4348. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4349. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4350. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4351. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4352. HTT_SRING_SETUP_RING_SIZE_S)
  4353. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4354. do { \
  4355. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4356. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4357. } while (0)
  4358. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4359. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4360. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4361. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4362. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4363. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4364. do { \
  4365. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4366. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4367. } while (0)
  4368. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4369. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4370. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4371. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4372. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4373. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4374. do { \
  4375. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4376. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4377. } while (0)
  4378. /* This control bit is applicable to only Producer, which updates Ring ID field
  4379. * of each descriptor before pushing into the ring.
  4380. * 0: updates ring_id(default)
  4381. * 1: ring_id updating disabled */
  4382. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4383. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4384. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4385. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4386. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4387. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4388. do { \
  4389. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4390. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4391. } while (0)
  4392. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4393. * of each descriptor before pushing into the ring.
  4394. * 0: updates Loopcnt(default)
  4395. * 1: Loopcnt updating disabled */
  4396. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4397. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4398. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4399. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4400. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4401. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4402. do { \
  4403. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4404. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4405. } while (0)
  4406. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4407. * into security_id port of GXI/AXI. */
  4408. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4409. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4410. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4411. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4412. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4413. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4414. do { \
  4415. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4416. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4417. } while (0)
  4418. /* During MSI write operation, SRNG drives value of this register bit into
  4419. * swap bit of GXI/AXI. */
  4420. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4421. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4422. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4423. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4424. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4425. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4426. do { \
  4427. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4428. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4429. } while (0)
  4430. /* During Pointer write operation, SRNG drives value of this register bit into
  4431. * swap bit of GXI/AXI. */
  4432. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4433. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4434. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4435. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4436. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4437. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4438. do { \
  4439. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4440. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4441. } while (0)
  4442. /* During any data or TLV write operation, SRNG drives value of this register
  4443. * bit into swap bit of GXI/AXI. */
  4444. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4445. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4446. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4447. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4448. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4449. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4450. do { \
  4451. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4452. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4453. } while (0)
  4454. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4455. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4456. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4457. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4458. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4459. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4460. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4461. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4462. do { \
  4463. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4464. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4465. } while (0)
  4466. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4467. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4468. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4469. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4470. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4471. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4472. do { \
  4473. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4474. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4475. } while (0)
  4476. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4477. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4478. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4479. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4480. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4481. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4482. do { \
  4483. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4484. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4485. } while (0)
  4486. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4487. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4488. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4489. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4490. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4491. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4492. do { \
  4493. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4494. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4495. } while (0)
  4496. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4497. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4498. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4499. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4500. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4501. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4502. do { \
  4503. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4504. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4505. } while (0)
  4506. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4507. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4508. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4509. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4510. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4511. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4512. do { \
  4513. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4514. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4515. } while (0)
  4516. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4517. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4518. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4519. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4520. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4521. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4522. do { \
  4523. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4524. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4525. } while (0)
  4526. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4527. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4528. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4529. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4530. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4531. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4532. do { \
  4533. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4534. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4535. } while (0)
  4536. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4537. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4538. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4539. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4540. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4541. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4542. do { \
  4543. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4544. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4545. } while (0)
  4546. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4547. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4548. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4549. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4550. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4551. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4552. do { \
  4553. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4554. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4555. } while (0)
  4556. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4557. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4558. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4559. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4560. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4561. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4562. do { \
  4563. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4564. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4565. } while (0)
  4566. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4567. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4568. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4569. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4570. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4571. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4572. do { \
  4573. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4574. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4575. } while (0)
  4576. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4577. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4578. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4579. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4580. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4581. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4582. do { \
  4583. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4584. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4585. } while (0)
  4586. /**
  4587. * @brief host -> target RX ring selection config message
  4588. *
  4589. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4590. *
  4591. * @details
  4592. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4593. * configure RXDMA rings.
  4594. * The configuration is per ring based and includes both packet subtypes
  4595. * and PPDU/MPDU TLVs.
  4596. *
  4597. * The message would appear as follows:
  4598. *
  4599. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4600. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4601. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4602. * |-------------------------------------------------------------------|
  4603. * | rsvd2 | ring_buffer_size |
  4604. * |-------------------------------------------------------------------|
  4605. * | packet_type_enable_flags_0 |
  4606. * |-------------------------------------------------------------------|
  4607. * | packet_type_enable_flags_1 |
  4608. * |-------------------------------------------------------------------|
  4609. * | packet_type_enable_flags_2 |
  4610. * |-------------------------------------------------------------------|
  4611. * | packet_type_enable_flags_3 |
  4612. * |-------------------------------------------------------------------|
  4613. * | tlv_filter_in_flags |
  4614. * |-------------------------------------------------------------------|
  4615. * | rx_header_offset | rx_packet_offset |
  4616. * |-------------------------------------------------------------------|
  4617. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  4618. * |-------------------------------------------------------------------|
  4619. * | rx_msdu_start_offset | rx_msdu_end_offset |
  4620. * |-------------------------------------------------------------------|
  4621. * | rsvd3 | rx_attention_offset |
  4622. * |-------------------------------------------------------------------|
  4623. * | rsvd4 | mo| fp| rx_drop_threshold |
  4624. * | |ndp|ndp| |
  4625. * |-------------------------------------------------------------------|
  4626. * Where:
  4627. * PS = pkt_swap
  4628. * SS = status_swap
  4629. * OV = rx_offsets_valid
  4630. * DT = drop_thresh_valid
  4631. * The message is interpreted as follows:
  4632. * dword0 - b'0:7 - msg_type: This will be set to
  4633. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  4634. * b'8:15 - pdev_id:
  4635. * 0 (for rings at SOC/UMAC level),
  4636. * 1/2/3 mac id (for rings at LMAC level)
  4637. * b'16:23 - ring_id : Identify the ring to configure.
  4638. * More details can be got from enum htt_srng_ring_id
  4639. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  4640. * BUF_RING_CFG_0 defs within HW .h files,
  4641. * e.g. wmac_top_reg_seq_hwioreg.h
  4642. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  4643. * BUF_RING_CFG_0 defs within HW .h files,
  4644. * e.g. wmac_top_reg_seq_hwioreg.h
  4645. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  4646. * configuration fields are valid
  4647. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  4648. * rx_drop_threshold field is valid
  4649. * b'28:31 - rsvd1: reserved for future use
  4650. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  4651. * in byte units.
  4652. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4653. * - b'16:31 - rsvd2: Reserved for future use
  4654. * dword2 - b'0:31 - packet_type_enable_flags_0:
  4655. * Enable MGMT packet from 0b0000 to 0b1001
  4656. * bits from low to high: FP, MD, MO - 3 bits
  4657. * FP: Filter_Pass
  4658. * MD: Monitor_Direct
  4659. * MO: Monitor_Other
  4660. * 10 mgmt subtypes * 3 bits -> 30 bits
  4661. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  4662. * dword3 - b'0:31 - packet_type_enable_flags_1:
  4663. * Enable MGMT packet from 0b1010 to 0b1111
  4664. * bits from low to high: FP, MD, MO - 3 bits
  4665. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  4666. * dword4 - b'0:31 - packet_type_enable_flags_2:
  4667. * Enable CTRL packet from 0b0000 to 0b1001
  4668. * bits from low to high: FP, MD, MO - 3 bits
  4669. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  4670. * dword5 - b'0:31 - packet_type_enable_flags_3:
  4671. * Enable CTRL packet from 0b1010 to 0b1111,
  4672. * MCAST_DATA, UCAST_DATA, NULL_DATA
  4673. * bits from low to high: FP, MD, MO - 3 bits
  4674. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  4675. * dword6 - b'0:31 - tlv_filter_in_flags:
  4676. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  4677. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  4678. * dword7 - b'0:15 - rx_packet_offset: rx_packet_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. * - b'16:31 - rx_header_offset: rx_header_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_1 defs within HW .h files,
  4687. * e.g. wmac_top_reg_seq_hwioreg.h
  4688. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_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. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_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_2 defs within HW .h files,
  4697. * e.g. wmac_top_reg_seq_hwioreg.h
  4698. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_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. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_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_3 defs within HW .h files,
  4707. * e.g. wmac_top_reg_seq_hwioreg.h
  4708. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  4709. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4710. * A value of 0 will be considered as ignore this config.
  4711. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  4712. * e.g. wmac_top_reg_seq_hwioreg.h
  4713. * - b'16:31 - rsvd3 for future use
  4714. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  4715. * to source rings. Consumer drops packets if the available
  4716. * words in the ring falls below the configured threshold
  4717. * value.
  4718. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  4719. * by host. 1 -> subscribed
  4720. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  4721. * by host. 1 -> subscribed
  4722. */
  4723. PREPACK struct htt_rx_ring_selection_cfg_t {
  4724. A_UINT32 msg_type: 8,
  4725. pdev_id: 8,
  4726. ring_id: 8,
  4727. status_swap: 1,
  4728. pkt_swap: 1,
  4729. rx_offsets_valid: 1,
  4730. drop_thresh_valid: 1,
  4731. rsvd1: 4;
  4732. A_UINT32 ring_buffer_size: 16,
  4733. rsvd2: 16;
  4734. A_UINT32 packet_type_enable_flags_0;
  4735. A_UINT32 packet_type_enable_flags_1;
  4736. A_UINT32 packet_type_enable_flags_2;
  4737. A_UINT32 packet_type_enable_flags_3;
  4738. A_UINT32 tlv_filter_in_flags;
  4739. A_UINT32 rx_packet_offset: 16,
  4740. rx_header_offset: 16;
  4741. A_UINT32 rx_mpdu_end_offset: 16,
  4742. rx_mpdu_start_offset: 16;
  4743. A_UINT32 rx_msdu_end_offset: 16,
  4744. rx_msdu_start_offset: 16;
  4745. A_UINT32 rx_attn_offset: 16,
  4746. rsvd3: 16;
  4747. A_UINT32 rx_drop_threshold: 10,
  4748. fp_ndp: 1,
  4749. mo_ndp: 1,
  4750. rsvd4: 20;
  4751. } POSTPACK;
  4752. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  4753. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  4754. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  4755. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  4756. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  4757. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  4758. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  4759. do { \
  4760. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  4761. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  4762. } while (0)
  4763. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  4764. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  4765. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  4766. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  4767. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  4768. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  4769. do { \
  4770. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  4771. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  4772. } while (0)
  4773. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  4774. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  4775. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  4776. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  4777. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  4778. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  4779. do { \
  4780. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  4781. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  4782. } while (0)
  4783. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  4784. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  4785. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  4786. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  4787. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  4788. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  4789. do { \
  4790. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  4791. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  4792. } while (0)
  4793. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  4794. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  4795. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  4796. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  4797. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  4798. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  4799. do { \
  4800. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  4801. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  4802. } while (0)
  4803. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  4804. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  4805. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  4806. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  4807. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  4808. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  4809. do { \
  4810. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  4811. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  4812. } while (0)
  4813. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  4814. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  4815. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  4816. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  4817. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  4818. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  4819. do { \
  4820. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  4821. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  4822. } while (0)
  4823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  4824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  4825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  4826. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  4827. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  4828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  4829. do { \
  4830. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  4831. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  4832. } while (0)
  4833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  4834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  4835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  4836. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  4837. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  4838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  4839. do { \
  4840. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  4841. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  4842. } while (0)
  4843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  4844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  4845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  4846. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  4847. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  4848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  4849. do { \
  4850. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  4851. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  4852. } while (0)
  4853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  4854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  4855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  4856. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  4857. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  4858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  4859. do { \
  4860. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  4861. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  4862. } while (0)
  4863. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  4864. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  4865. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  4866. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  4867. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  4868. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  4869. do { \
  4870. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  4871. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  4872. } while (0)
  4873. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  4874. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  4875. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  4876. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  4877. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  4878. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  4879. do { \
  4880. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  4881. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  4882. } while (0)
  4883. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  4884. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  4885. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  4886. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  4887. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  4888. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  4889. do { \
  4890. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  4891. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  4892. } while (0)
  4893. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  4894. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  4895. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  4896. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  4897. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  4898. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  4899. do { \
  4900. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  4901. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  4902. } while (0)
  4903. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  4904. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  4905. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  4906. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  4907. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  4908. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  4909. do { \
  4910. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  4911. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  4912. } while (0)
  4913. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  4914. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  4915. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  4916. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  4917. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  4918. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  4919. do { \
  4920. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  4921. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  4922. } while (0)
  4923. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  4924. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  4925. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  4926. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  4927. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  4928. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  4929. do { \
  4930. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  4931. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  4932. } while (0)
  4933. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  4934. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  4935. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  4936. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  4937. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  4938. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  4939. do { \
  4940. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  4941. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  4942. } while (0)
  4943. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  4944. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  4945. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  4946. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  4947. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  4948. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  4949. do { \
  4950. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  4951. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  4952. } while (0)
  4953. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  4954. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  4955. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  4956. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  4957. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  4958. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  4959. do { \
  4960. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  4961. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  4962. } while (0)
  4963. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  4964. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  4965. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  4966. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  4967. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  4968. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  4969. do { \
  4970. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  4971. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  4972. } while (0)
  4973. /*
  4974. * Subtype based MGMT frames enable bits.
  4975. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  4976. */
  4977. /* association request */
  4978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  4979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  4980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  4981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  4982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  4983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  4984. /* association response */
  4985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  4986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  4987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  4988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  4989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  4990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  4991. /* Reassociation request */
  4992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  4993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  4994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  4995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  4996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  4997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  4998. /* Reassociation response */
  4999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5005. /* Probe request */
  5006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5012. /* Probe response */
  5013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5019. /* Timing Advertisement */
  5020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5026. /* Reserved */
  5027. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5028. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5029. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5030. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5032. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5033. /* Beacon */
  5034. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5035. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5036. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5037. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5038. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5039. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5040. /* ATIM */
  5041. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5042. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5043. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5044. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5045. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5046. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5047. /* Disassociation */
  5048. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5049. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5050. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5051. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5052. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5053. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5054. /* Authentication */
  5055. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5056. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5057. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5058. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5059. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5060. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5061. /* Deauthentication */
  5062. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5063. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5064. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5065. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5066. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5067. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5068. /* Action */
  5069. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5070. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5071. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5072. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5073. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5074. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5075. /* Action No Ack */
  5076. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5077. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5078. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5079. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5080. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5081. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5082. /* Reserved */
  5083. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5084. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5085. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5086. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5087. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5088. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5089. /*
  5090. * Subtype based CTRL frames enable bits.
  5091. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5092. */
  5093. /* Reserved */
  5094. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5095. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5096. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5097. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5098. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5099. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5100. /* Reserved */
  5101. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5102. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5103. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5104. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5105. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5106. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5107. /* Reserved */
  5108. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5109. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5110. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5111. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5112. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5113. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5114. /* Reserved */
  5115. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5116. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5117. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5118. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5119. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5120. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5121. /* Reserved */
  5122. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5123. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5124. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5125. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5126. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5127. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5128. /* Reserved */
  5129. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5130. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5131. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5132. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5133. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5134. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5135. /* Reserved */
  5136. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5137. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5138. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5139. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5140. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5141. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5142. /* Control Wrapper */
  5143. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5144. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5145. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5146. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5147. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5148. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5149. /* Block Ack Request */
  5150. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5151. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5152. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5153. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5154. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5155. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5156. /* Block Ack*/
  5157. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5158. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5159. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5160. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5161. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5162. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5163. /* PS-POLL */
  5164. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5165. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5166. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5167. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5168. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5169. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5170. /* RTS */
  5171. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5172. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5173. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5174. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5175. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5176. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5177. /* CTS */
  5178. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5179. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5180. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5181. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5182. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5183. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5184. /* ACK */
  5185. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5186. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5187. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5188. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5189. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5190. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5191. /* CF-END */
  5192. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5193. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5194. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5195. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5196. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5197. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5198. /* CF-END + CF-ACK */
  5199. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5200. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5201. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5202. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5203. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5204. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5205. /* Multicast data */
  5206. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5207. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5208. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5209. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5210. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5211. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5212. /* Unicast data */
  5213. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5214. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5215. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5216. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5217. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5218. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5219. /* NULL data */
  5220. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5221. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5222. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5223. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5224. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5225. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5226. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5227. do { \
  5228. HTT_CHECK_SET_VAL(httsym, value); \
  5229. (word) |= (value) << httsym##_S; \
  5230. } while (0)
  5231. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5232. (((word) & httsym##_M) >> httsym##_S)
  5233. #define htt_rx_ring_pkt_enable_subtype_set( \
  5234. word, flag, mode, type, subtype, val) \
  5235. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5236. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5237. #define htt_rx_ring_pkt_enable_subtype_get( \
  5238. word, flag, mode, type, subtype) \
  5239. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5240. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5241. /* Definition to filter in TLVs */
  5242. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5243. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5244. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5245. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5246. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5247. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5248. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5249. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5250. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5251. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5252. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5253. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5254. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5255. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5256. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5257. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5258. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5259. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5260. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5261. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5262. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5263. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5264. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5265. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5266. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5267. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5268. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5269. do { \
  5270. HTT_CHECK_SET_VAL(httsym, enable); \
  5271. (word) |= (enable) << httsym##_S; \
  5272. } while (0)
  5273. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5274. (((word) & httsym##_M) >> httsym##_S)
  5275. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5276. HTT_RX_RING_TLV_ENABLE_SET( \
  5277. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5278. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5279. HTT_RX_RING_TLV_ENABLE_GET( \
  5280. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5281. /**
  5282. * @brief host -> target TX monitor config message
  5283. *
  5284. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5285. *
  5286. * @details
  5287. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5288. * configure RXDMA rings.
  5289. * The configuration is per ring based and includes both packet types
  5290. * and PPDU/MPDU TLVs.
  5291. *
  5292. * The message would appear as follows:
  5293. *
  5294. * |31 28|27|26|25|24|23 22|21 19|18 16|15 8|7 |2 0|
  5295. * |-----+-----+--+--+-----=-----+------+----------------+---------+-----|
  5296. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5297. * |-----+--------+--------+-----+------+--------------------------------|
  5298. * |rsvd2| DATA | CTRL | MGMT| PT | ring_buffer_size |
  5299. * |---------------------------------------------------------------+-----|
  5300. * | rsvd3 | E |
  5301. * |---------------------------------------------------------------------|
  5302. * | tlv_filter_mask_in0 |
  5303. * |---------------------------------------------------------------------|
  5304. * | tlv_filter_mask_in1 |
  5305. * |---------------------------------------------------------------------|
  5306. * | tlv_filter_mask_in2 |
  5307. * |---------------------------------------------------------------------|
  5308. * | tlv_filter_mask_in3 |
  5309. * |------------------------------------+--------------------------------|
  5310. * | tx_peer_entry_word_mask | tx_fes_setup_word_mask |
  5311. * |------------------------------------+--------------------------------|
  5312. * | tx_msdu_start_word_mask | tx_queue_ext_word_mask |
  5313. * |------------------------------------+--------------------------------|
  5314. * | pcu_ppdu_setup_word_mask | tx_mpdu_start_word_mask |
  5315. * |-----------------------+-----+------+--------------------------------|
  5316. * | rsvd4 | EMM | PT | rxpcu_user_setup_word_mask |
  5317. * |---------------------------------------------------------------------|
  5318. *
  5319. * Where:
  5320. * PS = pkt_swap
  5321. * SS = status_swap
  5322. * The message is interpreted as follows:
  5323. * dword0 - b'0:7 - msg_type: This will be set to
  5324. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5325. * b'8:15 - pdev_id:
  5326. * 0 (for rings at SOC/UMAC level),
  5327. * 1/2/3 mac id (for rings at LMAC level)
  5328. * b'16:23 - ring_id : Identify the ring to configure.
  5329. * More details can be got from enum htt_srng_ring_id
  5330. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5331. * BUF_RING_CFG_0 defs within HW .h files,
  5332. * e.g. wmac_top_reg_seq_hwioreg.h
  5333. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5334. * BUF_RING_CFG_0 defs within HW .h files,
  5335. * e.g. wmac_top_reg_seq_hwioreg.h
  5336. * b'26:31 - rsvd1: reserved for future use
  5337. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  5338. * in byte units.
  5339. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5340. * b'16:18 - pkt_type_config_length (PT): MGMT, CTRL, DATA
  5341. * Each bit out of 3 bits represents if configurable length
  5342. * is valid and needs to programmed.
  5343. * b'19:21 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5344. * 64, 128, 256.
  5345. * If all 3 bits are set config length is > 256
  5346. * b'22:24 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5347. * 64, 128, 256.
  5348. * If all 3 bits are set config length is > 256
  5349. * b'25:27 - config_length_data(DATA) for DATA: Each bit set represent
  5350. * 64, 128, 256.
  5351. * If all 3 bits are set config length is > 256
  5352. * - b'28:31 - rsvd2: Reserved for future use
  5353. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5354. * b'3:31 - rsvd3: Reserved for future use
  5355. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5356. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5357. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5358. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5359. * dword7 - b'0:15 - tx_fes_setup_word_mask:
  5360. * - b'16:31 - tx_peer_entry_word_mask:
  5361. * dword8 - b'0:15 - tx_queue_ext_word_mask:
  5362. * - b'16:31 - tx_msdu_start_word_mask:
  5363. * dword9 - b'0:15 - tx_mpdu_start_word_mask:
  5364. * - b'16:31 - pcu_ppdu_setup_word_mask:
  5365. * dword10- b'0:15 - rxpcu_user_setup_word_mask:
  5366. * - b'16:18 - pkt_type_msdu_or_mpdu_logging (PT): MGMT, CTRL, DATA
  5367. * Each bit out of 3 bits represents if MSDU/MPDU
  5368. * logging is enabled
  5369. * - b'19:21 - enable_msdu_or_mpdu_logging (EMM): For MGMT, CTRL, DATA
  5370. * 0 -> MSDU level logging is enabled
  5371. * (valid only if bit is set in
  5372. * pkt_type_msdu_or_mpdu_logging)
  5373. * 1 -> MPDU level logging is enabled
  5374. * (valid only if bit is set in
  5375. * pkt_type_msdu_or_mpdu_logging)
  5376. * - b'22:31 - rsvd4 for future use
  5377. */
  5378. PREPACK struct htt_tx_monitor_cfg_t {
  5379. A_UINT32 msg_type: 8,
  5380. pdev_id: 8,
  5381. ring_id: 8,
  5382. status_swap: 1,
  5383. pkt_swap: 1,
  5384. rsvd1: 6;
  5385. A_UINT32 ring_buffer_size: 16,
  5386. pkt_type_config_length: 3,
  5387. config_length_mgmt: 3,
  5388. config_length_ctrl: 3,
  5389. config_length_data: 3,
  5390. rsvd2: 4;
  5391. A_UINT32 pkt_type_enable_flags: 3,
  5392. rsvd3: 29;
  5393. A_UINT32 tlv_filter_mask_in0;
  5394. A_UINT32 tlv_filter_mask_in1;
  5395. A_UINT32 tlv_filter_mask_in2;
  5396. A_UINT32 tlv_filter_mask_in3;
  5397. A_UINT32 tx_fes_setup_word_mask: 16,
  5398. tx_peer_entry_word_mask: 16;
  5399. A_UINT32 tx_queue_ext_word_mask: 16,
  5400. tx_msdu_start_word_mask: 16;
  5401. A_UINT32 tx_mpdu_start_word_mask: 16,
  5402. pcu_ppdu_setup_word_mask: 16;
  5403. A_UINT32 rxpcu_user_setup_word_mask: 16,
  5404. pkt_type_msdu_or_mpdu_logging: 3,
  5405. enable_msdu_or_mpdu_logging: 3,
  5406. rsvd4: 10;
  5407. } POSTPACK;
  5408. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5409. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  5410. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  5411. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  5412. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  5413. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  5414. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  5415. do { \
  5416. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  5417. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  5418. } while (0)
  5419. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  5420. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  5421. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  5422. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  5423. HTT_TX_MONITOR_CFG_RING_ID_S)
  5424. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  5425. do { \
  5426. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  5427. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  5428. } while (0)
  5429. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  5430. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  5431. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  5432. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  5433. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  5434. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  5435. do { \
  5436. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  5437. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  5438. } while (0)
  5439. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  5440. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  5441. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  5442. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  5443. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  5444. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  5445. do { \
  5446. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  5447. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  5448. } while (0)
  5449. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5450. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  5451. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  5452. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  5453. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  5454. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5455. do { \
  5456. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  5457. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  5458. } while (0)
  5459. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_M 0x00070000
  5460. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S 16
  5461. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_GET(_var) \
  5462. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_M) >> \
  5463. HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S)
  5464. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_SET(_var, _val) \
  5465. do { \
  5466. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH, _val); \
  5467. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_S)); \
  5468. } while (0)
  5469. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00380000
  5470. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 19
  5471. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5472. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5473. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  5474. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5475. do { \
  5476. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  5477. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5478. } while (0)
  5479. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x01C00000
  5480. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 22
  5481. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5482. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5483. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  5484. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5485. do { \
  5486. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  5487. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  5488. } while (0)
  5489. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x0E000000
  5490. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 25
  5491. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5492. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  5493. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  5494. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5495. do { \
  5496. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  5497. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  5498. } while (0)
  5499. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  5500. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  5501. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  5502. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  5503. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  5504. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  5505. do { \
  5506. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  5507. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  5508. } while (0)
  5509. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  5510. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  5511. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  5512. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  5513. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  5514. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  5515. do { \
  5516. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  5517. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  5518. } while (0)
  5519. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x0000ffff
  5520. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  5521. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  5522. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  5523. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  5524. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  5525. do { \
  5526. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  5527. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  5528. } while (0)
  5529. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0xffff0000
  5530. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 16
  5531. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  5532. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  5533. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  5534. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  5535. do { \
  5536. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  5537. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  5538. } while (0)
  5539. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x0000ffff
  5540. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 0
  5541. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  5542. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  5543. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  5544. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  5545. do { \
  5546. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  5547. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  5548. } while (0)
  5549. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xffff0000
  5550. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 16
  5551. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  5552. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  5553. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  5554. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  5555. do { \
  5556. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  5557. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  5558. } while (0)
  5559. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x0000ffff
  5560. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  5561. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  5562. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  5563. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  5564. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5565. do { \
  5566. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  5567. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  5568. } while (0)
  5569. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffff0000
  5570. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 16
  5571. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  5572. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  5573. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  5574. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  5575. do { \
  5576. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  5577. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  5578. } while (0)
  5579. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ffff
  5580. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 0
  5581. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  5582. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  5583. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  5584. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  5585. do { \
  5586. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  5587. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  5588. } while (0)
  5589. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  5590. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  5591. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5592. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5593. HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5594. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5595. do { \
  5596. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5597. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5598. } while (0)
  5599. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00380000
  5600. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 19
  5601. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  5602. (((_var) & HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  5603. HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  5604. #define HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  5605. do { \
  5606. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  5607. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  5608. } while (0)
  5609. /*
  5610. * pkt_type_config_length
  5611. */
  5612. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_MGMT_M 0x00000001
  5613. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_MGMT_S 0
  5614. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_CTRL_M 0x00000002
  5615. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_CTRL_S 1
  5616. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_DATA_M 0x00000004
  5617. #define HTT_TX_MONITOR_CFG_PKT_TYPE_CONFIG_LENGTH_DATA_S 2
  5618. /*
  5619. * pkt_type_enable_flags
  5620. */
  5621. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00010000
  5622. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 16
  5623. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00020000
  5624. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 17
  5625. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00040000
  5626. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 18
  5627. /*
  5628. * pkt_type_msdu_or_mpdu_logging
  5629. * */
  5630. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  5631. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  5632. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  5633. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  5634. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  5635. #define HTT_TX_MONITOR_CFG_PKT_TYPE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  5636. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  5637. do { \
  5638. HTT_CHECK_SET_VAL(httsym, value); \
  5639. (word) |= (value) << httsym##_S; \
  5640. } while (0)
  5641. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  5642. (((word) & httsym##_M) >> httsym##_S)
  5643. /* mode -> CONFIG_LENGTH, ENABLE_FLAGS, MSDU_OR_MPDU_LOGGING
  5644. * type -> MGMT, CTRL, DATA*/
  5645. #define htt_tx_ring_pkt_type_set( \
  5646. word, mode, type, val) \
  5647. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  5648. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  5649. #define htt_tx_ring_pkt_type_get( \
  5650. word, mode, type) \
  5651. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  5652. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  5653. /* Definition to filter in TLVs */
  5654. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  5655. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  5656. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  5657. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  5658. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  5659. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  5660. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  5661. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  5662. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  5663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  5664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  5665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  5666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  5667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  5668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  5669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  5670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  5671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  5672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  5673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  5674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  5675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  5676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  5677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  5678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  5679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  5680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  5681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  5682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  5683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  5684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  5685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  5686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  5687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  5688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  5689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  5690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  5691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  5692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  5693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  5694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  5695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  5696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  5697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  5698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  5699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  5700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  5701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  5702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  5703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  5704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  5705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  5706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  5707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  5708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  5709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  5710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  5711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  5712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  5713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  5714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  5715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  5716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  5717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  5718. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  5719. do { \
  5720. HTT_CHECK_SET_VAL(httsym, enable); \
  5721. (word) |= (enable) << httsym##_S; \
  5722. } while (0)
  5723. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  5724. (((word) & httsym##_M) >> httsym##_S)
  5725. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  5726. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  5727. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  5728. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  5729. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  5730. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  5731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  5732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  5733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  5734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  5735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  5736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  5737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  5738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  5739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  5740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  5741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  5742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  5743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  5744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  5745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  5746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  5747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  5748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  5749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  5750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  5751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  5752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  5753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  5754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  5755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  5756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  5757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  5758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  5759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  5760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  5761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  5762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  5763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  5764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  5765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  5766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  5767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  5768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  5769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  5770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  5771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  5772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  5773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  5774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  5775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  5776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  5777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  5778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  5779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  5780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  5781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  5782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  5783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  5784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  5785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  5786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  5787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  5788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  5789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  5790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  5791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_A_M 0x40000000
  5792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_A_S 30
  5793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_B_M 0x80000000
  5794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_L_SIG_B_S 31
  5795. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  5796. do { \
  5797. HTT_CHECK_SET_VAL(httsym, enable); \
  5798. (word) |= (enable) << httsym##_S; \
  5799. } while (0)
  5800. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  5801. (((word) & httsym##_M) >> httsym##_S)
  5802. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  5803. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  5804. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  5805. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  5806. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  5807. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  5808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  5809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  5810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  5811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  5812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  5813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  5814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  5815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  5816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  5817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  5818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  5819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  5820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  5821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  5822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  5823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  5824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  5825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  5826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  5827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  5828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  5829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  5830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  5831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  5832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  5833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  5834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  5835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  5836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  5837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  5838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  5839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  5840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  5841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  5842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  5843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  5844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  5845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  5846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  5847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  5848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  5849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  5850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  5851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  5852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  5853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  5854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  5855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  5856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  5857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  5858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  5859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  5860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  5861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  5862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_BUFFER_STATUS_M 0x08000000
  5863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_BUFFER_STATUS_S 27
  5864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  5865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_USER_BUFFER_STATUS_S 28
  5866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXDMA_STOP_REQUEST_M 0x20000000
  5867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXDMA_STOP_REQUEST_S 29
  5868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_EXPECTED_RESPONSE_M 0x40000000
  5869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_EXPECTED_RESPONSE_S 30
  5870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  5871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_MPDU_COUNT_TRANSFER_END_S 31
  5872. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  5873. do { \
  5874. HTT_CHECK_SET_VAL(httsym, enable); \
  5875. (word) |= (enable) << httsym##_S; \
  5876. } while (0)
  5877. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  5878. (((word) & httsym##_M) >> httsym##_S)
  5879. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  5880. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  5881. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  5882. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  5883. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  5884. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  5885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  5886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  5887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  5888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  5889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  5890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  5891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  5892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  5893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  5894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  5895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  5896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  5897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  5898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  5899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  5900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  5901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  5902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  5903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  5904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  5905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  5906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  5907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  5908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  5909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  5910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  5911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  5912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  5913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  5914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  5915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  5916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  5917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  5918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  5919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  5920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  5921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  5922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  5923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  5924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  5925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  5926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  5927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  5928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  5929. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  5930. do { \
  5931. HTT_CHECK_SET_VAL(httsym, enable); \
  5932. (word) |= (enable) << httsym##_S; \
  5933. } while (0)
  5934. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  5935. (((word) & httsym##_M) >> httsym##_S)
  5936. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  5937. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  5938. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  5939. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  5940. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  5941. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  5942. /**
  5943. * @brief host --> target Receive Flow Steering configuration message definition
  5944. *
  5945. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  5946. *
  5947. * host --> target Receive Flow Steering configuration message definition.
  5948. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5949. * The reason for this is we want RFS to be configured and ready before MAC
  5950. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  5951. *
  5952. * |31 24|23 16|15 9|8|7 0|
  5953. * |----------------+----------------+----------------+----------------|
  5954. * | reserved |E| msg type |
  5955. * |-------------------------------------------------------------------|
  5956. * Where E = RFS enable flag
  5957. *
  5958. * The RFS_CONFIG message consists of a single 4-byte word.
  5959. *
  5960. * Header fields:
  5961. * - MSG_TYPE
  5962. * Bits 7:0
  5963. * Purpose: identifies this as a RFS config msg
  5964. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  5965. * - RFS_CONFIG
  5966. * Bit 8
  5967. * Purpose: Tells target whether to enable (1) or disable (0)
  5968. * flow steering feature when sending rx indication messages to host
  5969. */
  5970. #define HTT_H2T_RFS_CONFIG_M 0x100
  5971. #define HTT_H2T_RFS_CONFIG_S 8
  5972. #define HTT_RX_RFS_CONFIG_GET(_var) \
  5973. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  5974. HTT_H2T_RFS_CONFIG_S)
  5975. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  5976. do { \
  5977. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  5978. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  5979. } while (0)
  5980. #define HTT_RFS_CFG_REQ_BYTES 4
  5981. /**
  5982. * @brief host -> target FW extended statistics retrieve
  5983. *
  5984. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  5985. *
  5986. * @details
  5987. * The following field definitions describe the format of the HTT host
  5988. * to target FW extended stats retrieve message.
  5989. * The message specifies the type of stats the host wants to retrieve.
  5990. *
  5991. * |31 24|23 16|15 8|7 0|
  5992. * |-----------------------------------------------------------|
  5993. * | reserved | stats type | pdev_mask | msg type |
  5994. * |-----------------------------------------------------------|
  5995. * | config param [0] |
  5996. * |-----------------------------------------------------------|
  5997. * | config param [1] |
  5998. * |-----------------------------------------------------------|
  5999. * | config param [2] |
  6000. * |-----------------------------------------------------------|
  6001. * | config param [3] |
  6002. * |-----------------------------------------------------------|
  6003. * | reserved |
  6004. * |-----------------------------------------------------------|
  6005. * | cookie LSBs |
  6006. * |-----------------------------------------------------------|
  6007. * | cookie MSBs |
  6008. * |-----------------------------------------------------------|
  6009. * Header fields:
  6010. * - MSG_TYPE
  6011. * Bits 7:0
  6012. * Purpose: identifies this is a extended stats upload request message
  6013. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6014. * - PDEV_MASK
  6015. * Bits 8:15
  6016. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6017. * Value: This is a overloaded field, refer to usage and interpretation of
  6018. * PDEV in interface document.
  6019. * Bit 8 : Reserved for SOC stats
  6020. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6021. * Indicates MACID_MASK in DBS
  6022. * - STATS_TYPE
  6023. * Bits 23:16
  6024. * Purpose: identifies which FW statistics to upload
  6025. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6026. * - Reserved
  6027. * Bits 31:24
  6028. * - CONFIG_PARAM [0]
  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 [1]
  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 [2]
  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. * - CONFIG_PARAM [3]
  6044. * Bits 31:0
  6045. * Purpose: give an opaque configuration value to the specified stats type
  6046. * Value: stats-type specific configuration value
  6047. * Refer to htt_stats.h for interpretation for each stats sub_type
  6048. * - Reserved [31:0] for future use.
  6049. * - COOKIE_LSBS
  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: LSBs of the opaque cookie specified by the host-side requestor
  6054. * - COOKIE_MSBS
  6055. * Bits 31:0
  6056. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6057. * message with its preceding host->target stats request message.
  6058. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6059. */
  6060. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6061. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6062. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6063. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6064. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6065. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6066. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6067. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6068. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6069. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6070. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6071. do { \
  6072. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6073. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6074. } while (0)
  6075. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6076. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6077. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6078. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6079. do { \
  6080. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6081. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6082. } while (0)
  6083. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6084. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6085. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6086. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6087. do { \
  6088. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6089. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6090. } while (0)
  6091. /**
  6092. * @brief host -> target FW PPDU_STATS request message
  6093. *
  6094. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6095. *
  6096. * @details
  6097. * The following field definitions describe the format of the HTT host
  6098. * to target FW for PPDU_STATS_CFG msg.
  6099. * The message allows the host to configure the PPDU_STATS_IND messages
  6100. * produced by the target.
  6101. *
  6102. * |31 24|23 16|15 8|7 0|
  6103. * |-----------------------------------------------------------|
  6104. * | REQ bit mask | pdev_mask | msg type |
  6105. * |-----------------------------------------------------------|
  6106. * Header fields:
  6107. * - MSG_TYPE
  6108. * Bits 7:0
  6109. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6110. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6111. * - PDEV_MASK
  6112. * Bits 8:15
  6113. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6114. * Value: This is a overloaded field, refer to usage and interpretation of
  6115. * PDEV in interface document.
  6116. * Bit 8 : Reserved for SOC stats
  6117. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6118. * Indicates MACID_MASK in DBS
  6119. * - REQ_TLV_BIT_MASK
  6120. * Bits 16:31
  6121. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6122. * needs to be included in the target's PPDU_STATS_IND messages.
  6123. * Value: refer htt_ppdu_stats_tlv_tag_t
  6124. *
  6125. */
  6126. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6127. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6128. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6129. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6130. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6131. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6132. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6133. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6134. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6135. do { \
  6136. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6137. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6138. } while (0)
  6139. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6140. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6141. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6142. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6143. do { \
  6144. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6145. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6146. } while (0)
  6147. /**
  6148. * @brief Host-->target HTT RX FSE setup message
  6149. *
  6150. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6151. *
  6152. * @details
  6153. * Through this message, the host will provide details of the flow tables
  6154. * in host DDR along with hash keys.
  6155. * This message can be sent per SOC or per PDEV, which is differentiated
  6156. * by pdev id values.
  6157. * The host will allocate flow search table and sends table size,
  6158. * physical DMA address of flow table, and hash keys to firmware to
  6159. * program into the RXOLE FSE HW block.
  6160. *
  6161. * The following field definitions describe the format of the RX FSE setup
  6162. * message sent from the host to target
  6163. *
  6164. * Header fields:
  6165. * dword0 - b'7:0 - msg_type: This will be set to
  6166. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6167. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6168. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6169. * pdev's LMAC ring.
  6170. * b'31:16 - reserved : Reserved for future use
  6171. * dword1 - b'19:0 - number of records: This field indicates the number of
  6172. * entries in the flow table. For example: 8k number of
  6173. * records is equivalent to
  6174. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6175. * b'27:20 - max search: This field specifies the skid length to FSE
  6176. * parser HW module whenever match is not found at the
  6177. * exact index pointed by hash.
  6178. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6179. * Refer htt_ip_da_sa_prefix below for more details.
  6180. * b'31:30 - reserved: Reserved for future use
  6181. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6182. * table allocated by host in DDR
  6183. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6184. * table allocated by host in DDR
  6185. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6186. * entry hashing
  6187. *
  6188. *
  6189. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6190. * |---------------------------------------------------------------|
  6191. * | reserved | pdev_id | MSG_TYPE |
  6192. * |---------------------------------------------------------------|
  6193. * |resvd|IPDSA| max_search | Number of records |
  6194. * |---------------------------------------------------------------|
  6195. * | base address lo |
  6196. * |---------------------------------------------------------------|
  6197. * | base address high |
  6198. * |---------------------------------------------------------------|
  6199. * | toeplitz key 31_0 |
  6200. * |---------------------------------------------------------------|
  6201. * | toeplitz key 63_32 |
  6202. * |---------------------------------------------------------------|
  6203. * | toeplitz key 95_64 |
  6204. * |---------------------------------------------------------------|
  6205. * | toeplitz key 127_96 |
  6206. * |---------------------------------------------------------------|
  6207. * | toeplitz key 159_128 |
  6208. * |---------------------------------------------------------------|
  6209. * | toeplitz key 191_160 |
  6210. * |---------------------------------------------------------------|
  6211. * | toeplitz key 223_192 |
  6212. * |---------------------------------------------------------------|
  6213. * | toeplitz key 255_224 |
  6214. * |---------------------------------------------------------------|
  6215. * | toeplitz key 287_256 |
  6216. * |---------------------------------------------------------------|
  6217. * | reserved | toeplitz key 314_288(26:0 bits) |
  6218. * |---------------------------------------------------------------|
  6219. * where:
  6220. * IPDSA = ip_da_sa
  6221. */
  6222. /**
  6223. * @brief: htt_ip_da_sa_prefix
  6224. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6225. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6226. * documentation per RFC3849
  6227. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6228. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6229. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6230. */
  6231. enum htt_ip_da_sa_prefix {
  6232. HTT_RX_IPV6_20010db8,
  6233. HTT_RX_IPV4_MAPPED_IPV6,
  6234. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6235. HTT_RX_IPV6_64FF9B,
  6236. };
  6237. /**
  6238. * @brief Host-->target HTT RX FISA configure and enable
  6239. *
  6240. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6241. *
  6242. * @details
  6243. * The host will send this command down to configure and enable the FISA
  6244. * operational params.
  6245. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6246. * register.
  6247. * Should configure both the MACs.
  6248. *
  6249. * dword0 - b'7:0 - msg_type:
  6250. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6251. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6252. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6253. * pdev's LMAC ring.
  6254. * b'31:16 - reserved : Reserved for future use
  6255. *
  6256. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6257. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6258. * packets. 1 flow search will be skipped
  6259. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6260. * tcp,udp packets
  6261. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6262. * calculation
  6263. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6264. * calculation
  6265. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6266. * calculation
  6267. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6268. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6269. * length
  6270. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6271. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6272. * length
  6273. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6274. * num jump
  6275. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6276. * num jump
  6277. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6278. * data type switch has happend for MPDU Sequence num jump
  6279. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6280. * for MPDU Sequence num jump
  6281. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6282. * for decrypt errors
  6283. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6284. * while aggregating a msdu
  6285. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6286. * The aggregation is done until (number of MSDUs aggregated
  6287. * < LIMIT + 1)
  6288. * b'31:18 - Reserved
  6289. *
  6290. * fisa_control_value - 32bit value FW can write to register
  6291. *
  6292. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  6293. * Threshold value for FISA timeout (units are microseconds).
  6294. * When the global timestamp exceeds this threshold, FISA
  6295. * aggregation will be restarted.
  6296. * A value of 0 means timeout is disabled.
  6297. * Compare the threshold register with timestamp field in
  6298. * flow entry to generate timeout for the flow.
  6299. *
  6300. * |31 18 |17 16|15 8|7 0|
  6301. * |-------------------------------------------------------------|
  6302. * | reserved | pdev_mask | msg type |
  6303. * |-------------------------------------------------------------|
  6304. * | reserved | FISA_CTRL |
  6305. * |-------------------------------------------------------------|
  6306. * | FISA_TIMEOUT_THRESH |
  6307. * |-------------------------------------------------------------|
  6308. */
  6309. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  6310. A_UINT32 msg_type:8,
  6311. pdev_id:8,
  6312. reserved0:16;
  6313. /**
  6314. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  6315. * [17:0]
  6316. */
  6317. union {
  6318. /*
  6319. * fisa_control_bits structure is deprecated.
  6320. * Please use fisa_control_bits_v2 going forward.
  6321. */
  6322. struct {
  6323. A_UINT32 fisa_enable: 1,
  6324. ipsec_skip_search: 1,
  6325. nontcp_skip_search: 1,
  6326. add_ipv4_fixed_hdr_len: 1,
  6327. add_ipv6_fixed_hdr_len: 1,
  6328. add_tcp_fixed_hdr_len: 1,
  6329. add_udp_hdr_len: 1,
  6330. chksum_cum_ip_len_en: 1,
  6331. disable_tid_check: 1,
  6332. disable_ta_check: 1,
  6333. disable_qos_check: 1,
  6334. disable_raw_check: 1,
  6335. disable_decrypt_err_check: 1,
  6336. disable_msdu_drop_check: 1,
  6337. fisa_aggr_limit: 4,
  6338. reserved: 14;
  6339. } fisa_control_bits;
  6340. struct {
  6341. A_UINT32 fisa_enable: 1,
  6342. fisa_aggr_limit: 4,
  6343. reserved: 27;
  6344. } fisa_control_bits_v2;
  6345. A_UINT32 fisa_control_value;
  6346. } u_fisa_control;
  6347. /**
  6348. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  6349. * timeout threshold for aggregation. Unit in usec.
  6350. * [31:0]
  6351. */
  6352. A_UINT32 fisa_timeout_threshold;
  6353. } POSTPACK;
  6354. /* DWord 0: pdev-ID */
  6355. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  6356. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  6357. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  6358. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  6359. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  6360. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  6361. do { \
  6362. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  6363. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  6364. } while (0)
  6365. /* Dword 1: fisa_control_value fisa config */
  6366. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  6367. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  6368. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  6369. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  6370. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  6371. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  6372. do { \
  6373. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  6374. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  6375. } while (0)
  6376. /* Dword 1: fisa_control_value ipsec_skip_search */
  6377. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  6378. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  6379. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  6380. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  6381. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  6382. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  6383. do { \
  6384. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  6385. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  6386. } while (0)
  6387. /* Dword 1: fisa_control_value non_tcp_skip_search */
  6388. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  6389. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  6390. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  6391. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  6392. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  6393. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  6394. do { \
  6395. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  6396. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  6397. } while (0)
  6398. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  6399. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  6400. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  6401. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  6402. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  6403. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  6404. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  6405. do { \
  6406. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  6407. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  6408. } while (0)
  6409. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  6410. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  6411. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  6412. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  6413. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  6414. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  6415. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  6416. do { \
  6417. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  6418. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  6419. } while (0)
  6420. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  6421. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  6422. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  6423. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  6424. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  6425. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  6426. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  6427. do { \
  6428. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  6429. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  6430. } while (0)
  6431. /* Dword 1: fisa_control_value add_udp_hdr_len */
  6432. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  6433. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  6434. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  6435. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  6436. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  6437. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  6438. do { \
  6439. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  6440. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  6441. } while (0)
  6442. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  6443. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  6444. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  6445. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  6446. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  6447. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  6448. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  6449. do { \
  6450. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  6451. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  6452. } while (0)
  6453. /* Dword 1: fisa_control_value disable_tid_check */
  6454. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  6455. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  6456. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  6457. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  6458. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  6459. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  6460. do { \
  6461. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  6462. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  6463. } while (0)
  6464. /* Dword 1: fisa_control_value disable_ta_check */
  6465. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  6466. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  6467. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  6468. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  6469. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  6470. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  6471. do { \
  6472. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  6473. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  6474. } while (0)
  6475. /* Dword 1: fisa_control_value disable_qos_check */
  6476. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  6477. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  6478. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  6479. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  6480. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  6481. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  6482. do { \
  6483. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  6484. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  6485. } while (0)
  6486. /* Dword 1: fisa_control_value disable_raw_check */
  6487. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  6488. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  6489. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  6490. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  6491. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  6492. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  6493. do { \
  6494. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  6495. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  6496. } while (0)
  6497. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  6498. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  6499. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  6500. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  6501. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  6502. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  6503. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  6504. do { \
  6505. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  6506. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  6507. } while (0)
  6508. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  6509. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  6510. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  6511. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  6512. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  6513. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  6514. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  6515. do { \
  6516. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  6517. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  6518. } while (0)
  6519. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6520. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  6521. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  6522. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  6523. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  6524. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  6525. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  6526. do { \
  6527. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  6528. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  6529. } while (0)
  6530. /* Dword 1: fisa_control_value fisa config */
  6531. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  6532. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  6533. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  6534. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  6535. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  6536. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  6537. do { \
  6538. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  6539. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  6540. } while (0)
  6541. /* Dword 1: fisa_control_value fisa_aggr_limit */
  6542. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  6543. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  6544. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  6545. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  6546. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  6547. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  6548. do { \
  6549. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  6550. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  6551. } while (0)
  6552. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  6553. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  6554. pdev_id:8,
  6555. reserved0:16;
  6556. A_UINT32 num_records:20,
  6557. max_search:8,
  6558. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  6559. reserved1:2;
  6560. A_UINT32 base_addr_lo;
  6561. A_UINT32 base_addr_hi;
  6562. A_UINT32 toeplitz31_0;
  6563. A_UINT32 toeplitz63_32;
  6564. A_UINT32 toeplitz95_64;
  6565. A_UINT32 toeplitz127_96;
  6566. A_UINT32 toeplitz159_128;
  6567. A_UINT32 toeplitz191_160;
  6568. A_UINT32 toeplitz223_192;
  6569. A_UINT32 toeplitz255_224;
  6570. A_UINT32 toeplitz287_256;
  6571. A_UINT32 toeplitz314_288:27,
  6572. reserved2:5;
  6573. } POSTPACK;
  6574. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  6575. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  6576. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  6577. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  6578. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  6579. /* DWORD 0: Pdev ID */
  6580. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  6581. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  6582. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  6583. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  6584. HTT_RX_FSE_SETUP_PDEV_ID_S)
  6585. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  6586. do { \
  6587. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  6588. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  6589. } while (0)
  6590. /* DWORD 1:num of records */
  6591. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  6592. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  6593. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  6594. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  6595. HTT_RX_FSE_SETUP_NUM_REC_S)
  6596. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  6597. do { \
  6598. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  6599. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  6600. } while (0)
  6601. /* DWORD 1:max_search */
  6602. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  6603. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  6604. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  6605. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  6606. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  6607. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  6608. do { \
  6609. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  6610. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  6611. } while (0)
  6612. /* DWORD 1:ip_da_sa prefix */
  6613. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  6614. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  6615. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  6616. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  6617. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  6618. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  6619. do { \
  6620. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  6621. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  6622. } while (0)
  6623. /* DWORD 2: Base Address LO */
  6624. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  6625. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  6626. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  6627. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  6628. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  6629. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  6630. do { \
  6631. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  6632. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  6633. } while (0)
  6634. /* DWORD 3: Base Address High */
  6635. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  6636. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  6637. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  6638. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  6639. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  6640. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  6641. do { \
  6642. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  6643. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  6644. } while (0)
  6645. /* DWORD 4-12: Hash Value */
  6646. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  6647. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  6648. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  6649. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  6650. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  6651. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  6652. do { \
  6653. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  6654. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  6655. } while (0)
  6656. /* DWORD 13: Hash Value 314:288 bits */
  6657. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  6658. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  6659. HTT_RX_FSE_SETUP_HASH_314_288_S)
  6660. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  6661. do { \
  6662. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  6663. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  6664. } while (0)
  6665. /**
  6666. * @brief Host-->target HTT RX FSE operation message
  6667. *
  6668. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  6669. *
  6670. * @details
  6671. * The host will send this Flow Search Engine (FSE) operation message for
  6672. * every flow add/delete operation.
  6673. * The FSE operation includes FSE full cache invalidation or individual entry
  6674. * invalidation.
  6675. * This message can be sent per SOC or per PDEV which is differentiated
  6676. * by pdev id values.
  6677. *
  6678. * |31 16|15 8|7 1|0|
  6679. * |-------------------------------------------------------------|
  6680. * | reserved | pdev_id | MSG_TYPE |
  6681. * |-------------------------------------------------------------|
  6682. * | reserved | operation |I|
  6683. * |-------------------------------------------------------------|
  6684. * | ip_src_addr_31_0 |
  6685. * |-------------------------------------------------------------|
  6686. * | ip_src_addr_63_32 |
  6687. * |-------------------------------------------------------------|
  6688. * | ip_src_addr_95_64 |
  6689. * |-------------------------------------------------------------|
  6690. * | ip_src_addr_127_96 |
  6691. * |-------------------------------------------------------------|
  6692. * | ip_dst_addr_31_0 |
  6693. * |-------------------------------------------------------------|
  6694. * | ip_dst_addr_63_32 |
  6695. * |-------------------------------------------------------------|
  6696. * | ip_dst_addr_95_64 |
  6697. * |-------------------------------------------------------------|
  6698. * | ip_dst_addr_127_96 |
  6699. * |-------------------------------------------------------------|
  6700. * | l4_dst_port | l4_src_port |
  6701. * | (32-bit SPI incase of IPsec) |
  6702. * |-------------------------------------------------------------|
  6703. * | reserved | l4_proto |
  6704. * |-------------------------------------------------------------|
  6705. *
  6706. * where I is 1-bit ipsec_valid.
  6707. *
  6708. * The following field definitions describe the format of the RX FSE operation
  6709. * message sent from the host to target for every add/delete flow entry to flow
  6710. * table.
  6711. *
  6712. * Header fields:
  6713. * dword0 - b'7:0 - msg_type: This will be set to
  6714. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  6715. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6716. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6717. * specified pdev's LMAC ring.
  6718. * b'31:16 - reserved : Reserved for future use
  6719. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  6720. * (Internet Protocol Security).
  6721. * IPsec describes the framework for providing security at
  6722. * IP layer. IPsec is defined for both versions of IP:
  6723. * IPV4 and IPV6.
  6724. * Please refer to htt_rx_flow_proto enumeration below for
  6725. * more info.
  6726. * ipsec_valid = 1 for IPSEC packets
  6727. * ipsec_valid = 0 for IP Packets
  6728. * b'7:1 - operation: This indicates types of FSE operation.
  6729. * Refer to htt_rx_fse_operation enumeration:
  6730. * 0 - No Cache Invalidation required
  6731. * 1 - Cache invalidate only one entry given by IP
  6732. * src/dest address at DWORD[2:9]
  6733. * 2 - Complete FSE Cache Invalidation
  6734. * 3 - FSE Disable
  6735. * 4 - FSE Enable
  6736. * b'31:8 - reserved: Reserved for future use
  6737. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  6738. * for per flow addition/deletion
  6739. * For IPV4 src/dest addresses, the first A_UINT32 is used
  6740. * and the subsequent 3 A_UINT32 will be padding bytes.
  6741. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  6742. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  6743. * from 0 to 65535 but only 0 to 1023 are designated as
  6744. * 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. * - L4 dest port (31:16): 16-bit Destination Port numbers
  6748. * range from 0 to 65535 but only 0 to 1023 are designated
  6749. * as well-known ports. Refer to [RFC1700] for more details.
  6750. * This field is valid only if
  6751. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  6752. * - SPI (31:0): Security Parameters Index is an
  6753. * identification tag added to the header while using IPsec
  6754. * for tunneling the IP traffici.
  6755. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  6756. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  6757. * Assigned Internet Protocol Numbers.
  6758. * l4_proto numbers for standard protocol like UDP/TCP
  6759. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  6760. * l4_proto = 17 for UDP etc.
  6761. * b'31:8 - reserved: Reserved for future use.
  6762. *
  6763. */
  6764. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  6765. A_UINT32 msg_type:8,
  6766. pdev_id:8,
  6767. reserved0:16;
  6768. A_UINT32 ipsec_valid:1,
  6769. operation:7,
  6770. reserved1:24;
  6771. A_UINT32 ip_src_addr_31_0;
  6772. A_UINT32 ip_src_addr_63_32;
  6773. A_UINT32 ip_src_addr_95_64;
  6774. A_UINT32 ip_src_addr_127_96;
  6775. A_UINT32 ip_dest_addr_31_0;
  6776. A_UINT32 ip_dest_addr_63_32;
  6777. A_UINT32 ip_dest_addr_95_64;
  6778. A_UINT32 ip_dest_addr_127_96;
  6779. union {
  6780. A_UINT32 spi;
  6781. struct {
  6782. A_UINT32 l4_src_port:16,
  6783. l4_dest_port:16;
  6784. } ip;
  6785. } u;
  6786. A_UINT32 l4_proto:8,
  6787. reserved:24;
  6788. } POSTPACK;
  6789. /**
  6790. * @brief Host-->target HTT RX Full monitor mode register configuration message
  6791. *
  6792. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  6793. *
  6794. * @details
  6795. * The host will send this Full monitor mode register configuration message.
  6796. * This message can be sent per SOC or per PDEV which is differentiated
  6797. * by pdev id values.
  6798. *
  6799. * |31 16|15 11|10 8|7 3|2|1|0|
  6800. * |-------------------------------------------------------------|
  6801. * | reserved | pdev_id | MSG_TYPE |
  6802. * |-------------------------------------------------------------|
  6803. * | reserved |Release Ring |N|Z|E|
  6804. * |-------------------------------------------------------------|
  6805. *
  6806. * where E is 1-bit full monitor mode enable/disable.
  6807. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  6808. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  6809. *
  6810. * The following field definitions describe the format of the full monitor
  6811. * mode configuration message sent from the host to target for each pdev.
  6812. *
  6813. * Header fields:
  6814. * dword0 - b'7:0 - msg_type: This will be set to
  6815. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  6816. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6817. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  6818. * specified pdev's LMAC ring.
  6819. * b'31:16 - reserved : Reserved for future use.
  6820. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  6821. * monitor mode rxdma register is to be enabled or disabled.
  6822. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  6823. * additional descriptors at ppdu end for zero mpdus
  6824. * enabled or disabled.
  6825. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  6826. * additional descriptors at ppdu end for non zero mpdus
  6827. * enabled or disabled.
  6828. * b'10:3 - release_ring: This indicates the destination ring
  6829. * selection for the descriptor at the end of PPDU
  6830. * 0 - REO ring select
  6831. * 1 - FW ring select
  6832. * 2 - SW ring select
  6833. * 3 - Release ring select
  6834. * Refer to htt_rx_full_mon_release_ring.
  6835. * b'31:11 - reserved for future use
  6836. */
  6837. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  6838. A_UINT32 msg_type:8,
  6839. pdev_id:8,
  6840. reserved0:16;
  6841. A_UINT32 full_monitor_mode_enable:1,
  6842. addnl_descs_zero_mpdus_end:1,
  6843. addnl_descs_non_zero_mpdus_end:1,
  6844. release_ring:8,
  6845. reserved1:21;
  6846. } POSTPACK;
  6847. /**
  6848. * Enumeration for full monitor mode destination ring select
  6849. * 0 - REO destination ring select
  6850. * 1 - FW destination ring select
  6851. * 2 - SW destination ring select
  6852. * 3 - Release destination ring select
  6853. */
  6854. enum htt_rx_full_mon_release_ring {
  6855. HTT_RX_MON_RING_REO,
  6856. HTT_RX_MON_RING_FW,
  6857. HTT_RX_MON_RING_SW,
  6858. HTT_RX_MON_RING_RELEASE,
  6859. };
  6860. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  6861. /* DWORD 0: Pdev ID */
  6862. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  6863. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  6864. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  6865. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  6866. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  6867. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  6868. do { \
  6869. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  6870. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  6871. } while (0)
  6872. /* DWORD 1:ENABLE */
  6873. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  6874. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  6875. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  6876. do { \
  6877. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  6878. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  6879. } while (0)
  6880. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  6881. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  6882. /* DWORD 1:ZERO_MPDU */
  6883. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  6884. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  6885. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  6886. do { \
  6887. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  6888. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  6889. } while (0)
  6890. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  6891. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  6892. /* DWORD 1:NON_ZERO_MPDU */
  6893. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  6894. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  6895. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  6896. do { \
  6897. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  6898. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  6899. } while (0)
  6900. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  6901. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  6902. /* DWORD 1:RELEASE_RINGS */
  6903. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  6904. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  6905. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  6906. do { \
  6907. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  6908. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  6909. } while (0)
  6910. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  6911. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  6912. /**
  6913. * Enumeration for IP Protocol or IPSEC Protocol
  6914. * IPsec describes the framework for providing security at IP layer.
  6915. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  6916. */
  6917. enum htt_rx_flow_proto {
  6918. HTT_RX_FLOW_IP_PROTO,
  6919. HTT_RX_FLOW_IPSEC_PROTO,
  6920. };
  6921. /**
  6922. * Enumeration for FSE Cache Invalidation
  6923. * 0 - No Cache Invalidation required
  6924. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  6925. * 2 - Complete FSE Cache Invalidation
  6926. * 3 - FSE Disable
  6927. * 4 - FSE Enable
  6928. */
  6929. enum htt_rx_fse_operation {
  6930. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  6931. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  6932. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  6933. HTT_RX_FSE_DISABLE,
  6934. HTT_RX_FSE_ENABLE,
  6935. };
  6936. /* DWORD 0: Pdev ID */
  6937. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  6938. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  6939. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  6940. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  6941. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  6942. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  6943. do { \
  6944. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  6945. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  6946. } while (0)
  6947. /* DWORD 1:IP PROTO or IPSEC */
  6948. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  6949. #define HTT_RX_FSE_IPSEC_VALID_S 0
  6950. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  6951. do { \
  6952. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  6953. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  6954. } while (0)
  6955. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  6956. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  6957. /* DWORD 1:FSE Operation */
  6958. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  6959. #define HTT_RX_FSE_OPERATION_S 1
  6960. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  6961. do { \
  6962. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  6963. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  6964. } while (0)
  6965. #define HTT_RX_FSE_OPERATION_GET(word) \
  6966. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  6967. /* DWORD 2-9:IP Address */
  6968. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  6969. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  6970. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  6971. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  6972. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  6973. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  6974. do { \
  6975. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  6976. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  6977. } while (0)
  6978. /* DWORD 10:Source Port Number */
  6979. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  6980. #define HTT_RX_FSE_SOURCEPORT_S 0
  6981. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  6982. do { \
  6983. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  6984. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  6985. } while (0)
  6986. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  6987. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  6988. /* DWORD 11:Destination Port Number */
  6989. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  6990. #define HTT_RX_FSE_DESTPORT_S 16
  6991. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  6992. do { \
  6993. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  6994. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  6995. } while (0)
  6996. #define HTT_RX_FSE_DESTPORT_GET(word) \
  6997. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  6998. /* DWORD 10-11:SPI (In case of IPSEC) */
  6999. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7000. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7001. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7002. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7003. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7004. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7005. do { \
  7006. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7007. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7008. } while (0)
  7009. /* DWORD 12:L4 PROTO */
  7010. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7011. #define HTT_RX_FSE_L4_PROTO_S 0
  7012. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7013. do { \
  7014. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7015. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7016. } while (0)
  7017. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7018. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7019. /**
  7020. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7021. *
  7022. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7023. *
  7024. * |31 24|23 |15 8|7 2|1|0|
  7025. * |----------------+----------------+----------------+----------------|
  7026. * | reserved | pdev_id | msg_type |
  7027. * |---------------------------------+----------------+----------------|
  7028. * | reserved |E|F|
  7029. * |---------------------------------+----------------+----------------|
  7030. * Where E = Configure the target to provide the 3-tuple hash value in
  7031. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7032. * F = Configure the target to provide the 3-tuple hash value in
  7033. * flow_id_toeplitz field of rx_msdu_start tlv
  7034. *
  7035. * The following field definitions describe the format of the 3 tuple hash value
  7036. * message sent from the host to target as part of initialization sequence.
  7037. *
  7038. * Header fields:
  7039. * dword0 - b'7:0 - msg_type: This will be set to
  7040. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7041. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7042. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7043. * specified pdev's LMAC ring.
  7044. * b'31:16 - reserved : Reserved for future use
  7045. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7046. * b'1 - toeplitz_hash_2_or_4_field_enable
  7047. * b'31:2 - reserved : Reserved for future use
  7048. * ---------+------+----------------------------------------------------------
  7049. * bit1 | bit0 | Functionality
  7050. * ---------+------+----------------------------------------------------------
  7051. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7052. * | | in flow_id_toeplitz field
  7053. * ---------+------+----------------------------------------------------------
  7054. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7055. * | | in toeplitz_hash_2_or_4 field
  7056. * ---------+------+----------------------------------------------------------
  7057. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7058. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7059. * ---------+------+----------------------------------------------------------
  7060. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7061. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7062. * | | toeplitz_hash_2_or_4 field
  7063. *----------------------------------------------------------------------------
  7064. */
  7065. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7066. A_UINT32 msg_type :8,
  7067. pdev_id :8,
  7068. reserved0 :16;
  7069. A_UINT32 flow_id_toeplitz_field_enable :1,
  7070. toeplitz_hash_2_or_4_field_enable :1,
  7071. reserved1 :30;
  7072. } POSTPACK;
  7073. /* DWORD0 : pdev_id configuration Macros */
  7074. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7075. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7076. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7077. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7078. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7079. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7080. do { \
  7081. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7082. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7083. } while (0)
  7084. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7085. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7086. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7087. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7088. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7089. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7090. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7091. do { \
  7092. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7093. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7094. } while (0)
  7095. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7096. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7097. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7098. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7099. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7100. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7101. do { \
  7102. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7103. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7104. } while (0)
  7105. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7106. /**
  7107. * @brief host --> target Host PA Address Size
  7108. *
  7109. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7110. *
  7111. * @details
  7112. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7113. * provide the physical start address and size of each of the memory
  7114. * areas within host DDR that the target FW may need to access.
  7115. *
  7116. * For example, the host can use this message to allow the target FW
  7117. * to set up access to the host's pools of TQM link descriptors.
  7118. * The message would appear as follows:
  7119. *
  7120. * |31 24|23 16|15 8|7 0|
  7121. * |----------------+----------------+----------------+----------------|
  7122. * | reserved | num_entries | msg_type |
  7123. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7124. * | mem area 0 size |
  7125. * |----------------+----------------+----------------+----------------|
  7126. * | mem area 0 physical_address_lo |
  7127. * |----------------+----------------+----------------+----------------|
  7128. * | mem area 0 physical_address_hi |
  7129. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7130. * | mem area 1 size |
  7131. * |----------------+----------------+----------------+----------------|
  7132. * | mem area 1 physical_address_lo |
  7133. * |----------------+----------------+----------------+----------------|
  7134. * | mem area 1 physical_address_hi |
  7135. * |----------------+----------------+----------------+----------------|
  7136. * ...
  7137. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7138. * | mem area N size |
  7139. * |----------------+----------------+----------------+----------------|
  7140. * | mem area N physical_address_lo |
  7141. * |----------------+----------------+----------------+----------------|
  7142. * | mem area N physical_address_hi |
  7143. * |----------------+----------------+----------------+----------------|
  7144. *
  7145. * The message is interpreted as follows:
  7146. * dword0 - b'0:7 - msg_type: This will be set to
  7147. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7148. * b'8:15 - number_entries: Indicated the number of host memory
  7149. * areas specified within the remainder of the message
  7150. * b'16:31 - reserved.
  7151. * dword1 - b'0:31 - memory area 0 size in bytes
  7152. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7153. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7154. * and similar for memory area 1 through memory area N.
  7155. */
  7156. PREPACK struct htt_h2t_host_paddr_size {
  7157. A_UINT32 msg_type: 8,
  7158. num_entries: 8,
  7159. reserved: 16;
  7160. } POSTPACK;
  7161. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7162. A_UINT32 size;
  7163. A_UINT32 physical_address_lo;
  7164. A_UINT32 physical_address_hi;
  7165. } POSTPACK;
  7166. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7167. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7168. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7169. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7170. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7171. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7172. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7173. do { \
  7174. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7175. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7176. } while (0)
  7177. /**
  7178. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7179. *
  7180. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7181. *
  7182. * @details
  7183. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7184. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7185. *
  7186. * The message would appear as follows:
  7187. *
  7188. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7189. * |---------------------------------+---+---+----------+-+-----------|
  7190. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7191. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7192. *
  7193. *
  7194. * The message is interpreted as follows:
  7195. * dword0 - b'0:7 - msg_type: This will be set to
  7196. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7197. * b'8 - override bit to drive MSDUs to PPE ring
  7198. * b'9:13 - REO destination ring indication
  7199. * b'14 - Multi buffer msdu override enable bit
  7200. * b'15 - Intra BSS override
  7201. * b'16 - Decap raw override
  7202. * b'17 - Decap Native wifi override
  7203. * b'18 - IP frag override
  7204. * b'19:31 - reserved
  7205. */
  7206. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7207. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7208. override: 1,
  7209. reo_destination_indication: 5,
  7210. multi_buffer_msdu_override_en: 1,
  7211. intra_bss_override: 1,
  7212. decap_raw_override: 1,
  7213. decap_nwifi_override: 1,
  7214. ip_frag_override: 1,
  7215. reserved: 13;
  7216. } POSTPACK;
  7217. /* DWORD 0: Override */
  7218. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7219. #define HTT_PPE_CFG_OVERRIDE_S 8
  7220. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7221. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7222. HTT_PPE_CFG_OVERRIDE_S)
  7223. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7224. do { \
  7225. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7226. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7227. } while (0)
  7228. /* DWORD 0: REO Destination Indication*/
  7229. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7230. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7231. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7232. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7233. HTT_PPE_CFG_REO_DEST_IND_S)
  7234. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7235. do { \
  7236. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7237. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7238. } while (0)
  7239. /* DWORD 0: Multi buffer MSDU override */
  7240. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7241. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7242. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7243. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7244. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7245. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7246. do { \
  7247. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7248. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7249. } while (0)
  7250. /* DWORD 0: Intra BSS override */
  7251. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7252. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7253. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7254. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7255. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7256. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7257. do { \
  7258. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7259. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7260. } while (0)
  7261. /* DWORD 0: Decap RAW override */
  7262. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7263. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7264. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7265. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7266. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7267. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7268. do { \
  7269. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7270. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7271. } while (0)
  7272. /* DWORD 0: Decap NWIFI override */
  7273. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7274. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7275. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7276. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7277. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7278. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7279. do { \
  7280. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7281. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7282. } while (0)
  7283. /* DWORD 0: IP frag override */
  7284. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7285. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7286. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7287. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7288. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  7289. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  7290. do { \
  7291. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  7292. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  7293. } while (0)
  7294. /*
  7295. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  7296. *
  7297. * @details
  7298. * The following field definitions describe the format of the HTT host
  7299. * to target FW VDEV TX RX stats retrieve message.
  7300. * The message specifies the type of stats the host wants to retrieve.
  7301. *
  7302. * |31 27|26 25|24 17|16|15 8|7 0|
  7303. * |-----------------------------------------------------------|
  7304. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  7305. * |-----------------------------------------------------------|
  7306. * | vdev_id lower bitmask |
  7307. * |-----------------------------------------------------------|
  7308. * | vdev_id upper bitmask |
  7309. * |-----------------------------------------------------------|
  7310. * Header fields:
  7311. * Where:
  7312. * dword0 - b'7:0 - msg_type: This will be set to
  7313. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  7314. * b'15:8 - pdev id
  7315. * b'16(E) - Enable/Disable the vdev HW stats
  7316. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  7317. * b'25:26(R) - Reset stats bits
  7318. * 0: don't reset stats
  7319. * 1: reset stats once
  7320. * 2: reset stats at the start of each periodic interval
  7321. * b'27:31 - reserved for future use
  7322. * dword1 - b'0:31 - vdev_id lower bitmask
  7323. * dword2 - b'0:31 - vdev_id upper bitmask
  7324. */
  7325. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  7326. A_UINT32 msg_type :8,
  7327. pdev_id :8,
  7328. enable :1,
  7329. periodic_interval :8,
  7330. reset_stats_bits :2,
  7331. reserved0 :5;
  7332. A_UINT32 vdev_id_lower_bitmask;
  7333. A_UINT32 vdev_id_upper_bitmask;
  7334. } POSTPACK;
  7335. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  7336. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  7337. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  7338. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  7339. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  7340. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  7341. do { \
  7342. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  7343. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  7344. } while (0)
  7345. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  7346. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  7347. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  7348. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  7349. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  7350. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  7351. do { \
  7352. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  7353. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  7354. } while (0)
  7355. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  7356. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  7357. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  7358. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  7359. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  7360. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  7361. do { \
  7362. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  7363. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  7364. } while (0)
  7365. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  7366. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  7367. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  7368. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  7369. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  7370. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  7371. do { \
  7372. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  7373. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  7374. } while (0)
  7375. /*=== target -> host messages ===============================================*/
  7376. enum htt_t2h_msg_type {
  7377. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  7378. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  7379. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  7380. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  7381. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  7382. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  7383. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  7384. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  7385. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  7386. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  7387. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  7388. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  7389. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  7390. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  7391. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  7392. /* only used for HL, add HTT MSG for HTT CREDIT update */
  7393. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  7394. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  7395. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  7396. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  7397. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  7398. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  7399. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  7400. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  7401. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  7402. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  7403. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  7404. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  7405. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  7406. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  7407. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  7408. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  7409. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  7410. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  7411. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  7412. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  7413. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  7414. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  7415. /* TX_OFFLOAD_DELIVER_IND:
  7416. * Forward the target's locally-generated packets to the host,
  7417. * to provide to the monitor mode interface.
  7418. */
  7419. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  7420. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  7421. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  7422. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  7423. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  7424. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  7425. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  7426. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  7427. HTT_T2H_MSG_TYPE_TEST,
  7428. /* keep this last */
  7429. HTT_T2H_NUM_MSGS
  7430. };
  7431. /*
  7432. * HTT target to host message type -
  7433. * stored in bits 7:0 of the first word of the message
  7434. */
  7435. #define HTT_T2H_MSG_TYPE_M 0xff
  7436. #define HTT_T2H_MSG_TYPE_S 0
  7437. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  7438. do { \
  7439. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  7440. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  7441. } while (0)
  7442. #define HTT_T2H_MSG_TYPE_GET(word) \
  7443. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  7444. /**
  7445. * @brief target -> host version number confirmation message definition
  7446. *
  7447. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  7448. *
  7449. * |31 24|23 16|15 8|7 0|
  7450. * |----------------+----------------+----------------+----------------|
  7451. * | reserved | major number | minor number | msg type |
  7452. * |-------------------------------------------------------------------|
  7453. * : option request TLV (optional) |
  7454. * :...................................................................:
  7455. *
  7456. * The VER_CONF message may consist of a single 4-byte word, or may be
  7457. * extended with TLVs that specify HTT options selected by the target.
  7458. * The following option TLVs may be appended to the VER_CONF message:
  7459. * - LL_BUS_ADDR_SIZE
  7460. * - HL_SUPPRESS_TX_COMPL_IND
  7461. * - MAX_TX_QUEUE_GROUPS
  7462. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  7463. * may be appended to the VER_CONF message (but only one TLV of each type).
  7464. *
  7465. * Header fields:
  7466. * - MSG_TYPE
  7467. * Bits 7:0
  7468. * Purpose: identifies this as a version number confirmation message
  7469. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  7470. * - VER_MINOR
  7471. * Bits 15:8
  7472. * Purpose: Specify the minor number of the HTT message library version
  7473. * in use by the target firmware.
  7474. * The minor number specifies the specific revision within a range
  7475. * of fundamentally compatible HTT message definition revisions.
  7476. * Compatible revisions involve adding new messages or perhaps
  7477. * adding new fields to existing messages, in a backwards-compatible
  7478. * manner.
  7479. * Incompatible revisions involve changing the message type values,
  7480. * or redefining existing messages.
  7481. * Value: minor number
  7482. * - VER_MAJOR
  7483. * Bits 15:8
  7484. * Purpose: Specify the major number of the HTT message library version
  7485. * in use by the target firmware.
  7486. * The major number specifies the family of minor revisions that are
  7487. * fundamentally compatible with each other, but not with prior or
  7488. * later families.
  7489. * Value: major number
  7490. */
  7491. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  7492. #define HTT_VER_CONF_MINOR_S 8
  7493. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  7494. #define HTT_VER_CONF_MAJOR_S 16
  7495. #define HTT_VER_CONF_MINOR_SET(word, value) \
  7496. do { \
  7497. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  7498. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  7499. } while (0)
  7500. #define HTT_VER_CONF_MINOR_GET(word) \
  7501. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  7502. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  7503. do { \
  7504. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  7505. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  7506. } while (0)
  7507. #define HTT_VER_CONF_MAJOR_GET(word) \
  7508. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  7509. #define HTT_VER_CONF_BYTES 4
  7510. /**
  7511. * @brief - target -> host HTT Rx In order indication message
  7512. *
  7513. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  7514. *
  7515. * @details
  7516. *
  7517. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  7518. * |----------------+-------------------+---------------------+---------------|
  7519. * | peer ID | P| F| O| ext TID | msg type |
  7520. * |--------------------------------------------------------------------------|
  7521. * | MSDU count | Reserved | vdev id |
  7522. * |--------------------------------------------------------------------------|
  7523. * | MSDU 0 bus address (bits 31:0) |
  7524. #if HTT_PADDR64
  7525. * | MSDU 0 bus address (bits 63:32) |
  7526. #endif
  7527. * |--------------------------------------------------------------------------|
  7528. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  7529. * |--------------------------------------------------------------------------|
  7530. * | MSDU 1 bus address (bits 31:0) |
  7531. #if HTT_PADDR64
  7532. * | MSDU 1 bus address (bits 63:32) |
  7533. #endif
  7534. * |--------------------------------------------------------------------------|
  7535. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  7536. * |--------------------------------------------------------------------------|
  7537. */
  7538. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  7539. *
  7540. * @details
  7541. * bits
  7542. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  7543. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7544. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  7545. * | | frag | | | | fail |chksum fail|
  7546. * |-----+----+-------+--------+--------+---------+---------+-----------|
  7547. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  7548. */
  7549. struct htt_rx_in_ord_paddr_ind_hdr_t
  7550. {
  7551. A_UINT32 /* word 0 */
  7552. msg_type: 8,
  7553. ext_tid: 5,
  7554. offload: 1,
  7555. frag: 1,
  7556. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  7557. peer_id: 16;
  7558. A_UINT32 /* word 1 */
  7559. vap_id: 8,
  7560. /* NOTE:
  7561. * This reserved_1 field is not truly reserved - certain targets use
  7562. * this field internally to store debug information, and do not zero
  7563. * out the contents of the field before uploading the message to the
  7564. * host. Thus, any host-target communication supported by this field
  7565. * is limited to using values that are never used by the debug
  7566. * information stored by certain targets in the reserved_1 field.
  7567. * In particular, the targets in question don't use the value 0x3
  7568. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  7569. * so this previously-unused value within these bits is available to
  7570. * use as the host / target PKT_CAPTURE_MODE flag.
  7571. */
  7572. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  7573. /* if pkt_capture_mode == 0x3, host should
  7574. * send rx frames to monitor mode interface
  7575. */
  7576. msdu_cnt: 16;
  7577. };
  7578. struct htt_rx_in_ord_paddr_ind_msdu32_t
  7579. {
  7580. A_UINT32 dma_addr;
  7581. A_UINT32
  7582. length: 16,
  7583. fw_desc: 8,
  7584. msdu_info:8;
  7585. };
  7586. struct htt_rx_in_ord_paddr_ind_msdu64_t
  7587. {
  7588. A_UINT32 dma_addr_lo;
  7589. A_UINT32 dma_addr_hi;
  7590. A_UINT32
  7591. length: 16,
  7592. fw_desc: 8,
  7593. msdu_info:8;
  7594. };
  7595. #if HTT_PADDR64
  7596. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  7597. #else
  7598. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  7599. #endif
  7600. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  7601. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  7602. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  7603. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  7604. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  7605. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  7606. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  7607. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  7608. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  7609. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  7610. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  7611. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  7612. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  7613. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  7614. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  7615. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  7616. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  7617. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  7618. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  7619. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  7620. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  7621. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  7622. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  7623. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  7624. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  7625. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  7626. /* for systems using 64-bit format for bus addresses */
  7627. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  7628. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  7629. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  7630. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  7631. /* for systems using 32-bit format for bus addresses */
  7632. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  7633. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  7634. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  7635. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  7636. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  7637. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  7638. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  7639. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  7640. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  7641. do { \
  7642. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  7643. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  7644. } while (0)
  7645. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  7646. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  7647. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  7648. do { \
  7649. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  7650. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  7651. } while (0)
  7652. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  7653. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  7654. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  7655. do { \
  7656. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  7657. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  7658. } while (0)
  7659. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  7660. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  7661. /*
  7662. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  7663. * deliver the rx frames to the monitor mode interface.
  7664. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  7665. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  7666. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  7667. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  7668. */
  7669. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  7670. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  7671. do { \
  7672. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  7673. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  7674. } while (0)
  7675. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  7676. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  7677. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  7678. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  7679. do { \
  7680. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  7681. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  7682. } while (0)
  7683. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  7684. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  7685. /* for systems using 64-bit format for bus addresses */
  7686. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  7687. do { \
  7688. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  7689. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  7690. } while (0)
  7691. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  7692. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  7693. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  7694. do { \
  7695. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  7696. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  7697. } while (0)
  7698. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  7699. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  7700. /* for systems using 32-bit format for bus addresses */
  7701. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  7702. do { \
  7703. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  7704. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  7705. } while (0)
  7706. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  7707. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  7708. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  7709. do { \
  7710. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  7711. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  7712. } while (0)
  7713. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  7714. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  7715. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  7716. do { \
  7717. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  7718. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  7719. } while (0)
  7720. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  7721. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  7722. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  7723. do { \
  7724. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  7725. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  7726. } while (0)
  7727. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  7728. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  7729. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  7730. do { \
  7731. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  7732. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  7733. } while (0)
  7734. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  7735. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  7736. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  7737. do { \
  7738. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  7739. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  7740. } while (0)
  7741. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  7742. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  7743. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  7744. do { \
  7745. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  7746. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  7747. } while (0)
  7748. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  7749. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  7750. /* definitions used within target -> host rx indication message */
  7751. PREPACK struct htt_rx_ind_hdr_prefix_t
  7752. {
  7753. A_UINT32 /* word 0 */
  7754. msg_type: 8,
  7755. ext_tid: 5,
  7756. release_valid: 1,
  7757. flush_valid: 1,
  7758. reserved0: 1,
  7759. peer_id: 16;
  7760. A_UINT32 /* word 1 */
  7761. flush_start_seq_num: 6,
  7762. flush_end_seq_num: 6,
  7763. release_start_seq_num: 6,
  7764. release_end_seq_num: 6,
  7765. num_mpdu_ranges: 8;
  7766. } POSTPACK;
  7767. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  7768. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  7769. #define HTT_TGT_RSSI_INVALID 0x80
  7770. PREPACK struct htt_rx_ppdu_desc_t
  7771. {
  7772. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  7773. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  7774. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  7775. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  7776. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  7777. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  7778. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  7779. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  7780. A_UINT32 /* word 0 */
  7781. rssi_cmb: 8,
  7782. timestamp_submicrosec: 8,
  7783. phy_err_code: 8,
  7784. phy_err: 1,
  7785. legacy_rate: 4,
  7786. legacy_rate_sel: 1,
  7787. end_valid: 1,
  7788. start_valid: 1;
  7789. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  7790. union {
  7791. A_UINT32 /* word 1 */
  7792. rssi0_pri20: 8,
  7793. rssi0_ext20: 8,
  7794. rssi0_ext40: 8,
  7795. rssi0_ext80: 8;
  7796. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  7797. } u0;
  7798. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  7799. union {
  7800. A_UINT32 /* word 2 */
  7801. rssi1_pri20: 8,
  7802. rssi1_ext20: 8,
  7803. rssi1_ext40: 8,
  7804. rssi1_ext80: 8;
  7805. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  7806. } u1;
  7807. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  7808. union {
  7809. A_UINT32 /* word 3 */
  7810. rssi2_pri20: 8,
  7811. rssi2_ext20: 8,
  7812. rssi2_ext40: 8,
  7813. rssi2_ext80: 8;
  7814. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  7815. } u2;
  7816. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  7817. union {
  7818. A_UINT32 /* word 4 */
  7819. rssi3_pri20: 8,
  7820. rssi3_ext20: 8,
  7821. rssi3_ext40: 8,
  7822. rssi3_ext80: 8;
  7823. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  7824. } u3;
  7825. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  7826. A_UINT32 tsf32; /* word 5 */
  7827. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  7828. A_UINT32 timestamp_microsec; /* word 6 */
  7829. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  7830. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  7831. A_UINT32 /* word 7 */
  7832. vht_sig_a1: 24,
  7833. preamble_type: 8;
  7834. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  7835. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  7836. A_UINT32 /* word 8 */
  7837. vht_sig_a2: 24,
  7838. /* sa_ant_matrix
  7839. * For cases where a single rx chain has options to be connected to
  7840. * different rx antennas, show which rx antennas were in use during
  7841. * receipt of a given PPDU.
  7842. * This sa_ant_matrix provides a bitmask of the antennas used while
  7843. * receiving this frame.
  7844. */
  7845. sa_ant_matrix: 8;
  7846. } POSTPACK;
  7847. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  7848. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  7849. PREPACK struct htt_rx_ind_hdr_suffix_t
  7850. {
  7851. A_UINT32 /* word 0 */
  7852. fw_rx_desc_bytes: 16,
  7853. reserved0: 16;
  7854. } POSTPACK;
  7855. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  7856. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  7857. PREPACK struct htt_rx_ind_hdr_t
  7858. {
  7859. struct htt_rx_ind_hdr_prefix_t prefix;
  7860. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  7861. struct htt_rx_ind_hdr_suffix_t suffix;
  7862. } POSTPACK;
  7863. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  7864. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  7865. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  7866. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  7867. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  7868. /*
  7869. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  7870. * the offset into the HTT rx indication message at which the
  7871. * FW rx PPDU descriptor resides
  7872. */
  7873. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  7874. /*
  7875. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  7876. * the offset into the HTT rx indication message at which the
  7877. * header suffix (FW rx MSDU byte count) resides
  7878. */
  7879. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  7880. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  7881. /*
  7882. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  7883. * the offset into the HTT rx indication message at which the per-MSDU
  7884. * information starts
  7885. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  7886. * per-MSDU information portion of the message. The per-MSDU info itself
  7887. * starts at byte 12.
  7888. */
  7889. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  7890. /**
  7891. * @brief target -> host rx indication message definition
  7892. *
  7893. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  7894. *
  7895. * @details
  7896. * The following field definitions describe the format of the rx indication
  7897. * message sent from the target to the host.
  7898. * The message consists of three major sections:
  7899. * 1. a fixed-length header
  7900. * 2. a variable-length list of firmware rx MSDU descriptors
  7901. * 3. one or more 4-octet MPDU range information elements
  7902. * The fixed length header itself has two sub-sections
  7903. * 1. the message meta-information, including identification of the
  7904. * sender and type of the received data, and a 4-octet flush/release IE
  7905. * 2. the firmware rx PPDU descriptor
  7906. *
  7907. * The format of the message is depicted below.
  7908. * in this depiction, the following abbreviations are used for information
  7909. * elements within the message:
  7910. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  7911. * elements associated with the PPDU start are valid.
  7912. * Specifically, the following fields are valid only if SV is set:
  7913. * RSSI (all variants), L, legacy rate, preamble type, service,
  7914. * VHT-SIG-A
  7915. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  7916. * elements associated with the PPDU end are valid.
  7917. * Specifically, the following fields are valid only if EV is set:
  7918. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  7919. * - L - Legacy rate selector - if legacy rates are used, this flag
  7920. * indicates whether the rate is from a CCK (L == 1) or OFDM
  7921. * (L == 0) PHY.
  7922. * - P - PHY error flag - boolean indication of whether the rx frame had
  7923. * a PHY error
  7924. *
  7925. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  7926. * |----------------+-------------------+---------------------+---------------|
  7927. * | peer ID | |RV|FV| ext TID | msg type |
  7928. * |--------------------------------------------------------------------------|
  7929. * | num | release | release | flush | flush |
  7930. * | MPDU | end | start | end | start |
  7931. * | ranges | seq num | seq num | seq num | seq num |
  7932. * |==========================================================================|
  7933. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  7934. * |V|V| | rate | | | timestamp | RSSI |
  7935. * |--------------------------------------------------------------------------|
  7936. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  7937. * |--------------------------------------------------------------------------|
  7938. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  7939. * |--------------------------------------------------------------------------|
  7940. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  7941. * |--------------------------------------------------------------------------|
  7942. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  7943. * |--------------------------------------------------------------------------|
  7944. * | TSF LSBs |
  7945. * |--------------------------------------------------------------------------|
  7946. * | microsec timestamp |
  7947. * |--------------------------------------------------------------------------|
  7948. * | preamble type | HT-SIG / VHT-SIG-A1 |
  7949. * |--------------------------------------------------------------------------|
  7950. * | service | HT-SIG / VHT-SIG-A2 |
  7951. * |==========================================================================|
  7952. * | reserved | FW rx desc bytes |
  7953. * |--------------------------------------------------------------------------|
  7954. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  7955. * | desc B3 | desc B2 | desc B1 | desc B0 |
  7956. * |--------------------------------------------------------------------------|
  7957. * : : :
  7958. * |--------------------------------------------------------------------------|
  7959. * | alignment | MSDU Rx |
  7960. * | padding | desc Bn |
  7961. * |--------------------------------------------------------------------------|
  7962. * | reserved | MPDU range status | MPDU count |
  7963. * |--------------------------------------------------------------------------|
  7964. * : reserved : MPDU range status : MPDU count :
  7965. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  7966. *
  7967. * Header fields:
  7968. * - MSG_TYPE
  7969. * Bits 7:0
  7970. * Purpose: identifies this as an rx indication message
  7971. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  7972. * - EXT_TID
  7973. * Bits 12:8
  7974. * Purpose: identify the traffic ID of the rx data, including
  7975. * special "extended" TID values for multicast, broadcast, and
  7976. * non-QoS data frames
  7977. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  7978. * - FLUSH_VALID (FV)
  7979. * Bit 13
  7980. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  7981. * is valid
  7982. * Value:
  7983. * 1 -> flush IE is valid and needs to be processed
  7984. * 0 -> flush IE is not valid and should be ignored
  7985. * - REL_VALID (RV)
  7986. * Bit 13
  7987. * Purpose: indicate whether the release IE (start/end sequence numbers)
  7988. * is valid
  7989. * Value:
  7990. * 1 -> release IE is valid and needs to be processed
  7991. * 0 -> release IE is not valid and should be ignored
  7992. * - PEER_ID
  7993. * Bits 31:16
  7994. * Purpose: Identify, by ID, which peer sent the rx data
  7995. * Value: ID of the peer who sent the rx data
  7996. * - FLUSH_SEQ_NUM_START
  7997. * Bits 5:0
  7998. * Purpose: Indicate the start of a series of MPDUs to flush
  7999. * Not all MPDUs within this series are necessarily valid - the host
  8000. * must check each sequence number within this range to see if the
  8001. * corresponding MPDU is actually present.
  8002. * This field is only valid if the FV bit is set.
  8003. * Value:
  8004. * The sequence number for the first MPDUs to check to flush.
  8005. * The sequence number is masked by 0x3f.
  8006. * - FLUSH_SEQ_NUM_END
  8007. * Bits 11:6
  8008. * Purpose: Indicate the end of a series of MPDUs to flush
  8009. * Value:
  8010. * The sequence number one larger than the sequence number of the
  8011. * last MPDU to check to flush.
  8012. * The sequence number is masked by 0x3f.
  8013. * Not all MPDUs within this series are necessarily valid - the host
  8014. * must check each sequence number within this range to see if the
  8015. * corresponding MPDU is actually present.
  8016. * This field is only valid if the FV bit is set.
  8017. * - REL_SEQ_NUM_START
  8018. * Bits 17:12
  8019. * Purpose: Indicate the start of a series of MPDUs to release.
  8020. * All MPDUs within this series are present and valid - the host
  8021. * need not check each sequence number within this range to see if
  8022. * the corresponding MPDU is actually present.
  8023. * This field is only valid if the RV bit is set.
  8024. * Value:
  8025. * The sequence number for the first MPDUs to check to release.
  8026. * The sequence number is masked by 0x3f.
  8027. * - REL_SEQ_NUM_END
  8028. * Bits 23:18
  8029. * Purpose: Indicate the end of a series of MPDUs to release.
  8030. * Value:
  8031. * The sequence number one larger than the sequence number of the
  8032. * last MPDU to check to release.
  8033. * The sequence number is masked by 0x3f.
  8034. * All MPDUs within this series are present and valid - the host
  8035. * need not check each sequence number within this range to see if
  8036. * the corresponding MPDU is actually present.
  8037. * This field is only valid if the RV bit is set.
  8038. * - NUM_MPDU_RANGES
  8039. * Bits 31:24
  8040. * Purpose: Indicate how many ranges of MPDUs are present.
  8041. * Each MPDU range consists of a series of contiguous MPDUs within the
  8042. * rx frame sequence which all have the same MPDU status.
  8043. * Value: 1-63 (typically a small number, like 1-3)
  8044. *
  8045. * Rx PPDU descriptor fields:
  8046. * - RSSI_CMB
  8047. * Bits 7:0
  8048. * Purpose: Combined RSSI from all active rx chains, across the active
  8049. * bandwidth.
  8050. * Value: RSSI dB units w.r.t. noise floor
  8051. * - TIMESTAMP_SUBMICROSEC
  8052. * Bits 15:8
  8053. * Purpose: high-resolution timestamp
  8054. * Value:
  8055. * Sub-microsecond time of PPDU reception.
  8056. * This timestamp ranges from [0,MAC clock MHz).
  8057. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8058. * to form a high-resolution, large range rx timestamp.
  8059. * - PHY_ERR_CODE
  8060. * Bits 23:16
  8061. * Purpose:
  8062. * If the rx frame processing resulted in a PHY error, indicate what
  8063. * type of rx PHY error occurred.
  8064. * Value:
  8065. * This field is valid if the "P" (PHY_ERR) flag is set.
  8066. * TBD: document/specify the values for this field
  8067. * - PHY_ERR
  8068. * Bit 24
  8069. * Purpose: indicate whether the rx PPDU had a PHY error
  8070. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8071. * - LEGACY_RATE
  8072. * Bits 28:25
  8073. * Purpose:
  8074. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8075. * specify which rate was used.
  8076. * Value:
  8077. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8078. * flag.
  8079. * If LEGACY_RATE_SEL is 0:
  8080. * 0x8: OFDM 48 Mbps
  8081. * 0x9: OFDM 24 Mbps
  8082. * 0xA: OFDM 12 Mbps
  8083. * 0xB: OFDM 6 Mbps
  8084. * 0xC: OFDM 54 Mbps
  8085. * 0xD: OFDM 36 Mbps
  8086. * 0xE: OFDM 18 Mbps
  8087. * 0xF: OFDM 9 Mbps
  8088. * If LEGACY_RATE_SEL is 1:
  8089. * 0x8: CCK 11 Mbps long preamble
  8090. * 0x9: CCK 5.5 Mbps long preamble
  8091. * 0xA: CCK 2 Mbps long preamble
  8092. * 0xB: CCK 1 Mbps long preamble
  8093. * 0xC: CCK 11 Mbps short preamble
  8094. * 0xD: CCK 5.5 Mbps short preamble
  8095. * 0xE: CCK 2 Mbps short preamble
  8096. * - LEGACY_RATE_SEL
  8097. * Bit 29
  8098. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8099. * Value:
  8100. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8101. * used a legacy rate.
  8102. * 0 -> OFDM, 1 -> CCK
  8103. * - END_VALID
  8104. * Bit 30
  8105. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8106. * the start of the PPDU are valid. Specifically, the following
  8107. * fields are only valid if END_VALID is set:
  8108. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8109. * TIMESTAMP_SUBMICROSEC
  8110. * Value:
  8111. * 0 -> rx PPDU desc end fields are not valid
  8112. * 1 -> rx PPDU desc end fields are valid
  8113. * - START_VALID
  8114. * Bit 31
  8115. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8116. * the end of the PPDU are valid. Specifically, the following
  8117. * fields are only valid if START_VALID is set:
  8118. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8119. * VHT-SIG-A
  8120. * Value:
  8121. * 0 -> rx PPDU desc start fields are not valid
  8122. * 1 -> rx PPDU desc start fields are valid
  8123. * - RSSI0_PRI20
  8124. * Bits 7:0
  8125. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8126. * Value: RSSI dB units w.r.t. noise floor
  8127. *
  8128. * - RSSI0_EXT20
  8129. * Bits 7:0
  8130. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8131. * (if the rx bandwidth was >= 40 MHz)
  8132. * Value: RSSI dB units w.r.t. noise floor
  8133. * - RSSI0_EXT40
  8134. * Bits 7:0
  8135. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8136. * (if the rx bandwidth was >= 80 MHz)
  8137. * Value: RSSI dB units w.r.t. noise floor
  8138. * - RSSI0_EXT80
  8139. * Bits 7:0
  8140. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8141. * (if the rx bandwidth was >= 160 MHz)
  8142. * Value: RSSI dB units w.r.t. noise floor
  8143. *
  8144. * - RSSI1_PRI20
  8145. * Bits 7:0
  8146. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  8147. * Value: RSSI dB units w.r.t. noise floor
  8148. * - RSSI1_EXT20
  8149. * Bits 7:0
  8150. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  8151. * (if the rx bandwidth was >= 40 MHz)
  8152. * Value: RSSI dB units w.r.t. noise floor
  8153. * - RSSI1_EXT40
  8154. * Bits 7:0
  8155. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  8156. * (if the rx bandwidth was >= 80 MHz)
  8157. * Value: RSSI dB units w.r.t. noise floor
  8158. * - RSSI1_EXT80
  8159. * Bits 7:0
  8160. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  8161. * (if the rx bandwidth was >= 160 MHz)
  8162. * Value: RSSI dB units w.r.t. noise floor
  8163. *
  8164. * - RSSI2_PRI20
  8165. * Bits 7:0
  8166. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  8167. * Value: RSSI dB units w.r.t. noise floor
  8168. * - RSSI2_EXT20
  8169. * Bits 7:0
  8170. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  8171. * (if the rx bandwidth was >= 40 MHz)
  8172. * Value: RSSI dB units w.r.t. noise floor
  8173. * - RSSI2_EXT40
  8174. * Bits 7:0
  8175. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  8176. * (if the rx bandwidth was >= 80 MHz)
  8177. * Value: RSSI dB units w.r.t. noise floor
  8178. * - RSSI2_EXT80
  8179. * Bits 7:0
  8180. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  8181. * (if the rx bandwidth was >= 160 MHz)
  8182. * Value: RSSI dB units w.r.t. noise floor
  8183. *
  8184. * - RSSI3_PRI20
  8185. * Bits 7:0
  8186. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  8187. * Value: RSSI dB units w.r.t. noise floor
  8188. * - RSSI3_EXT20
  8189. * Bits 7:0
  8190. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  8191. * (if the rx bandwidth was >= 40 MHz)
  8192. * Value: RSSI dB units w.r.t. noise floor
  8193. * - RSSI3_EXT40
  8194. * Bits 7:0
  8195. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  8196. * (if the rx bandwidth was >= 80 MHz)
  8197. * Value: RSSI dB units w.r.t. noise floor
  8198. * - RSSI3_EXT80
  8199. * Bits 7:0
  8200. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  8201. * (if the rx bandwidth was >= 160 MHz)
  8202. * Value: RSSI dB units w.r.t. noise floor
  8203. *
  8204. * - TSF32
  8205. * Bits 31:0
  8206. * Purpose: specify the time the rx PPDU was received, in TSF units
  8207. * Value: 32 LSBs of the TSF
  8208. * - TIMESTAMP_MICROSEC
  8209. * Bits 31:0
  8210. * Purpose: specify the time the rx PPDU was received, in microsecond units
  8211. * Value: PPDU rx time, in microseconds
  8212. * - VHT_SIG_A1
  8213. * Bits 23:0
  8214. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  8215. * from the rx PPDU
  8216. * Value:
  8217. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8218. * VHT-SIG-A1 data.
  8219. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8220. * first 24 bits of the HT-SIG data.
  8221. * Otherwise, this field is invalid.
  8222. * Refer to the the 802.11 protocol for the definition of the
  8223. * HT-SIG and VHT-SIG-A1 fields
  8224. * - VHT_SIG_A2
  8225. * Bits 23:0
  8226. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  8227. * from the rx PPDU
  8228. * Value:
  8229. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8230. * VHT-SIG-A2 data.
  8231. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8232. * last 24 bits of the HT-SIG data.
  8233. * Otherwise, this field is invalid.
  8234. * Refer to the the 802.11 protocol for the definition of the
  8235. * HT-SIG and VHT-SIG-A2 fields
  8236. * - PREAMBLE_TYPE
  8237. * Bits 31:24
  8238. * Purpose: indicate the PHY format of the received burst
  8239. * Value:
  8240. * 0x4: Legacy (OFDM/CCK)
  8241. * 0x8: HT
  8242. * 0x9: HT with TxBF
  8243. * 0xC: VHT
  8244. * 0xD: VHT with TxBF
  8245. * - SERVICE
  8246. * Bits 31:24
  8247. * Purpose: TBD
  8248. * Value: TBD
  8249. *
  8250. * Rx MSDU descriptor fields:
  8251. * - FW_RX_DESC_BYTES
  8252. * Bits 15:0
  8253. * Purpose: Indicate how many bytes in the Rx indication are used for
  8254. * FW Rx descriptors
  8255. *
  8256. * Payload fields:
  8257. * - MPDU_COUNT
  8258. * Bits 7:0
  8259. * Purpose: Indicate how many sequential MPDUs share the same status.
  8260. * All MPDUs within the indicated list are from the same RA-TA-TID.
  8261. * - MPDU_STATUS
  8262. * Bits 15:8
  8263. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  8264. * received successfully.
  8265. * Value:
  8266. * 0x1: success
  8267. * 0x2: FCS error
  8268. * 0x3: duplicate error
  8269. * 0x4: replay error
  8270. * 0x5: invalid peer
  8271. */
  8272. /* header fields */
  8273. #define HTT_RX_IND_EXT_TID_M 0x1f00
  8274. #define HTT_RX_IND_EXT_TID_S 8
  8275. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  8276. #define HTT_RX_IND_FLUSH_VALID_S 13
  8277. #define HTT_RX_IND_REL_VALID_M 0x4000
  8278. #define HTT_RX_IND_REL_VALID_S 14
  8279. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  8280. #define HTT_RX_IND_PEER_ID_S 16
  8281. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  8282. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  8283. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  8284. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  8285. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  8286. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  8287. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  8288. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  8289. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  8290. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  8291. /* rx PPDU descriptor fields */
  8292. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  8293. #define HTT_RX_IND_RSSI_CMB_S 0
  8294. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  8295. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  8296. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  8297. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  8298. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  8299. #define HTT_RX_IND_PHY_ERR_S 24
  8300. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  8301. #define HTT_RX_IND_LEGACY_RATE_S 25
  8302. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  8303. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  8304. #define HTT_RX_IND_END_VALID_M 0x40000000
  8305. #define HTT_RX_IND_END_VALID_S 30
  8306. #define HTT_RX_IND_START_VALID_M 0x80000000
  8307. #define HTT_RX_IND_START_VALID_S 31
  8308. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  8309. #define HTT_RX_IND_RSSI_PRI20_S 0
  8310. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  8311. #define HTT_RX_IND_RSSI_EXT20_S 8
  8312. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  8313. #define HTT_RX_IND_RSSI_EXT40_S 16
  8314. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  8315. #define HTT_RX_IND_RSSI_EXT80_S 24
  8316. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  8317. #define HTT_RX_IND_VHT_SIG_A1_S 0
  8318. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  8319. #define HTT_RX_IND_VHT_SIG_A2_S 0
  8320. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  8321. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  8322. #define HTT_RX_IND_SERVICE_M 0xff000000
  8323. #define HTT_RX_IND_SERVICE_S 24
  8324. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  8325. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  8326. /* rx MSDU descriptor fields */
  8327. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  8328. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  8329. /* payload fields */
  8330. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  8331. #define HTT_RX_IND_MPDU_COUNT_S 0
  8332. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  8333. #define HTT_RX_IND_MPDU_STATUS_S 8
  8334. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  8335. do { \
  8336. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  8337. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  8338. } while (0)
  8339. #define HTT_RX_IND_EXT_TID_GET(word) \
  8340. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  8341. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  8342. do { \
  8343. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  8344. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  8345. } while (0)
  8346. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  8347. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  8348. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  8349. do { \
  8350. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  8351. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  8352. } while (0)
  8353. #define HTT_RX_IND_REL_VALID_GET(word) \
  8354. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  8355. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  8356. do { \
  8357. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  8358. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  8359. } while (0)
  8360. #define HTT_RX_IND_PEER_ID_GET(word) \
  8361. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  8362. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  8363. do { \
  8364. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  8365. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  8366. } while (0)
  8367. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  8368. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  8369. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  8370. do { \
  8371. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  8372. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  8373. } while (0)
  8374. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  8375. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  8376. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  8377. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  8378. do { \
  8379. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  8380. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  8381. } while (0)
  8382. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  8383. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  8384. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  8385. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  8386. do { \
  8387. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  8388. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  8389. } while (0)
  8390. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  8391. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  8392. HTT_RX_IND_REL_SEQ_NUM_START_S)
  8393. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  8394. do { \
  8395. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  8396. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  8397. } while (0)
  8398. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  8399. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  8400. HTT_RX_IND_REL_SEQ_NUM_END_S)
  8401. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  8402. do { \
  8403. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  8404. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  8405. } while (0)
  8406. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  8407. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  8408. HTT_RX_IND_NUM_MPDU_RANGES_S)
  8409. /* FW rx PPDU descriptor fields */
  8410. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  8411. do { \
  8412. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  8413. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  8414. } while (0)
  8415. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  8416. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  8417. HTT_RX_IND_RSSI_CMB_S)
  8418. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  8419. do { \
  8420. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  8421. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  8422. } while (0)
  8423. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  8424. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  8425. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  8426. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  8427. do { \
  8428. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  8429. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  8430. } while (0)
  8431. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  8432. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  8433. HTT_RX_IND_PHY_ERR_CODE_S)
  8434. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  8435. do { \
  8436. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  8437. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  8438. } while (0)
  8439. #define HTT_RX_IND_PHY_ERR_GET(word) \
  8440. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  8441. HTT_RX_IND_PHY_ERR_S)
  8442. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  8443. do { \
  8444. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  8445. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  8446. } while (0)
  8447. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  8448. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  8449. HTT_RX_IND_LEGACY_RATE_S)
  8450. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  8451. do { \
  8452. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  8453. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  8454. } while (0)
  8455. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  8456. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  8457. HTT_RX_IND_LEGACY_RATE_SEL_S)
  8458. #define HTT_RX_IND_END_VALID_SET(word, value) \
  8459. do { \
  8460. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  8461. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  8462. } while (0)
  8463. #define HTT_RX_IND_END_VALID_GET(word) \
  8464. (((word) & HTT_RX_IND_END_VALID_M) >> \
  8465. HTT_RX_IND_END_VALID_S)
  8466. #define HTT_RX_IND_START_VALID_SET(word, value) \
  8467. do { \
  8468. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  8469. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  8470. } while (0)
  8471. #define HTT_RX_IND_START_VALID_GET(word) \
  8472. (((word) & HTT_RX_IND_START_VALID_M) >> \
  8473. HTT_RX_IND_START_VALID_S)
  8474. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  8475. do { \
  8476. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  8477. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  8478. } while (0)
  8479. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  8480. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  8481. HTT_RX_IND_RSSI_PRI20_S)
  8482. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  8483. do { \
  8484. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  8485. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  8486. } while (0)
  8487. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  8488. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  8489. HTT_RX_IND_RSSI_EXT20_S)
  8490. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  8491. do { \
  8492. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  8493. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  8494. } while (0)
  8495. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  8496. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  8497. HTT_RX_IND_RSSI_EXT40_S)
  8498. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  8499. do { \
  8500. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  8501. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  8502. } while (0)
  8503. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  8504. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  8505. HTT_RX_IND_RSSI_EXT80_S)
  8506. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  8507. do { \
  8508. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  8509. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  8510. } while (0)
  8511. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  8512. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  8513. HTT_RX_IND_VHT_SIG_A1_S)
  8514. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  8515. do { \
  8516. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  8517. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  8518. } while (0)
  8519. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  8520. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  8521. HTT_RX_IND_VHT_SIG_A2_S)
  8522. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  8523. do { \
  8524. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  8525. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  8526. } while (0)
  8527. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  8528. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  8529. HTT_RX_IND_PREAMBLE_TYPE_S)
  8530. #define HTT_RX_IND_SERVICE_SET(word, value) \
  8531. do { \
  8532. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  8533. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  8534. } while (0)
  8535. #define HTT_RX_IND_SERVICE_GET(word) \
  8536. (((word) & HTT_RX_IND_SERVICE_M) >> \
  8537. HTT_RX_IND_SERVICE_S)
  8538. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  8539. do { \
  8540. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  8541. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  8542. } while (0)
  8543. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  8544. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  8545. HTT_RX_IND_SA_ANT_MATRIX_S)
  8546. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  8547. do { \
  8548. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  8549. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  8550. } while (0)
  8551. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  8552. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  8553. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  8554. do { \
  8555. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  8556. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  8557. } while (0)
  8558. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  8559. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  8560. #define HTT_RX_IND_HL_BYTES \
  8561. (HTT_RX_IND_HDR_BYTES + \
  8562. 4 /* single FW rx MSDU descriptor */ + \
  8563. 4 /* single MPDU range information element */)
  8564. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  8565. /* Could we use one macro entry? */
  8566. #define HTT_WORD_SET(word, field, value) \
  8567. do { \
  8568. HTT_CHECK_SET_VAL(field, value); \
  8569. (word) |= ((value) << field ## _S); \
  8570. } while (0)
  8571. #define HTT_WORD_GET(word, field) \
  8572. (((word) & field ## _M) >> field ## _S)
  8573. PREPACK struct hl_htt_rx_ind_base {
  8574. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  8575. } POSTPACK;
  8576. /*
  8577. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  8578. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  8579. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  8580. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  8581. * htt_rx_ind_hl_rx_desc_t.
  8582. */
  8583. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  8584. struct htt_rx_ind_hl_rx_desc_t {
  8585. A_UINT8 ver;
  8586. A_UINT8 len;
  8587. struct {
  8588. A_UINT8
  8589. first_msdu: 1,
  8590. last_msdu: 1,
  8591. c3_failed: 1,
  8592. c4_failed: 1,
  8593. ipv6: 1,
  8594. tcp: 1,
  8595. udp: 1,
  8596. reserved: 1;
  8597. } flags;
  8598. /* NOTE: no reserved space - don't append any new fields here */
  8599. };
  8600. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  8601. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8602. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  8603. #define HTT_RX_IND_HL_RX_DESC_VER 0
  8604. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  8605. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8606. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  8607. #define HTT_RX_IND_HL_FLAG_OFFSET \
  8608. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  8609. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  8610. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  8611. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  8612. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  8613. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  8614. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  8615. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  8616. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  8617. /* This structure is used in HL, the basic descriptor information
  8618. * used by host. the structure is translated by FW from HW desc
  8619. * or generated by FW. But in HL monitor mode, the host would use
  8620. * the same structure with LL.
  8621. */
  8622. PREPACK struct hl_htt_rx_desc_base {
  8623. A_UINT32
  8624. seq_num:12,
  8625. encrypted:1,
  8626. chan_info_present:1,
  8627. resv0:2,
  8628. mcast_bcast:1,
  8629. fragment:1,
  8630. key_id_oct:8,
  8631. resv1:6;
  8632. A_UINT32
  8633. pn_31_0;
  8634. union {
  8635. struct {
  8636. A_UINT16 pn_47_32;
  8637. A_UINT16 pn_63_48;
  8638. } pn16;
  8639. A_UINT32 pn_63_32;
  8640. } u0;
  8641. A_UINT32
  8642. pn_95_64;
  8643. A_UINT32
  8644. pn_127_96;
  8645. } POSTPACK;
  8646. /*
  8647. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  8648. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  8649. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  8650. * Please see htt_chan_change_t for description of the fields.
  8651. */
  8652. PREPACK struct htt_chan_info_t
  8653. {
  8654. A_UINT32 primary_chan_center_freq_mhz: 16,
  8655. contig_chan1_center_freq_mhz: 16;
  8656. A_UINT32 contig_chan2_center_freq_mhz: 16,
  8657. phy_mode: 8,
  8658. reserved: 8;
  8659. } POSTPACK;
  8660. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  8661. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  8662. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  8663. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  8664. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  8665. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  8666. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  8667. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  8668. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  8669. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  8670. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  8671. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  8672. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  8673. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  8674. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  8675. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  8676. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  8677. /* Channel information */
  8678. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  8679. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  8680. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  8681. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  8682. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  8683. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  8684. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  8685. #define HTT_CHAN_INFO_PHY_MODE_S 16
  8686. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  8687. do { \
  8688. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  8689. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  8690. } while (0)
  8691. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  8692. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  8693. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  8694. do { \
  8695. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  8696. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  8697. } while (0)
  8698. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  8699. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  8700. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  8701. do { \
  8702. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  8703. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  8704. } while (0)
  8705. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  8706. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  8707. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  8708. do { \
  8709. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  8710. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  8711. } while (0)
  8712. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  8713. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  8714. /*
  8715. * @brief target -> host message definition for FW offloaded pkts
  8716. *
  8717. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  8718. *
  8719. * @details
  8720. * The following field definitions describe the format of the firmware
  8721. * offload deliver message sent from the target to the host.
  8722. *
  8723. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  8724. *
  8725. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  8726. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  8727. * | reserved_1 | msg type |
  8728. * |--------------------------------------------------------------------------|
  8729. * | phy_timestamp_l32 |
  8730. * |--------------------------------------------------------------------------|
  8731. * | WORD2 (see below) |
  8732. * |--------------------------------------------------------------------------|
  8733. * | seqno | framectrl |
  8734. * |--------------------------------------------------------------------------|
  8735. * | reserved_3 | vdev_id | tid_num|
  8736. * |--------------------------------------------------------------------------|
  8737. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  8738. * |--------------------------------------------------------------------------|
  8739. *
  8740. * where:
  8741. * STAT = status
  8742. * F = format (802.3 vs. 802.11)
  8743. *
  8744. * definition for word 2
  8745. *
  8746. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  8747. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  8748. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  8749. * |--------------------------------------------------------------------------|
  8750. *
  8751. * where:
  8752. * PR = preamble
  8753. * BF = beamformed
  8754. */
  8755. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  8756. {
  8757. A_UINT32 /* word 0 */
  8758. msg_type:8, /* [ 7: 0] */
  8759. reserved_1:24; /* [31: 8] */
  8760. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  8761. A_UINT32 /* word 2 */
  8762. /* preamble:
  8763. * 0-OFDM,
  8764. * 1-CCk,
  8765. * 2-HT,
  8766. * 3-VHT
  8767. */
  8768. preamble: 2, /* [1:0] */
  8769. /* mcs:
  8770. * In case of HT preamble interpret
  8771. * MCS along with NSS.
  8772. * Valid values for HT are 0 to 7.
  8773. * HT mcs 0 with NSS 2 is mcs 8.
  8774. * Valid values for VHT are 0 to 9.
  8775. */
  8776. mcs: 4, /* [5:2] */
  8777. /* rate:
  8778. * This is applicable only for
  8779. * CCK and OFDM preamble type
  8780. * rate 0: OFDM 48 Mbps,
  8781. * 1: OFDM 24 Mbps,
  8782. * 2: OFDM 12 Mbps
  8783. * 3: OFDM 6 Mbps
  8784. * 4: OFDM 54 Mbps
  8785. * 5: OFDM 36 Mbps
  8786. * 6: OFDM 18 Mbps
  8787. * 7: OFDM 9 Mbps
  8788. * rate 0: CCK 11 Mbps Long
  8789. * 1: CCK 5.5 Mbps Long
  8790. * 2: CCK 2 Mbps Long
  8791. * 3: CCK 1 Mbps Long
  8792. * 4: CCK 11 Mbps Short
  8793. * 5: CCK 5.5 Mbps Short
  8794. * 6: CCK 2 Mbps Short
  8795. */
  8796. rate : 3, /* [ 8: 6] */
  8797. rssi : 8, /* [16: 9] units=dBm */
  8798. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  8799. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  8800. stbc : 1, /* [22] */
  8801. sgi : 1, /* [23] */
  8802. ldpc : 1, /* [24] */
  8803. beamformed: 1, /* [25] */
  8804. reserved_2: 6; /* [31:26] */
  8805. A_UINT32 /* word 3 */
  8806. framectrl:16, /* [15: 0] */
  8807. seqno:16; /* [31:16] */
  8808. A_UINT32 /* word 4 */
  8809. tid_num:5, /* [ 4: 0] actual TID number */
  8810. vdev_id:8, /* [12: 5] */
  8811. reserved_3:19; /* [31:13] */
  8812. A_UINT32 /* word 5 */
  8813. /* status:
  8814. * 0: tx_ok
  8815. * 1: retry
  8816. * 2: drop
  8817. * 3: filtered
  8818. * 4: abort
  8819. * 5: tid delete
  8820. * 6: sw abort
  8821. * 7: dropped by peer migration
  8822. */
  8823. status:3, /* [2:0] */
  8824. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  8825. tx_mpdu_bytes:16, /* [19:4] */
  8826. /* Indicates retry count of offloaded/local generated Data tx frames */
  8827. tx_retry_cnt:6, /* [25:20] */
  8828. reserved_4:6; /* [31:26] */
  8829. } POSTPACK;
  8830. /* FW offload deliver ind message header fields */
  8831. /* DWORD one */
  8832. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  8833. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  8834. /* DWORD two */
  8835. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  8836. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  8837. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  8838. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  8839. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  8840. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  8841. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  8842. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  8843. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  8844. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  8845. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  8846. #define HTT_FW_OFFLOAD_IND_BW_S 19
  8847. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  8848. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  8849. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  8850. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  8851. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  8852. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  8853. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  8854. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  8855. /* DWORD three*/
  8856. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  8857. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  8858. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  8859. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  8860. /* DWORD four */
  8861. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  8862. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  8863. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  8864. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  8865. /* DWORD five */
  8866. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  8867. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  8868. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  8869. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  8870. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  8871. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  8872. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  8873. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  8874. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  8875. do { \
  8876. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  8877. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  8878. } while (0)
  8879. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  8880. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  8881. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  8882. do { \
  8883. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  8884. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  8885. } while (0)
  8886. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  8887. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  8888. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  8889. do { \
  8890. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  8891. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  8892. } while (0)
  8893. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  8894. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  8895. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  8896. do { \
  8897. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  8898. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  8899. } while (0)
  8900. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  8901. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  8902. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  8903. do { \
  8904. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  8905. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  8906. } while (0)
  8907. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  8908. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  8909. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  8910. do { \
  8911. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  8912. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  8913. } while (0)
  8914. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  8915. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  8916. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  8917. do { \
  8918. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  8919. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  8920. } while (0)
  8921. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  8922. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  8923. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  8924. do { \
  8925. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  8926. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  8927. } while (0)
  8928. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  8929. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  8930. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  8931. do { \
  8932. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  8933. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  8934. } while (0)
  8935. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  8936. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  8937. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  8938. do { \
  8939. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  8940. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  8941. } while (0)
  8942. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  8943. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  8944. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  8945. do { \
  8946. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  8947. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  8948. } while (0)
  8949. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  8950. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  8951. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  8952. do { \
  8953. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  8954. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  8955. } while (0)
  8956. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  8957. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  8958. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  8959. do { \
  8960. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  8961. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  8962. } while (0)
  8963. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  8964. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  8965. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  8966. do { \
  8967. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  8968. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  8969. } while (0)
  8970. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  8971. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  8972. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  8973. do { \
  8974. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  8975. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  8976. } while (0)
  8977. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  8978. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  8979. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  8980. do { \
  8981. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  8982. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  8983. } while (0)
  8984. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  8985. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  8986. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  8987. do { \
  8988. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  8989. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  8990. } while (0)
  8991. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  8992. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  8993. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  8994. do { \
  8995. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  8996. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  8997. } while (0)
  8998. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  8999. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  9000. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  9001. do { \
  9002. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  9003. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  9004. } while (0)
  9005. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9006. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9007. /*
  9008. * @brief target -> host rx reorder flush message definition
  9009. *
  9010. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9011. *
  9012. * @details
  9013. * The following field definitions describe the format of the rx flush
  9014. * message sent from the target to the host.
  9015. * The message consists of a 4-octet header, followed by one or more
  9016. * 4-octet payload information elements.
  9017. *
  9018. * |31 24|23 8|7 0|
  9019. * |--------------------------------------------------------------|
  9020. * | TID | peer ID | msg type |
  9021. * |--------------------------------------------------------------|
  9022. * | seq num end | seq num start | MPDU status | reserved |
  9023. * |--------------------------------------------------------------|
  9024. * First DWORD:
  9025. * - MSG_TYPE
  9026. * Bits 7:0
  9027. * Purpose: identifies this as an rx flush message
  9028. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9029. * - PEER_ID
  9030. * Bits 23:8 (only bits 18:8 actually used)
  9031. * Purpose: identify which peer's rx data is being flushed
  9032. * Value: (rx) peer ID
  9033. * - TID
  9034. * Bits 31:24 (only bits 27:24 actually used)
  9035. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9036. * Value: traffic identifier
  9037. * Second DWORD:
  9038. * - MPDU_STATUS
  9039. * Bits 15:8
  9040. * Purpose:
  9041. * Indicate whether the flushed MPDUs should be discarded or processed.
  9042. * Value:
  9043. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9044. * stages of rx processing
  9045. * other: discard the MPDUs
  9046. * It is anticipated that flush messages will always have
  9047. * MPDU status == 1, but the status flag is included for
  9048. * flexibility.
  9049. * - SEQ_NUM_START
  9050. * Bits 23:16
  9051. * Purpose:
  9052. * Indicate the start of a series of consecutive MPDUs being flushed.
  9053. * Not all MPDUs within this range are necessarily valid - the host
  9054. * must check each sequence number within this range to see if the
  9055. * corresponding MPDU is actually present.
  9056. * Value:
  9057. * The sequence number for the first MPDU in the sequence.
  9058. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9059. * - SEQ_NUM_END
  9060. * Bits 30:24
  9061. * Purpose:
  9062. * Indicate the end of a series of consecutive MPDUs being flushed.
  9063. * Value:
  9064. * The sequence number one larger than the sequence number of the
  9065. * last MPDU being flushed.
  9066. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9067. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9068. * are to be released for further rx processing.
  9069. * Not all MPDUs within this range are necessarily valid - the host
  9070. * must check each sequence number within this range to see if the
  9071. * corresponding MPDU is actually present.
  9072. */
  9073. /* first DWORD */
  9074. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9075. #define HTT_RX_FLUSH_PEER_ID_S 8
  9076. #define HTT_RX_FLUSH_TID_M 0xff000000
  9077. #define HTT_RX_FLUSH_TID_S 24
  9078. /* second DWORD */
  9079. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9080. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9081. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9082. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9083. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9084. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9085. #define HTT_RX_FLUSH_BYTES 8
  9086. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9087. do { \
  9088. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9089. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9090. } while (0)
  9091. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9092. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9093. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9094. do { \
  9095. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9096. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9097. } while (0)
  9098. #define HTT_RX_FLUSH_TID_GET(word) \
  9099. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9100. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9101. do { \
  9102. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9103. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9104. } while (0)
  9105. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9106. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9107. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9108. do { \
  9109. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9110. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9111. } while (0)
  9112. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9113. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9114. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9115. do { \
  9116. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9117. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9118. } while (0)
  9119. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9120. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9121. /*
  9122. * @brief target -> host rx pn check indication message
  9123. *
  9124. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9125. *
  9126. * @details
  9127. * The following field definitions describe the format of the Rx PN check
  9128. * indication message sent from the target to the host.
  9129. * The message consists of a 4-octet header, followed by the start and
  9130. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9131. * IE is one octet containing the sequence number that failed the PN
  9132. * check.
  9133. *
  9134. * |31 24|23 8|7 0|
  9135. * |--------------------------------------------------------------|
  9136. * | TID | peer ID | msg type |
  9137. * |--------------------------------------------------------------|
  9138. * | Reserved | PN IE count | seq num end | seq num start|
  9139. * |--------------------------------------------------------------|
  9140. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9141. * |--------------------------------------------------------------|
  9142. * First DWORD:
  9143. * - MSG_TYPE
  9144. * Bits 7:0
  9145. * Purpose: Identifies this as an rx pn check indication message
  9146. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  9147. * - PEER_ID
  9148. * Bits 23:8 (only bits 18:8 actually used)
  9149. * Purpose: identify which peer
  9150. * Value: (rx) peer ID
  9151. * - TID
  9152. * Bits 31:24 (only bits 27:24 actually used)
  9153. * Purpose: identify traffic identifier
  9154. * Value: traffic identifier
  9155. * Second DWORD:
  9156. * - SEQ_NUM_START
  9157. * Bits 7:0
  9158. * Purpose:
  9159. * Indicates the starting sequence number of the MPDU in this
  9160. * series of MPDUs that went though PN check.
  9161. * Value:
  9162. * The sequence number for the first MPDU in the sequence.
  9163. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9164. * - SEQ_NUM_END
  9165. * Bits 15:8
  9166. * Purpose:
  9167. * Indicates the ending sequence number of the MPDU in this
  9168. * series of MPDUs that went though PN check.
  9169. * Value:
  9170. * The sequence number one larger then the sequence number of the last
  9171. * MPDU being flushed.
  9172. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9173. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  9174. * for invalid PN numbers and are ready to be released for further processing.
  9175. * Not all MPDUs within this range are necessarily valid - the host
  9176. * must check each sequence number within this range to see if the
  9177. * corresponding MPDU is actually present.
  9178. * - PN_IE_COUNT
  9179. * Bits 23:16
  9180. * Purpose:
  9181. * Used to determine the variable number of PN information elements in this
  9182. * message
  9183. *
  9184. * PN information elements:
  9185. * - PN_IE_x-
  9186. * Purpose:
  9187. * Each PN information element contains the sequence number of the MPDU that
  9188. * has failed the target PN check.
  9189. * Value:
  9190. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  9191. * that failed the PN check.
  9192. */
  9193. /* first DWORD */
  9194. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  9195. #define HTT_RX_PN_IND_PEER_ID_S 8
  9196. #define HTT_RX_PN_IND_TID_M 0xff000000
  9197. #define HTT_RX_PN_IND_TID_S 24
  9198. /* second DWORD */
  9199. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  9200. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  9201. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  9202. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  9203. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  9204. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  9205. #define HTT_RX_PN_IND_BYTES 8
  9206. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  9207. do { \
  9208. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  9209. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  9210. } while (0)
  9211. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  9212. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  9213. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  9214. do { \
  9215. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  9216. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  9217. } while (0)
  9218. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  9219. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  9220. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  9221. do { \
  9222. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  9223. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  9224. } while (0)
  9225. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  9226. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  9227. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  9228. do { \
  9229. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  9230. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  9231. } while (0)
  9232. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  9233. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  9234. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  9235. do { \
  9236. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  9237. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  9238. } while (0)
  9239. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  9240. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  9241. /*
  9242. * @brief target -> host rx offload deliver message for LL system
  9243. *
  9244. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  9245. *
  9246. * @details
  9247. * In a low latency system this message is sent whenever the offload
  9248. * manager flushes out the packets it has coalesced in its coalescing buffer.
  9249. * The DMA of the actual packets into host memory is done before sending out
  9250. * this message. This message indicates only how many MSDUs to reap. The
  9251. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  9252. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  9253. * DMA'd by the MAC directly into host memory these packets do not contain
  9254. * the MAC descriptors in the header portion of the packet. Instead they contain
  9255. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  9256. * message, the packets are delivered directly to the NW stack without going
  9257. * through the regular reorder buffering and PN checking path since it has
  9258. * already been done in target.
  9259. *
  9260. * |31 24|23 16|15 8|7 0|
  9261. * |-----------------------------------------------------------------------|
  9262. * | Total MSDU count | reserved | msg type |
  9263. * |-----------------------------------------------------------------------|
  9264. *
  9265. * @brief target -> host rx offload deliver message for HL system
  9266. *
  9267. * @details
  9268. * In a high latency system this message is sent whenever the offload manager
  9269. * flushes out the packets it has coalesced in its coalescing buffer. The
  9270. * actual packets are also carried along with this message. When the host
  9271. * receives this message, it is expected to deliver these packets to the NW
  9272. * stack directly instead of routing them through the reorder buffering and
  9273. * PN checking path since it has already been done in target.
  9274. *
  9275. * |31 24|23 16|15 8|7 0|
  9276. * |-----------------------------------------------------------------------|
  9277. * | Total MSDU count | reserved | msg type |
  9278. * |-----------------------------------------------------------------------|
  9279. * | peer ID | MSDU length |
  9280. * |-----------------------------------------------------------------------|
  9281. * | MSDU payload | FW Desc | tid | vdev ID |
  9282. * |-----------------------------------------------------------------------|
  9283. * | MSDU payload contd. |
  9284. * |-----------------------------------------------------------------------|
  9285. * | peer ID | MSDU length |
  9286. * |-----------------------------------------------------------------------|
  9287. * | MSDU payload | FW Desc | tid | vdev ID |
  9288. * |-----------------------------------------------------------------------|
  9289. * | MSDU payload contd. |
  9290. * |-----------------------------------------------------------------------|
  9291. *
  9292. */
  9293. /* first DWORD */
  9294. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  9295. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  9296. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  9297. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  9298. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  9299. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  9300. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  9301. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  9302. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  9303. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  9304. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  9305. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  9306. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  9307. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  9308. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  9309. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  9310. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  9311. do { \
  9312. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  9313. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  9314. } while (0)
  9315. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  9316. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  9317. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  9318. do { \
  9319. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  9320. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  9321. } while (0)
  9322. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  9323. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  9324. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  9325. do { \
  9326. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  9327. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  9328. } while (0)
  9329. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  9330. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  9331. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  9332. do { \
  9333. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  9334. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  9335. } while (0)
  9336. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  9337. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  9338. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  9339. do { \
  9340. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  9341. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  9342. } while (0)
  9343. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  9344. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  9345. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  9346. do { \
  9347. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  9348. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  9349. } while (0)
  9350. /**
  9351. * @brief target -> host rx peer map/unmap message definition
  9352. *
  9353. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  9354. *
  9355. * @details
  9356. * The following diagram shows the format of the rx peer map message sent
  9357. * from the target to the host. This layout assumes the target operates
  9358. * as little-endian.
  9359. *
  9360. * This message always contains a SW peer ID. The main purpose of the
  9361. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9362. * with, so that the host can use that peer ID to determine which peer
  9363. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9364. * other purposes, such as identifying during tx completions which peer
  9365. * the tx frames in question were transmitted to.
  9366. *
  9367. * In certain generations of chips, the peer map message also contains
  9368. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  9369. * to identify which peer the frame needs to be forwarded to (i.e. the
  9370. * peer assocated with the Destination MAC Address within the packet),
  9371. * and particularly which vdev needs to transmit the frame (for cases
  9372. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  9373. * meaning as AST_INDEX_0.
  9374. * This DA-based peer ID that is provided for certain rx frames
  9375. * (the rx frames that need to be re-transmitted as tx frames)
  9376. * is the ID that the HW uses for referring to the peer in question,
  9377. * rather than the peer ID that the SW+FW use to refer to the peer.
  9378. *
  9379. *
  9380. * |31 24|23 16|15 8|7 0|
  9381. * |-----------------------------------------------------------------------|
  9382. * | SW peer ID | VDEV ID | msg type |
  9383. * |-----------------------------------------------------------------------|
  9384. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9385. * |-----------------------------------------------------------------------|
  9386. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9387. * |-----------------------------------------------------------------------|
  9388. *
  9389. *
  9390. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  9391. *
  9392. * The following diagram shows the format of the rx peer unmap message sent
  9393. * from the target to the host.
  9394. *
  9395. * |31 24|23 16|15 8|7 0|
  9396. * |-----------------------------------------------------------------------|
  9397. * | SW peer ID | VDEV ID | msg type |
  9398. * |-----------------------------------------------------------------------|
  9399. *
  9400. * The following field definitions describe the format of the rx peer map
  9401. * and peer unmap messages sent from the target to the host.
  9402. * - MSG_TYPE
  9403. * Bits 7:0
  9404. * Purpose: identifies this as an rx peer map or peer unmap message
  9405. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  9406. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  9407. * - VDEV_ID
  9408. * Bits 15:8
  9409. * Purpose: Indicates which virtual device the peer is associated
  9410. * with.
  9411. * Value: vdev ID (used in the host to look up the vdev object)
  9412. * - PEER_ID (a.k.a. SW_PEER_ID)
  9413. * Bits 31:16
  9414. * Purpose: The peer ID (index) that WAL is allocating (map) or
  9415. * freeing (unmap)
  9416. * Value: (rx) peer ID
  9417. * - MAC_ADDR_L32 (peer map only)
  9418. * Bits 31:0
  9419. * Purpose: Identifies which peer node the peer ID is for.
  9420. * Value: lower 4 bytes of peer node's MAC address
  9421. * - MAC_ADDR_U16 (peer map only)
  9422. * Bits 15:0
  9423. * Purpose: Identifies which peer node the peer ID is for.
  9424. * Value: upper 2 bytes of peer node's MAC address
  9425. * - HW_PEER_ID
  9426. * Bits 31:16
  9427. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9428. * address, so for rx frames marked for rx --> tx forwarding, the
  9429. * host can determine from the HW peer ID provided as meta-data with
  9430. * the rx frame which peer the frame is supposed to be forwarded to.
  9431. * Value: ID used by the MAC HW to identify the peer
  9432. */
  9433. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  9434. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  9435. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  9436. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  9437. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  9438. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  9439. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  9440. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  9441. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  9442. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  9443. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  9444. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  9445. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  9446. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  9447. do { \
  9448. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  9449. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  9450. } while (0)
  9451. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  9452. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  9453. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  9454. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  9455. do { \
  9456. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  9457. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  9458. } while (0)
  9459. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  9460. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  9461. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  9462. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  9463. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  9464. do { \
  9465. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  9466. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  9467. } while (0)
  9468. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  9469. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  9470. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  9471. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  9472. #define HTT_RX_PEER_MAP_BYTES 12
  9473. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  9474. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  9475. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  9476. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  9477. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  9478. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  9479. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  9480. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  9481. #define HTT_RX_PEER_UNMAP_BYTES 4
  9482. /**
  9483. * @brief target -> host rx peer map V2 message definition
  9484. *
  9485. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  9486. *
  9487. * @details
  9488. * The following diagram shows the format of the rx peer map v2 message sent
  9489. * from the target to the host. This layout assumes the target operates
  9490. * as little-endian.
  9491. *
  9492. * This message always contains a SW peer ID. The main purpose of the
  9493. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  9494. * with, so that the host can use that peer ID to determine which peer
  9495. * transmitted the rx frame. This SW peer ID is sometimes also used for
  9496. * other purposes, such as identifying during tx completions which peer
  9497. * the tx frames in question were transmitted to.
  9498. *
  9499. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  9500. * is used during rx --> tx frame forwarding to identify which peer the
  9501. * frame needs to be forwarded to (i.e. the peer assocated with the
  9502. * Destination MAC Address within the packet), and particularly which vdev
  9503. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  9504. * This DA-based peer ID that is provided for certain rx frames
  9505. * (the rx frames that need to be re-transmitted as tx frames)
  9506. * is the ID that the HW uses for referring to the peer in question,
  9507. * rather than the peer ID that the SW+FW use to refer to the peer.
  9508. *
  9509. * The HW peer id here is the same meaning as AST_INDEX_0.
  9510. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  9511. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  9512. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  9513. * AST is valid.
  9514. *
  9515. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  9516. * |-------------------------------------------------------------------------|
  9517. * | SW peer ID | VDEV ID | msg type |
  9518. * |-------------------------------------------------------------------------|
  9519. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9520. * |-------------------------------------------------------------------------|
  9521. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  9522. * |-------------------------------------------------------------------------|
  9523. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  9524. * |-------------------------------------------------------------------------|
  9525. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  9526. * |-------------------------------------------------------------------------|
  9527. * |TID valid low pri| TID valid hi pri | AST index 2 |
  9528. * |-------------------------------------------------------------------------|
  9529. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  9530. * |-------------------------------------------------------------------------|
  9531. * | Reserved_2 |
  9532. * |-------------------------------------------------------------------------|
  9533. * Where:
  9534. * NH = Next Hop
  9535. * ASTVM = AST valid mask
  9536. * OA = on-chip AST valid bit
  9537. * ASTFM = AST flow mask
  9538. *
  9539. * The following field definitions describe the format of the rx peer map v2
  9540. * messages sent from the target to the host.
  9541. * - MSG_TYPE
  9542. * Bits 7:0
  9543. * Purpose: identifies this as an rx peer map v2 message
  9544. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  9545. * - VDEV_ID
  9546. * Bits 15:8
  9547. * Purpose: Indicates which virtual device the peer is associated with.
  9548. * Value: vdev ID (used in the host to look up the vdev object)
  9549. * - SW_PEER_ID
  9550. * Bits 31:16
  9551. * Purpose: The peer ID (index) that WAL is allocating
  9552. * Value: (rx) peer ID
  9553. * - MAC_ADDR_L32
  9554. * Bits 31:0
  9555. * Purpose: Identifies which peer node the peer ID is for.
  9556. * Value: lower 4 bytes of peer node's MAC address
  9557. * - MAC_ADDR_U16
  9558. * Bits 15:0
  9559. * Purpose: Identifies which peer node the peer ID is for.
  9560. * Value: upper 2 bytes of peer node's MAC address
  9561. * - HW_PEER_ID / AST_INDEX_0
  9562. * Bits 31:16
  9563. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9564. * address, so for rx frames marked for rx --> tx forwarding, the
  9565. * host can determine from the HW peer ID provided as meta-data with
  9566. * the rx frame which peer the frame is supposed to be forwarded to.
  9567. * Value: ID used by the MAC HW to identify the peer
  9568. * - AST_HASH_VALUE
  9569. * Bits 15:0
  9570. * Purpose: Indicates AST Hash value is required for the TCL AST index
  9571. * override feature.
  9572. * - NEXT_HOP
  9573. * Bit 16
  9574. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  9575. * (Wireless Distribution System).
  9576. * - AST_VALID_MASK
  9577. * Bits 19:17
  9578. * Purpose: Indicate if the AST 1 through AST 3 are valid
  9579. * - ONCHIP_AST_VALID_FLAG
  9580. * Bit 20
  9581. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  9582. * is valid.
  9583. * - AST_INDEX_1
  9584. * Bits 15:0
  9585. * Purpose: indicate the second AST index for this peer
  9586. * - AST_0_FLOW_MASK
  9587. * Bits 19:16
  9588. * Purpose: identify the which flow the AST 0 entry corresponds to.
  9589. * - AST_1_FLOW_MASK
  9590. * Bits 23:20
  9591. * Purpose: identify the which flow the AST 1 entry corresponds to.
  9592. * - AST_2_FLOW_MASK
  9593. * Bits 27:24
  9594. * Purpose: identify the which flow the AST 2 entry corresponds to.
  9595. * - AST_3_FLOW_MASK
  9596. * Bits 31:28
  9597. * Purpose: identify the which flow the AST 3 entry corresponds to.
  9598. * - AST_INDEX_2
  9599. * Bits 15:0
  9600. * Purpose: indicate the third AST index for this peer
  9601. * - TID_VALID_HI_PRI
  9602. * Bits 23:16
  9603. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  9604. * - TID_VALID_LOW_PRI
  9605. * Bits 31:24
  9606. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  9607. * - AST_INDEX_3
  9608. * Bits 15:0
  9609. * Purpose: indicate the fourth AST index for this peer
  9610. * - ONCHIP_AST_IDX / RESERVED
  9611. * Bits 31:16
  9612. * Purpose: This field is valid only when split AST feature is enabled.
  9613. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  9614. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9615. * address, this ast_idx is used for LMAC modules for RXPCU.
  9616. * Value: ID used by the LMAC HW to identify the peer
  9617. */
  9618. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  9619. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  9620. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  9621. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  9622. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  9623. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  9624. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  9625. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  9626. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  9627. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  9628. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  9629. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  9630. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  9631. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  9632. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  9633. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  9634. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  9635. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  9636. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  9637. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  9638. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  9639. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  9640. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  9641. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  9642. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  9643. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  9644. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  9645. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  9646. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  9647. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  9648. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  9649. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  9650. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  9651. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  9652. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  9653. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  9654. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  9655. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  9656. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  9657. do { \
  9658. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  9659. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  9660. } while (0)
  9661. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  9662. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  9663. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  9664. do { \
  9665. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  9666. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  9667. } while (0)
  9668. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  9669. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  9670. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  9671. do { \
  9672. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  9673. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  9674. } while (0)
  9675. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  9676. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  9677. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  9678. do { \
  9679. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  9680. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  9681. } while (0)
  9682. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  9683. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  9684. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  9685. do { \
  9686. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  9687. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  9688. } while (0)
  9689. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  9690. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  9691. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  9692. do { \
  9693. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  9694. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  9695. } while (0)
  9696. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  9697. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  9698. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  9699. do { \
  9700. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  9701. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  9702. } while (0)
  9703. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  9704. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  9705. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9706. do { \
  9707. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  9708. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  9709. } while (0)
  9710. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  9711. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  9712. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  9713. do { \
  9714. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  9715. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  9716. } while (0)
  9717. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  9718. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  9719. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  9720. do { \
  9721. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  9722. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  9723. } while (0)
  9724. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  9725. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  9726. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  9727. do { \
  9728. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  9729. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  9730. } while (0)
  9731. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  9732. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  9733. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  9734. do { \
  9735. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  9736. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  9737. } while (0)
  9738. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  9739. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  9740. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  9741. do { \
  9742. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  9743. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  9744. } while (0)
  9745. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  9746. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  9747. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  9748. do { \
  9749. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  9750. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  9751. } while (0)
  9752. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  9753. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  9754. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  9755. do { \
  9756. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  9757. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  9758. } while (0)
  9759. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  9760. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  9761. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  9762. do { \
  9763. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  9764. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  9765. } while (0)
  9766. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  9767. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  9768. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  9769. do { \
  9770. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  9771. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  9772. } while (0)
  9773. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  9774. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  9775. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  9776. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  9777. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  9778. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  9779. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  9780. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  9781. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  9782. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  9783. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  9784. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  9785. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  9786. #define HTT_RX_PEER_MAP_V2_BYTES 32
  9787. /**
  9788. * @brief target -> host rx peer map V3 message definition
  9789. *
  9790. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  9791. *
  9792. * @details
  9793. * The following diagram shows the format of the rx peer map v3 message sent
  9794. * from the target to the host.
  9795. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  9796. * This layout assumes the target operates as little-endian.
  9797. *
  9798. * |31 24|23 20|19|18|17|16|15 8|7 0|
  9799. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  9800. * | SW peer ID | VDEV ID | msg type |
  9801. * |-----------------+--------------------+-----------------+-----------------|
  9802. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  9803. * |-----------------+--------------------+-----------------+-----------------|
  9804. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  9805. * |-----------------+--------+-----------+-----------------+-----------------|
  9806. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  9807. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  9808. * | (8bits) | | (4bits) | |
  9809. * |-----------------+--------+--+--+--+--------------------------------------|
  9810. * | RESERVED |E |O | | |
  9811. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  9812. * | |V |V | | |
  9813. * |-----------------+--------------------+-----------------------------------|
  9814. * | HTT_MSDU_IDX_ | RESERVED | |
  9815. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  9816. * | (8bits) | | |
  9817. * |-----------------+--------------------+-----------------------------------|
  9818. * | Reserved_2 |
  9819. * |--------------------------------------------------------------------------|
  9820. * | Reserved_3 |
  9821. * |--------------------------------------------------------------------------|
  9822. *
  9823. * Where:
  9824. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  9825. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  9826. * NH = Next Hop
  9827. * The following field definitions describe the format of the rx peer map v3
  9828. * messages sent from the target to the host.
  9829. * - MSG_TYPE
  9830. * Bits 7:0
  9831. * Purpose: identifies this as a peer map v3 message
  9832. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  9833. * - VDEV_ID
  9834. * Bits 15:8
  9835. * Purpose: Indicates which virtual device the peer is associated with.
  9836. * - SW_PEER_ID
  9837. * Bits 31:16
  9838. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  9839. * - MAC_ADDR_L32
  9840. * Bits 31:0
  9841. * Purpose: Identifies which peer node the peer ID is for.
  9842. * Value: lower 4 bytes of peer node's MAC address
  9843. * - MAC_ADDR_U16
  9844. * Bits 15:0
  9845. * Purpose: Identifies which peer node the peer ID is for.
  9846. * Value: upper 2 bytes of peer node's MAC address
  9847. * - MULTICAST_SW_PEER_ID
  9848. * Bits 31:16
  9849. * Purpose: The multicast peer ID (index)
  9850. * Value: set to HTT_INVALID_PEER if not valid
  9851. * - HW_PEER_ID / AST_INDEX
  9852. * Bits 15:0
  9853. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  9854. * address, so for rx frames marked for rx --> tx forwarding, the
  9855. * host can determine from the HW peer ID provided as meta-data with
  9856. * the rx frame which peer the frame is supposed to be forwarded to.
  9857. * - CACHE_SET_NUM
  9858. * Bits 19:16
  9859. * Purpose: Cache Set Number for AST_INDEX
  9860. * Cache set number that should be used to cache the index based
  9861. * search results, for address and flow search.
  9862. * This value should be equal to LSB 4 bits of the hash value
  9863. * of match data, in case of search index points to an entry which
  9864. * may be used in content based search also. The value can be
  9865. * anything when the entry pointed by search index will not be
  9866. * used for content based search.
  9867. * - HTT_MSDU_IDX_VALID_MASK
  9868. * Bits 31:24
  9869. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  9870. * - ONCHIP_AST_IDX / RESERVED
  9871. * Bits 15:0
  9872. * Purpose: This field is valid only when split AST feature is enabled.
  9873. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  9874. * If valid, identifies the HW peer ID corresponding to the peer MAC
  9875. * address, this ast_idx is used for LMAC modules for RXPCU.
  9876. * - NEXT_HOP
  9877. * Bits 16
  9878. * Purpose: Flag indicates next_hop AST entry used for WDS
  9879. * (Wireless Distribution System).
  9880. * - ONCHIP_AST_VALID
  9881. * Bits 17
  9882. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  9883. * - EXT_AST_VALID
  9884. * Bits 18
  9885. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  9886. * - EXT_AST_INDEX
  9887. * Bits 15:0
  9888. * Purpose: This field describes Extended AST index
  9889. * Valid if EXT_AST_VALID flag set
  9890. * - HTT_MSDU_IDX_VALID_MASK_EXT
  9891. * Bits 31:24
  9892. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  9893. */
  9894. /* dword 0 */
  9895. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  9896. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  9897. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  9898. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  9899. /* dword 1 */
  9900. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  9901. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  9902. /* dword 2 */
  9903. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  9904. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  9905. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  9906. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  9907. /* dword 3 */
  9908. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  9909. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  9910. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  9911. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  9912. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  9913. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  9914. /* dword 4 */
  9915. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  9916. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  9917. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  9918. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  9919. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  9920. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  9921. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  9922. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  9923. /* dword 5 */
  9924. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  9925. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  9926. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  9927. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  9928. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  9929. do { \
  9930. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  9931. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  9932. } while (0)
  9933. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  9934. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  9935. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  9936. do { \
  9937. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  9938. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  9939. } while (0)
  9940. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  9941. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  9942. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  9943. do { \
  9944. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  9945. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  9946. } while (0)
  9947. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  9948. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  9949. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  9950. do { \
  9951. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  9952. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  9953. } while (0)
  9954. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  9955. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  9956. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  9957. do { \
  9958. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  9959. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  9960. } while (0)
  9961. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  9962. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  9963. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  9964. do { \
  9965. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  9966. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  9967. } while (0)
  9968. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  9969. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  9970. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  9971. do { \
  9972. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  9973. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  9974. } while (0)
  9975. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  9976. (((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)
  9977. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  9978. do { \
  9979. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  9980. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  9981. } while (0)
  9982. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  9983. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  9984. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  9985. do { \
  9986. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  9987. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  9988. } while (0)
  9989. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  9990. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  9991. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  9992. do { \
  9993. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  9994. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  9995. } while (0)
  9996. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  9997. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  9998. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  9999. do { \
  10000. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  10001. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  10002. } while (0)
  10003. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  10004. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  10005. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10006. do { \
  10007. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10008. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10009. } while (0)
  10010. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10011. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10012. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10013. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10014. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10015. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10016. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10017. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10018. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10019. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10020. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10021. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10022. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10023. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10024. /**
  10025. * @brief target -> host rx peer unmap V2 message definition
  10026. *
  10027. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10028. *
  10029. * The following diagram shows the format of the rx peer unmap message sent
  10030. * from the target to the host.
  10031. *
  10032. * |31 24|23 16|15 8|7 0|
  10033. * |-----------------------------------------------------------------------|
  10034. * | SW peer ID | VDEV ID | msg type |
  10035. * |-----------------------------------------------------------------------|
  10036. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10037. * |-----------------------------------------------------------------------|
  10038. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10039. * |-----------------------------------------------------------------------|
  10040. * | Peer Delete Duration |
  10041. * |-----------------------------------------------------------------------|
  10042. * | Reserved_0 | WDS Free Count |
  10043. * |-----------------------------------------------------------------------|
  10044. * | Reserved_1 |
  10045. * |-----------------------------------------------------------------------|
  10046. * | Reserved_2 |
  10047. * |-----------------------------------------------------------------------|
  10048. *
  10049. *
  10050. * The following field definitions describe the format of the rx peer unmap
  10051. * messages sent from the target to the host.
  10052. * - MSG_TYPE
  10053. * Bits 7:0
  10054. * Purpose: identifies this as an rx peer unmap v2 message
  10055. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10056. * - VDEV_ID
  10057. * Bits 15:8
  10058. * Purpose: Indicates which virtual device the peer is associated
  10059. * with.
  10060. * Value: vdev ID (used in the host to look up the vdev object)
  10061. * - SW_PEER_ID
  10062. * Bits 31:16
  10063. * Purpose: The peer ID (index) that WAL is freeing
  10064. * Value: (rx) peer ID
  10065. * - MAC_ADDR_L32
  10066. * Bits 31:0
  10067. * Purpose: Identifies which peer node the peer ID is for.
  10068. * Value: lower 4 bytes of peer node's MAC address
  10069. * - MAC_ADDR_U16
  10070. * Bits 15:0
  10071. * Purpose: Identifies which peer node the peer ID is for.
  10072. * Value: upper 2 bytes of peer node's MAC address
  10073. * - NEXT_HOP
  10074. * Bits 16
  10075. * Purpose: Bit indicates next_hop AST entry used for WDS
  10076. * (Wireless Distribution System).
  10077. * - PEER_DELETE_DURATION
  10078. * Bits 31:0
  10079. * Purpose: Time taken to delete peer, in msec,
  10080. * Used for monitoring / debugging PEER delete response delay
  10081. * - PEER_WDS_FREE_COUNT
  10082. * Bits 15:0
  10083. * Purpose: Count of WDS entries deleted associated to peer deleted
  10084. */
  10085. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10086. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10087. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10088. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10089. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10090. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10091. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10092. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10093. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10094. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10095. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10096. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10097. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10098. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10099. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10100. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10101. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10102. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10103. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10104. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10105. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10106. do { \
  10107. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10108. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10109. } while (0)
  10110. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10111. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10112. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10113. do { \
  10114. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10115. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10116. } while (0)
  10117. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10118. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10119. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10120. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10121. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10122. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10123. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10124. /**
  10125. * @brief target -> host rx peer mlo map message definition
  10126. *
  10127. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10128. *
  10129. * @details
  10130. * The following diagram shows the format of the rx mlo peer map message sent
  10131. * from the target to the host. This layout assumes the target operates
  10132. * as little-endian.
  10133. *
  10134. * MCC:
  10135. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10136. *
  10137. * WIN:
  10138. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10139. * It will be sent on the Assoc Link.
  10140. *
  10141. * This message always contains a MLO peer ID. The main purpose of the
  10142. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10143. * with, so that the host can use that MLO peer ID to determine which peer
  10144. * transmitted the rx frame.
  10145. *
  10146. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  10147. * |-------------------------------------------------------------------------|
  10148. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  10149. * |-------------------------------------------------------------------------|
  10150. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10151. * |-------------------------------------------------------------------------|
  10152. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  10153. * |-------------------------------------------------------------------------|
  10154. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  10155. * |-------------------------------------------------------------------------|
  10156. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  10157. * |-------------------------------------------------------------------------|
  10158. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  10159. * |-------------------------------------------------------------------------|
  10160. * |RSVD |
  10161. * |-------------------------------------------------------------------------|
  10162. * |RSVD |
  10163. * |-------------------------------------------------------------------------|
  10164. * | htt_tlv_hdr_t |
  10165. * |-------------------------------------------------------------------------|
  10166. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10167. * |-------------------------------------------------------------------------|
  10168. * | htt_tlv_hdr_t |
  10169. * |-------------------------------------------------------------------------|
  10170. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10171. * |-------------------------------------------------------------------------|
  10172. * | htt_tlv_hdr_t |
  10173. * |-------------------------------------------------------------------------|
  10174. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10175. * |-------------------------------------------------------------------------|
  10176. *
  10177. * Where:
  10178. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  10179. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  10180. * V (valid) - 1 Bit Bit17
  10181. * CHIPID - 3 Bits
  10182. * TIDMASK - 8 Bits
  10183. * CACHE_SET_NUM - 8 Bits
  10184. *
  10185. * The following field definitions describe the format of the rx MLO peer map
  10186. * messages sent from the target to the host.
  10187. * - MSG_TYPE
  10188. * Bits 7:0
  10189. * Purpose: identifies this as an rx mlo peer map message
  10190. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  10191. *
  10192. * - MLO_PEER_ID
  10193. * Bits 23:8
  10194. * Purpose: The MLO peer ID (index).
  10195. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  10196. * Value: MLO peer ID
  10197. *
  10198. * - NUMLINK
  10199. * Bits: 26:24 (3Bits)
  10200. * Purpose: Indicate the max number of logical links supported per client.
  10201. * Value: number of logical links
  10202. *
  10203. * - PRC
  10204. * Bits: 29:27 (3Bits)
  10205. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  10206. * if there is migration of the primary chip.
  10207. * Value: Primary REO CHIPID
  10208. *
  10209. * - MAC_ADDR_L32
  10210. * Bits 31:0
  10211. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  10212. * Value: lower 4 bytes of peer node's MAC address
  10213. *
  10214. * - MAC_ADDR_U16
  10215. * Bits 15:0
  10216. * Purpose: Identifies which peer node the peer ID is for.
  10217. * Value: upper 2 bytes of peer node's MAC address
  10218. *
  10219. * - PRIMARY_TCL_AST_IDX
  10220. * Bits 15:0
  10221. * Purpose: Primary TCL AST index for this peer.
  10222. *
  10223. * - V
  10224. * 1 Bit Position 16
  10225. * Purpose: If the ast idx is valid.
  10226. *
  10227. * - CHIPID
  10228. * Bits 19:17
  10229. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  10230. *
  10231. * - TIDMASK
  10232. * Bits 27:20
  10233. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  10234. *
  10235. * - CACHE_SET_NUM
  10236. * Bits 31:28
  10237. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  10238. * Cache set number that should be used to cache the index based
  10239. * search results, for address and flow search.
  10240. * This value should be equal to LSB four bits of the hash value
  10241. * of match data, in case of search index points to an entry which
  10242. * may be used in content based search also. The value can be
  10243. * anything when the entry pointed by search index will not be
  10244. * used for content based search.
  10245. *
  10246. * - htt_tlv_hdr_t
  10247. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  10248. *
  10249. * Bits 11:0
  10250. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  10251. *
  10252. * Bits 23:12
  10253. * Purpose: Length, Length of the value that follows the header
  10254. *
  10255. * Bits 31:28
  10256. * Purpose: Reserved.
  10257. *
  10258. *
  10259. * - SW_PEER_ID
  10260. * Bits 15:0
  10261. * Purpose: The peer ID (index) that WAL is allocating
  10262. * Value: (rx) peer ID
  10263. *
  10264. * - VDEV_ID
  10265. * Bits 23:16
  10266. * Purpose: Indicates which virtual device the peer is associated with.
  10267. * Value: vdev ID (used in the host to look up the vdev object)
  10268. *
  10269. * - CHIPID
  10270. * Bits 26:24
  10271. * Purpose: Indicates which Chip id the peer is associated with.
  10272. * Value: chip ID (Provided by Host as part of QMI exchange)
  10273. */
  10274. typedef enum {
  10275. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  10276. } MLO_PEER_MAP_TLV_TAG_ID;
  10277. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  10278. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  10279. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  10280. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  10281. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  10282. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  10283. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10284. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  10285. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  10286. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  10287. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  10288. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  10289. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  10290. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  10291. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  10292. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  10293. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  10294. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  10295. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  10296. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  10297. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  10298. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  10299. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  10300. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  10301. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  10302. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  10303. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  10304. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  10305. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  10306. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  10307. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  10308. do { \
  10309. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  10310. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  10311. } while (0)
  10312. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  10313. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  10314. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  10315. do { \
  10316. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  10317. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  10318. } while (0)
  10319. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  10320. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  10321. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  10322. do { \
  10323. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  10324. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  10325. } while (0)
  10326. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  10327. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  10328. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  10329. do { \
  10330. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  10331. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  10332. } while (0)
  10333. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  10334. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  10335. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  10336. do { \
  10337. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  10338. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  10339. } while (0)
  10340. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  10341. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  10342. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  10343. do { \
  10344. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  10345. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  10346. } while (0)
  10347. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  10348. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  10349. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  10350. do { \
  10351. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  10352. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  10353. } while (0)
  10354. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  10355. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  10356. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  10357. do { \
  10358. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  10359. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  10360. } while (0)
  10361. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  10362. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  10363. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  10364. do { \
  10365. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  10366. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  10367. } while (0)
  10368. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  10369. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  10370. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  10371. do { \
  10372. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  10373. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  10374. } while (0)
  10375. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  10376. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  10377. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  10378. do { \
  10379. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  10380. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  10381. } while (0)
  10382. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  10383. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  10384. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  10385. do { \
  10386. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  10387. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  10388. } while (0)
  10389. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  10390. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  10391. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  10392. do { \
  10393. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  10394. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  10395. } while (0)
  10396. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  10397. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  10398. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10399. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  10400. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  10401. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  10402. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  10403. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  10404. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  10405. *
  10406. * The following diagram shows the format of the rx mlo peer unmap message sent
  10407. * from the target to the host.
  10408. *
  10409. * |31 24|23 16|15 8|7 0|
  10410. * |-----------------------------------------------------------------------|
  10411. * | RSVD_24_31 | MLO peer ID | msg type |
  10412. * |-----------------------------------------------------------------------|
  10413. */
  10414. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  10415. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  10416. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  10417. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  10418. /**
  10419. * @brief target -> host message specifying security parameters
  10420. *
  10421. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  10422. *
  10423. * @details
  10424. * The following diagram shows the format of the security specification
  10425. * message sent from the target to the host.
  10426. * This security specification message tells the host whether a PN check is
  10427. * necessary on rx data frames, and if so, how large the PN counter is.
  10428. * This message also tells the host about the security processing to apply
  10429. * to defragmented rx frames - specifically, whether a Message Integrity
  10430. * Check is required, and the Michael key to use.
  10431. *
  10432. * |31 24|23 16|15|14 8|7 0|
  10433. * |-----------------------------------------------------------------------|
  10434. * | peer ID | U| security type | msg type |
  10435. * |-----------------------------------------------------------------------|
  10436. * | Michael Key K0 |
  10437. * |-----------------------------------------------------------------------|
  10438. * | Michael Key K1 |
  10439. * |-----------------------------------------------------------------------|
  10440. * | WAPI RSC Low0 |
  10441. * |-----------------------------------------------------------------------|
  10442. * | WAPI RSC Low1 |
  10443. * |-----------------------------------------------------------------------|
  10444. * | WAPI RSC Hi0 |
  10445. * |-----------------------------------------------------------------------|
  10446. * | WAPI RSC Hi1 |
  10447. * |-----------------------------------------------------------------------|
  10448. *
  10449. * The following field definitions describe the format of the security
  10450. * indication message sent from the target to the host.
  10451. * - MSG_TYPE
  10452. * Bits 7:0
  10453. * Purpose: identifies this as a security specification message
  10454. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  10455. * - SEC_TYPE
  10456. * Bits 14:8
  10457. * Purpose: specifies which type of security applies to the peer
  10458. * Value: htt_sec_type enum value
  10459. * - UNICAST
  10460. * Bit 15
  10461. * Purpose: whether this security is applied to unicast or multicast data
  10462. * Value: 1 -> unicast, 0 -> multicast
  10463. * - PEER_ID
  10464. * Bits 31:16
  10465. * Purpose: The ID number for the peer the security specification is for
  10466. * Value: peer ID
  10467. * - MICHAEL_KEY_K0
  10468. * Bits 31:0
  10469. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  10470. * Value: Michael Key K0 (if security type is TKIP)
  10471. * - MICHAEL_KEY_K1
  10472. * Bits 31:0
  10473. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  10474. * Value: Michael Key K1 (if security type is TKIP)
  10475. * - WAPI_RSC_LOW0
  10476. * Bits 31:0
  10477. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  10478. * Value: WAPI RSC Low0 (if security type is WAPI)
  10479. * - WAPI_RSC_LOW1
  10480. * Bits 31:0
  10481. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  10482. * Value: WAPI RSC Low1 (if security type is WAPI)
  10483. * - WAPI_RSC_HI0
  10484. * Bits 31:0
  10485. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  10486. * Value: WAPI RSC Hi0 (if security type is WAPI)
  10487. * - WAPI_RSC_HI1
  10488. * Bits 31:0
  10489. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  10490. * Value: WAPI RSC Hi1 (if security type is WAPI)
  10491. */
  10492. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  10493. #define HTT_SEC_IND_SEC_TYPE_S 8
  10494. #define HTT_SEC_IND_UNICAST_M 0x00008000
  10495. #define HTT_SEC_IND_UNICAST_S 15
  10496. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  10497. #define HTT_SEC_IND_PEER_ID_S 16
  10498. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  10499. do { \
  10500. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  10501. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  10502. } while (0)
  10503. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  10504. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  10505. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  10506. do { \
  10507. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  10508. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  10509. } while (0)
  10510. #define HTT_SEC_IND_UNICAST_GET(word) \
  10511. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  10512. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  10513. do { \
  10514. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  10515. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  10516. } while (0)
  10517. #define HTT_SEC_IND_PEER_ID_GET(word) \
  10518. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  10519. #define HTT_SEC_IND_BYTES 28
  10520. /**
  10521. * @brief target -> host rx ADDBA / DELBA message definitions
  10522. *
  10523. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  10524. *
  10525. * @details
  10526. * The following diagram shows the format of the rx ADDBA message sent
  10527. * from the target to the host:
  10528. *
  10529. * |31 20|19 16|15 8|7 0|
  10530. * |---------------------------------------------------------------------|
  10531. * | peer ID | TID | window size | msg type |
  10532. * |---------------------------------------------------------------------|
  10533. *
  10534. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  10535. *
  10536. * The following diagram shows the format of the rx DELBA message sent
  10537. * from the target to the host:
  10538. *
  10539. * |31 20|19 16|15 10|9 8|7 0|
  10540. * |---------------------------------------------------------------------|
  10541. * | peer ID | TID | window size | IR| msg type |
  10542. * |---------------------------------------------------------------------|
  10543. *
  10544. * The following field definitions describe the format of the rx ADDBA
  10545. * and DELBA messages sent from the target to the host.
  10546. * - MSG_TYPE
  10547. * Bits 7:0
  10548. * Purpose: identifies this as an rx ADDBA or DELBA message
  10549. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  10550. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  10551. * - IR (initiator / recipient)
  10552. * Bits 9:8 (DELBA only)
  10553. * Purpose: specify whether the DELBA handshake was initiated by the
  10554. * local STA/AP, or by the peer STA/AP
  10555. * Value:
  10556. * 0 - unspecified
  10557. * 1 - initiator (a.k.a. originator)
  10558. * 2 - recipient (a.k.a. responder)
  10559. * 3 - unused / reserved
  10560. * - WIN_SIZE
  10561. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  10562. * Purpose: Specifies the length of the block ack window (max = 64).
  10563. * Value:
  10564. * block ack window length specified by the received ADDBA/DELBA
  10565. * management message.
  10566. * - TID
  10567. * Bits 19:16
  10568. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  10569. * Value:
  10570. * TID specified by the received ADDBA or DELBA management message.
  10571. * - PEER_ID
  10572. * Bits 31:20
  10573. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  10574. * Value:
  10575. * ID (hash value) used by the host for fast, direct lookup of
  10576. * host SW peer info, including rx reorder states.
  10577. */
  10578. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  10579. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  10580. #define HTT_RX_ADDBA_TID_M 0xf0000
  10581. #define HTT_RX_ADDBA_TID_S 16
  10582. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  10583. #define HTT_RX_ADDBA_PEER_ID_S 20
  10584. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  10585. do { \
  10586. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  10587. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  10588. } while (0)
  10589. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  10590. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  10591. #define HTT_RX_ADDBA_TID_SET(word, value) \
  10592. do { \
  10593. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  10594. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  10595. } while (0)
  10596. #define HTT_RX_ADDBA_TID_GET(word) \
  10597. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  10598. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  10599. do { \
  10600. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  10601. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  10602. } while (0)
  10603. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  10604. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  10605. #define HTT_RX_ADDBA_BYTES 4
  10606. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  10607. #define HTT_RX_DELBA_INITIATOR_S 8
  10608. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  10609. #define HTT_RX_DELBA_WIN_SIZE_S 10
  10610. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  10611. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  10612. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  10613. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  10614. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  10615. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  10616. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  10617. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  10618. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  10619. do { \
  10620. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  10621. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  10622. } while (0)
  10623. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  10624. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  10625. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  10626. do { \
  10627. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  10628. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  10629. } while (0)
  10630. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  10631. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  10632. #define HTT_RX_DELBA_BYTES 4
  10633. /**
  10634. * @brief tx queue group information element definition
  10635. *
  10636. * @details
  10637. * The following diagram shows the format of the tx queue group
  10638. * information element, which can be included in target --> host
  10639. * messages to specify the number of tx "credits" (tx descriptors
  10640. * for LL, or tx buffers for HL) available to a particular group
  10641. * of host-side tx queues, and which host-side tx queues belong to
  10642. * the group.
  10643. *
  10644. * |31|30 24|23 16|15|14|13 0|
  10645. * |------------------------------------------------------------------------|
  10646. * | X| reserved | tx queue grp ID | A| S| credit count |
  10647. * |------------------------------------------------------------------------|
  10648. * | vdev ID mask | AC mask |
  10649. * |------------------------------------------------------------------------|
  10650. *
  10651. * The following definitions describe the fields within the tx queue group
  10652. * information element:
  10653. * - credit_count
  10654. * Bits 13:1
  10655. * Purpose: specify how many tx credits are available to the tx queue group
  10656. * Value: An absolute or relative, positive or negative credit value
  10657. * The 'A' bit specifies whether the value is absolute or relative.
  10658. * The 'S' bit specifies whether the value is positive or negative.
  10659. * A negative value can only be relative, not absolute.
  10660. * An absolute value replaces any prior credit value the host has for
  10661. * the tx queue group in question.
  10662. * A relative value is added to the prior credit value the host has for
  10663. * the tx queue group in question.
  10664. * - sign
  10665. * Bit 14
  10666. * Purpose: specify whether the credit count is positive or negative
  10667. * Value: 0 -> positive, 1 -> negative
  10668. * - absolute
  10669. * Bit 15
  10670. * Purpose: specify whether the credit count is absolute or relative
  10671. * Value: 0 -> relative, 1 -> absolute
  10672. * - txq_group_id
  10673. * Bits 23:16
  10674. * Purpose: indicate which tx queue group's credit and/or membership are
  10675. * being specified
  10676. * Value: 0 to max_tx_queue_groups-1
  10677. * - reserved
  10678. * Bits 30:16
  10679. * Value: 0x0
  10680. * - eXtension
  10681. * Bit 31
  10682. * Purpose: specify whether another tx queue group info element follows
  10683. * Value: 0 -> no more tx queue group information elements
  10684. * 1 -> another tx queue group information element immediately follows
  10685. * - ac_mask
  10686. * Bits 15:0
  10687. * Purpose: specify which Access Categories belong to the tx queue group
  10688. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  10689. * the tx queue group.
  10690. * The AC bit-mask values are obtained by left-shifting by the
  10691. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  10692. * - vdev_id_mask
  10693. * Bits 31:16
  10694. * Purpose: specify which vdev's tx queues belong to the tx queue group
  10695. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  10696. * belong to the tx queue group.
  10697. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  10698. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  10699. */
  10700. PREPACK struct htt_txq_group {
  10701. A_UINT32
  10702. credit_count: 14,
  10703. sign: 1,
  10704. absolute: 1,
  10705. tx_queue_group_id: 8,
  10706. reserved0: 7,
  10707. extension: 1;
  10708. A_UINT32
  10709. ac_mask: 16,
  10710. vdev_id_mask: 16;
  10711. } POSTPACK;
  10712. /* first word */
  10713. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  10714. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  10715. #define HTT_TXQ_GROUP_SIGN_S 14
  10716. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  10717. #define HTT_TXQ_GROUP_ABS_S 15
  10718. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  10719. #define HTT_TXQ_GROUP_ID_S 16
  10720. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  10721. #define HTT_TXQ_GROUP_EXT_S 31
  10722. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  10723. /* second word */
  10724. #define HTT_TXQ_GROUP_AC_MASK_S 0
  10725. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  10726. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  10727. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  10728. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  10729. do { \
  10730. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  10731. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  10732. } while (0)
  10733. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  10734. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  10735. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  10736. do { \
  10737. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  10738. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  10739. } while (0)
  10740. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  10741. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  10742. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  10743. do { \
  10744. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  10745. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  10746. } while (0)
  10747. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  10748. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  10749. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  10750. do { \
  10751. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  10752. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  10753. } while (0)
  10754. #define HTT_TXQ_GROUP_ID_GET(_info) \
  10755. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  10756. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  10757. do { \
  10758. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  10759. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  10760. } while (0)
  10761. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  10762. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  10763. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  10764. do { \
  10765. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  10766. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  10767. } while (0)
  10768. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  10769. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  10770. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  10771. do { \
  10772. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  10773. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  10774. } while (0)
  10775. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  10776. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  10777. /**
  10778. * @brief target -> host TX completion indication message definition
  10779. *
  10780. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  10781. *
  10782. * @details
  10783. * The following diagram shows the format of the TX completion indication sent
  10784. * from the target to the host
  10785. *
  10786. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  10787. * |-------------------------------------------------------------------|
  10788. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  10789. * |-------------------------------------------------------------------|
  10790. * payload:| MSDU1 ID | MSDU0 ID |
  10791. * |-------------------------------------------------------------------|
  10792. * : MSDU3 ID | MSDU2 ID :
  10793. * |-------------------------------------------------------------------|
  10794. * | struct htt_tx_compl_ind_append_retries |
  10795. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10796. * | struct htt_tx_compl_ind_append_tx_tstamp |
  10797. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10798. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  10799. * |-------------------------------------------------------------------|
  10800. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  10801. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10802. * | MSDU0 tx_tsf64_low |
  10803. * |-------------------------------------------------------------------|
  10804. * | MSDU0 tx_tsf64_high |
  10805. * |-------------------------------------------------------------------|
  10806. * | MSDU1 tx_tsf64_low |
  10807. * |-------------------------------------------------------------------|
  10808. * | MSDU1 tx_tsf64_high |
  10809. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10810. * | phy_timestamp |
  10811. * |-------------------------------------------------------------------|
  10812. * | rate specs (see below) |
  10813. * |-------------------------------------------------------------------|
  10814. * | seqctrl | framectrl |
  10815. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  10816. * Where:
  10817. * A0 = append (a.k.a. append0)
  10818. * A1 = append1
  10819. * TP = MSDU tx power presence
  10820. * A2 = append2
  10821. * A3 = append3
  10822. * A4 = append4
  10823. *
  10824. * The following field definitions describe the format of the TX completion
  10825. * indication sent from the target to the host
  10826. * Header fields:
  10827. * - msg_type
  10828. * Bits 7:0
  10829. * Purpose: identifies this as HTT TX completion indication
  10830. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  10831. * - status
  10832. * Bits 10:8
  10833. * Purpose: the TX completion status of payload fragmentations descriptors
  10834. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  10835. * - tid
  10836. * Bits 14:11
  10837. * Purpose: the tid associated with those fragmentation descriptors. It is
  10838. * valid or not, depending on the tid_invalid bit.
  10839. * Value: 0 to 15
  10840. * - tid_invalid
  10841. * Bits 15:15
  10842. * Purpose: this bit indicates whether the tid field is valid or not
  10843. * Value: 0 indicates valid; 1 indicates invalid
  10844. * - num
  10845. * Bits 23:16
  10846. * Purpose: the number of payload in this indication
  10847. * Value: 1 to 255
  10848. * - append (a.k.a. append0)
  10849. * Bits 24:24
  10850. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  10851. * the number of tx retries for one MSDU at the end of this message
  10852. * Value: 0 indicates no appending; 1 indicates appending
  10853. * - append1
  10854. * Bits 25:25
  10855. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  10856. * contains the timestamp info for each TX msdu id in payload.
  10857. * The order of the timestamps matches the order of the MSDU IDs.
  10858. * Note that a big-endian host needs to account for the reordering
  10859. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10860. * conversion) when determining which tx timestamp corresponds to
  10861. * which MSDU ID.
  10862. * Value: 0 indicates no appending; 1 indicates appending
  10863. * - msdu_tx_power_presence
  10864. * Bits 26:26
  10865. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  10866. * for each MSDU referenced by the TX_COMPL_IND message.
  10867. * The tx power is reported in 0.5 dBm units.
  10868. * The order of the per-MSDU tx power reports matches the order
  10869. * of the MSDU IDs.
  10870. * Note that a big-endian host needs to account for the reordering
  10871. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  10872. * conversion) when determining which Tx Power corresponds to
  10873. * which MSDU ID.
  10874. * Value: 0 indicates MSDU tx power reports are not appended,
  10875. * 1 indicates MSDU tx power reports are appended
  10876. * - append2
  10877. * Bits 27:27
  10878. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  10879. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  10880. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  10881. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  10882. * for each MSDU, for convenience.
  10883. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  10884. * this append2 bit is set).
  10885. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  10886. * dB above the noise floor.
  10887. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  10888. * 1 indicates MSDU ACK RSSI values are appended.
  10889. * - append3
  10890. * Bits 28:28
  10891. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  10892. * contains the tx tsf info based on wlan global TSF for
  10893. * each TX msdu id in payload.
  10894. * The order of the tx tsf matches the order of the MSDU IDs.
  10895. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  10896. * values to indicate the the lower 32 bits and higher 32 bits of
  10897. * the tx tsf.
  10898. * The tx_tsf64 here represents the time MSDU was acked and the
  10899. * tx_tsf64 has microseconds units.
  10900. * Value: 0 indicates no appending; 1 indicates appending
  10901. * - append4
  10902. * Bits 29:29
  10903. * Purpose: Indicate whether data frame control fields and fields required
  10904. * for radio tap header are appended for each MSDU in TX_COMP_IND
  10905. * message. The order of the this message matches the order of
  10906. * the MSDU IDs.
  10907. * Value: 0 indicates frame control fields and fields required for
  10908. * radio tap header values are not appended,
  10909. * 1 indicates frame control fields and fields required for
  10910. * radio tap header values are appended.
  10911. * Payload fields:
  10912. * - hmsdu_id
  10913. * Bits 15:0
  10914. * Purpose: this ID is used to track the Tx buffer in host
  10915. * Value: 0 to "size of host MSDU descriptor pool - 1"
  10916. */
  10917. PREPACK struct htt_tx_data_hdr_information {
  10918. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  10919. A_UINT32 /* word 1 */
  10920. /* preamble:
  10921. * 0-OFDM,
  10922. * 1-CCk,
  10923. * 2-HT,
  10924. * 3-VHT
  10925. */
  10926. preamble: 2, /* [1:0] */
  10927. /* mcs:
  10928. * In case of HT preamble interpret
  10929. * MCS along with NSS.
  10930. * Valid values for HT are 0 to 7.
  10931. * HT mcs 0 with NSS 2 is mcs 8.
  10932. * Valid values for VHT are 0 to 9.
  10933. */
  10934. mcs: 4, /* [5:2] */
  10935. /* rate:
  10936. * This is applicable only for
  10937. * CCK and OFDM preamble type
  10938. * rate 0: OFDM 48 Mbps,
  10939. * 1: OFDM 24 Mbps,
  10940. * 2: OFDM 12 Mbps
  10941. * 3: OFDM 6 Mbps
  10942. * 4: OFDM 54 Mbps
  10943. * 5: OFDM 36 Mbps
  10944. * 6: OFDM 18 Mbps
  10945. * 7: OFDM 9 Mbps
  10946. * rate 0: CCK 11 Mbps Long
  10947. * 1: CCK 5.5 Mbps Long
  10948. * 2: CCK 2 Mbps Long
  10949. * 3: CCK 1 Mbps Long
  10950. * 4: CCK 11 Mbps Short
  10951. * 5: CCK 5.5 Mbps Short
  10952. * 6: CCK 2 Mbps Short
  10953. */
  10954. rate : 3, /* [ 8: 6] */
  10955. rssi : 8, /* [16: 9] units=dBm */
  10956. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10957. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10958. stbc : 1, /* [22] */
  10959. sgi : 1, /* [23] */
  10960. ldpc : 1, /* [24] */
  10961. beamformed: 1, /* [25] */
  10962. /* tx_retry_cnt:
  10963. * Indicates retry count of data tx frames provided by the host.
  10964. */
  10965. tx_retry_cnt: 6; /* [31:26] */
  10966. A_UINT32 /* word 2 */
  10967. framectrl:16, /* [15: 0] */
  10968. seqno:16; /* [31:16] */
  10969. } POSTPACK;
  10970. #define HTT_TX_COMPL_IND_STATUS_S 8
  10971. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  10972. #define HTT_TX_COMPL_IND_TID_S 11
  10973. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  10974. #define HTT_TX_COMPL_IND_TID_INV_S 15
  10975. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  10976. #define HTT_TX_COMPL_IND_NUM_S 16
  10977. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  10978. #define HTT_TX_COMPL_IND_APPEND_S 24
  10979. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  10980. #define HTT_TX_COMPL_IND_APPEND1_S 25
  10981. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  10982. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  10983. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  10984. #define HTT_TX_COMPL_IND_APPEND2_S 27
  10985. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  10986. #define HTT_TX_COMPL_IND_APPEND3_S 28
  10987. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  10988. #define HTT_TX_COMPL_IND_APPEND4_S 29
  10989. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  10990. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  10991. do { \
  10992. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  10993. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  10994. } while (0)
  10995. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  10996. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  10997. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  10998. do { \
  10999. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  11000. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  11001. } while (0)
  11002. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  11003. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  11004. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  11005. do { \
  11006. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11007. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11008. } while (0)
  11009. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11010. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11011. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11012. do { \
  11013. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11014. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11015. } while (0)
  11016. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11017. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11018. HTT_TX_COMPL_IND_TID_INV_S)
  11019. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11020. do { \
  11021. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11022. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11023. } while (0)
  11024. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11025. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11026. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11027. do { \
  11028. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11029. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11030. } while (0)
  11031. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11032. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11033. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11034. do { \
  11035. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11036. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11037. } while (0)
  11038. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11039. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11040. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11041. do { \
  11042. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11043. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11044. } while (0)
  11045. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11046. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11047. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11048. do { \
  11049. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11050. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11051. } while (0)
  11052. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11053. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11054. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11055. do { \
  11056. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11057. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11058. } while (0)
  11059. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11060. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11061. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11062. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11063. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11064. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11065. #define HTT_TX_COMPL_IND_STAT_OK 0
  11066. /* DISCARD:
  11067. * current meaning:
  11068. * MSDUs were queued for transmission but filtered by HW or SW
  11069. * without any over the air attempts
  11070. * legacy meaning (HL Rome):
  11071. * MSDUs were discarded by the target FW without any over the air
  11072. * attempts due to lack of space
  11073. */
  11074. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11075. /* NO_ACK:
  11076. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11077. */
  11078. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11079. /* POSTPONE:
  11080. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11081. * be downloaded again later (in the appropriate order), when they are
  11082. * deliverable.
  11083. */
  11084. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11085. /*
  11086. * The PEER_DEL tx completion status is used for HL cases
  11087. * where the peer the frame is for has been deleted.
  11088. * The host has already discarded its copy of the frame, but
  11089. * it still needs the tx completion to restore its credit.
  11090. */
  11091. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11092. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11093. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11094. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11095. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11096. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11097. PREPACK struct htt_tx_compl_ind_base {
  11098. A_UINT32 hdr;
  11099. A_UINT16 payload[1/*or more*/];
  11100. } POSTPACK;
  11101. PREPACK struct htt_tx_compl_ind_append_retries {
  11102. A_UINT16 msdu_id;
  11103. A_UINT8 tx_retries;
  11104. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11105. 0: this is the last append_retries struct */
  11106. } POSTPACK;
  11107. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11108. A_UINT32 timestamp[1/*or more*/];
  11109. } POSTPACK;
  11110. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11111. A_UINT32 tx_tsf64_low;
  11112. A_UINT32 tx_tsf64_high;
  11113. } POSTPACK;
  11114. /* htt_tx_data_hdr_information payload extension fields: */
  11115. /* DWORD zero */
  11116. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11117. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11118. /* DWORD one */
  11119. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11120. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11121. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11122. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11123. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11124. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11125. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11126. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11127. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11128. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11129. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11130. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11131. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11132. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11133. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11134. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11135. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11136. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11137. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11138. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11139. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11140. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11141. /* DWORD two */
  11142. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11143. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11144. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11145. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11146. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  11147. do { \
  11148. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  11149. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  11150. } while (0)
  11151. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  11152. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  11153. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  11154. do { \
  11155. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  11156. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  11157. } while (0)
  11158. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  11159. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  11160. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  11161. do { \
  11162. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  11163. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  11164. } while (0)
  11165. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  11166. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  11167. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  11168. do { \
  11169. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  11170. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  11171. } while (0)
  11172. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  11173. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  11174. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  11175. do { \
  11176. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  11177. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  11178. } while (0)
  11179. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  11180. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  11181. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  11182. do { \
  11183. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  11184. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  11185. } while (0)
  11186. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  11187. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  11188. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  11189. do { \
  11190. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  11191. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  11192. } while (0)
  11193. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  11194. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  11195. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  11196. do { \
  11197. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  11198. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  11199. } while (0)
  11200. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  11201. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  11202. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  11203. do { \
  11204. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  11205. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  11206. } while (0)
  11207. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  11208. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  11209. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  11210. do { \
  11211. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  11212. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  11213. } while (0)
  11214. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  11215. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  11216. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  11217. do { \
  11218. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  11219. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  11220. } while (0)
  11221. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  11222. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  11223. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  11224. do { \
  11225. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  11226. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  11227. } while (0)
  11228. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  11229. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  11230. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  11231. do { \
  11232. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  11233. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  11234. } while (0)
  11235. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  11236. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  11237. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  11238. do { \
  11239. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  11240. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  11241. } while (0)
  11242. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  11243. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  11244. /**
  11245. * @brief target -> host rate-control update indication message
  11246. *
  11247. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  11248. *
  11249. * @details
  11250. * The following diagram shows the format of the RC Update message
  11251. * sent from the target to the host, while processing the tx-completion
  11252. * of a transmitted PPDU.
  11253. *
  11254. * |31 24|23 16|15 8|7 0|
  11255. * |-------------------------------------------------------------|
  11256. * | peer ID | vdev ID | msg_type |
  11257. * |-------------------------------------------------------------|
  11258. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11259. * |-------------------------------------------------------------|
  11260. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  11261. * |-------------------------------------------------------------|
  11262. * | : |
  11263. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11264. * | : |
  11265. * |-------------------------------------------------------------|
  11266. * | : |
  11267. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  11268. * | : |
  11269. * |-------------------------------------------------------------|
  11270. * : :
  11271. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11272. *
  11273. */
  11274. typedef struct {
  11275. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  11276. A_UINT32 rate_code_flags;
  11277. A_UINT32 flags; /* Encodes information such as excessive
  11278. retransmission, aggregate, some info
  11279. from .11 frame control,
  11280. STBC, LDPC, (SGI and Tx Chain Mask
  11281. are encoded in ptx_rc->flags field),
  11282. AMPDU truncation (BT/time based etc.),
  11283. RTS/CTS attempt */
  11284. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  11285. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  11286. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  11287. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  11288. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  11289. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  11290. } HTT_RC_TX_DONE_PARAMS;
  11291. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  11292. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  11293. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  11294. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  11295. #define HTT_RC_UPDATE_VDEVID_S 8
  11296. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  11297. #define HTT_RC_UPDATE_PEERID_S 16
  11298. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  11299. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  11300. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  11301. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  11302. do { \
  11303. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  11304. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  11305. } while (0)
  11306. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  11307. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  11308. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  11309. do { \
  11310. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  11311. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  11312. } while (0)
  11313. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  11314. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  11315. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  11316. do { \
  11317. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  11318. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  11319. } while (0)
  11320. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  11321. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  11322. /**
  11323. * @brief target -> host rx fragment indication message definition
  11324. *
  11325. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  11326. *
  11327. * @details
  11328. * The following field definitions describe the format of the rx fragment
  11329. * indication message sent from the target to the host.
  11330. * The rx fragment indication message shares the format of the
  11331. * rx indication message, but not all fields from the rx indication message
  11332. * are relevant to the rx fragment indication message.
  11333. *
  11334. *
  11335. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  11336. * |-----------+-------------------+---------------------+-------------|
  11337. * | peer ID | |FV| ext TID | msg type |
  11338. * |-------------------------------------------------------------------|
  11339. * | | flush | flush |
  11340. * | | end | start |
  11341. * | | seq num | seq num |
  11342. * |-------------------------------------------------------------------|
  11343. * | reserved | FW rx desc bytes |
  11344. * |-------------------------------------------------------------------|
  11345. * | | FW MSDU Rx |
  11346. * | | desc B0 |
  11347. * |-------------------------------------------------------------------|
  11348. * Header fields:
  11349. * - MSG_TYPE
  11350. * Bits 7:0
  11351. * Purpose: identifies this as an rx fragment indication message
  11352. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  11353. * - EXT_TID
  11354. * Bits 12:8
  11355. * Purpose: identify the traffic ID of the rx data, including
  11356. * special "extended" TID values for multicast, broadcast, and
  11357. * non-QoS data frames
  11358. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  11359. * - FLUSH_VALID (FV)
  11360. * Bit 13
  11361. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  11362. * is valid
  11363. * Value:
  11364. * 1 -> flush IE is valid and needs to be processed
  11365. * 0 -> flush IE is not valid and should be ignored
  11366. * - PEER_ID
  11367. * Bits 31:16
  11368. * Purpose: Identify, by ID, which peer sent the rx data
  11369. * Value: ID of the peer who sent the rx data
  11370. * - FLUSH_SEQ_NUM_START
  11371. * Bits 5:0
  11372. * Purpose: Indicate the start of a series of MPDUs to flush
  11373. * Not all MPDUs within this series are necessarily valid - the host
  11374. * must check each sequence number within this range to see if the
  11375. * corresponding MPDU is actually present.
  11376. * This field is only valid if the FV bit is set.
  11377. * Value:
  11378. * The sequence number for the first MPDUs to check to flush.
  11379. * The sequence number is masked by 0x3f.
  11380. * - FLUSH_SEQ_NUM_END
  11381. * Bits 11:6
  11382. * Purpose: Indicate the end of a series of MPDUs to flush
  11383. * Value:
  11384. * The sequence number one larger than the sequence number of the
  11385. * last MPDU to check to flush.
  11386. * The sequence number is masked by 0x3f.
  11387. * Not all MPDUs within this series are necessarily valid - the host
  11388. * must check each sequence number within this range to see if the
  11389. * corresponding MPDU is actually present.
  11390. * This field is only valid if the FV bit is set.
  11391. * Rx descriptor fields:
  11392. * - FW_RX_DESC_BYTES
  11393. * Bits 15:0
  11394. * Purpose: Indicate how many bytes in the Rx indication are used for
  11395. * FW Rx descriptors
  11396. * Value: 1
  11397. */
  11398. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  11399. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  11400. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  11401. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  11402. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  11403. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  11404. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  11405. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  11406. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  11407. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  11408. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  11409. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  11410. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  11411. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  11412. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  11413. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  11414. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  11415. #define HTT_RX_FRAG_IND_BYTES \
  11416. (4 /* msg hdr */ + \
  11417. 4 /* flush spec */ + \
  11418. 4 /* (unused) FW rx desc bytes spec */ + \
  11419. 4 /* FW rx desc */)
  11420. /**
  11421. * @brief target -> host test message definition
  11422. *
  11423. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  11424. *
  11425. * @details
  11426. * The following field definitions describe the format of the test
  11427. * message sent from the target to the host.
  11428. * The message consists of a 4-octet header, followed by a variable
  11429. * number of 32-bit integer values, followed by a variable number
  11430. * of 8-bit character values.
  11431. *
  11432. * |31 16|15 8|7 0|
  11433. * |-----------------------------------------------------------|
  11434. * | num chars | num ints | msg type |
  11435. * |-----------------------------------------------------------|
  11436. * | int 0 |
  11437. * |-----------------------------------------------------------|
  11438. * | int 1 |
  11439. * |-----------------------------------------------------------|
  11440. * | ... |
  11441. * |-----------------------------------------------------------|
  11442. * | char 3 | char 2 | char 1 | char 0 |
  11443. * |-----------------------------------------------------------|
  11444. * | | | ... | char 4 |
  11445. * |-----------------------------------------------------------|
  11446. * - MSG_TYPE
  11447. * Bits 7:0
  11448. * Purpose: identifies this as a test message
  11449. * Value: HTT_MSG_TYPE_TEST
  11450. * - NUM_INTS
  11451. * Bits 15:8
  11452. * Purpose: indicate how many 32-bit integers follow the message header
  11453. * - NUM_CHARS
  11454. * Bits 31:16
  11455. * Purpose: indicate how many 8-bit charaters follow the series of integers
  11456. */
  11457. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  11458. #define HTT_RX_TEST_NUM_INTS_S 8
  11459. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  11460. #define HTT_RX_TEST_NUM_CHARS_S 16
  11461. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  11462. do { \
  11463. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  11464. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  11465. } while (0)
  11466. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  11467. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  11468. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  11469. do { \
  11470. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  11471. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  11472. } while (0)
  11473. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  11474. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  11475. /**
  11476. * @brief target -> host packet log message
  11477. *
  11478. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  11479. *
  11480. * @details
  11481. * The following field definitions describe the format of the packet log
  11482. * message sent from the target to the host.
  11483. * The message consists of a 4-octet header,followed by a variable number
  11484. * of 32-bit character values.
  11485. *
  11486. * |31 16|15 12|11 10|9 8|7 0|
  11487. * |------------------------------------------------------------------|
  11488. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  11489. * |------------------------------------------------------------------|
  11490. * | payload |
  11491. * |------------------------------------------------------------------|
  11492. * - MSG_TYPE
  11493. * Bits 7:0
  11494. * Purpose: identifies this as a pktlog message
  11495. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  11496. * - mac_id
  11497. * Bits 9:8
  11498. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  11499. * Value: 0-3
  11500. * - pdev_id
  11501. * Bits 11:10
  11502. * Purpose: pdev_id
  11503. * Value: 0-3
  11504. * 0 (for rings at SOC level),
  11505. * 1/2/3 PDEV -> 0/1/2
  11506. * - payload_size
  11507. * Bits 31:16
  11508. * Purpose: explicitly specify the payload size
  11509. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  11510. */
  11511. PREPACK struct htt_pktlog_msg {
  11512. A_UINT32 header;
  11513. A_UINT32 payload[1/* or more */];
  11514. } POSTPACK;
  11515. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  11516. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  11517. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  11518. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  11519. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  11520. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  11521. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  11522. do { \
  11523. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  11524. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  11525. } while (0)
  11526. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  11527. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  11528. HTT_T2H_PKTLOG_MAC_ID_S)
  11529. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  11530. do { \
  11531. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  11532. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  11533. } while (0)
  11534. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  11535. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  11536. HTT_T2H_PKTLOG_PDEV_ID_S)
  11537. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  11538. do { \
  11539. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  11540. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  11541. } while (0)
  11542. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  11543. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  11544. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  11545. /*
  11546. * Rx reorder statistics
  11547. * NB: all the fields must be defined in 4 octets size.
  11548. */
  11549. struct rx_reorder_stats {
  11550. /* Non QoS MPDUs received */
  11551. A_UINT32 deliver_non_qos;
  11552. /* MPDUs received in-order */
  11553. A_UINT32 deliver_in_order;
  11554. /* Flush due to reorder timer expired */
  11555. A_UINT32 deliver_flush_timeout;
  11556. /* Flush due to move out of window */
  11557. A_UINT32 deliver_flush_oow;
  11558. /* Flush due to DELBA */
  11559. A_UINT32 deliver_flush_delba;
  11560. /* MPDUs dropped due to FCS error */
  11561. A_UINT32 fcs_error;
  11562. /* MPDUs dropped due to monitor mode non-data packet */
  11563. A_UINT32 mgmt_ctrl;
  11564. /* Unicast-data MPDUs dropped due to invalid peer */
  11565. A_UINT32 invalid_peer;
  11566. /* MPDUs dropped due to duplication (non aggregation) */
  11567. A_UINT32 dup_non_aggr;
  11568. /* MPDUs dropped due to processed before */
  11569. A_UINT32 dup_past;
  11570. /* MPDUs dropped due to duplicate in reorder queue */
  11571. A_UINT32 dup_in_reorder;
  11572. /* Reorder timeout happened */
  11573. A_UINT32 reorder_timeout;
  11574. /* invalid bar ssn */
  11575. A_UINT32 invalid_bar_ssn;
  11576. /* reorder reset due to bar ssn */
  11577. A_UINT32 ssn_reset;
  11578. /* Flush due to delete peer */
  11579. A_UINT32 deliver_flush_delpeer;
  11580. /* Flush due to offload*/
  11581. A_UINT32 deliver_flush_offload;
  11582. /* Flush due to out of buffer*/
  11583. A_UINT32 deliver_flush_oob;
  11584. /* MPDUs dropped due to PN check fail */
  11585. A_UINT32 pn_fail;
  11586. /* MPDUs dropped due to unable to allocate memory */
  11587. A_UINT32 store_fail;
  11588. /* Number of times the tid pool alloc succeeded */
  11589. A_UINT32 tid_pool_alloc_succ;
  11590. /* Number of times the MPDU pool alloc succeeded */
  11591. A_UINT32 mpdu_pool_alloc_succ;
  11592. /* Number of times the MSDU pool alloc succeeded */
  11593. A_UINT32 msdu_pool_alloc_succ;
  11594. /* Number of times the tid pool alloc failed */
  11595. A_UINT32 tid_pool_alloc_fail;
  11596. /* Number of times the MPDU pool alloc failed */
  11597. A_UINT32 mpdu_pool_alloc_fail;
  11598. /* Number of times the MSDU pool alloc failed */
  11599. A_UINT32 msdu_pool_alloc_fail;
  11600. /* Number of times the tid pool freed */
  11601. A_UINT32 tid_pool_free;
  11602. /* Number of times the MPDU pool freed */
  11603. A_UINT32 mpdu_pool_free;
  11604. /* Number of times the MSDU pool freed */
  11605. A_UINT32 msdu_pool_free;
  11606. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  11607. A_UINT32 msdu_queued;
  11608. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  11609. A_UINT32 msdu_recycled;
  11610. /* Number of MPDUs with invalid peer but A2 found in AST */
  11611. A_UINT32 invalid_peer_a2_in_ast;
  11612. /* Number of MPDUs with invalid peer but A3 found in AST */
  11613. A_UINT32 invalid_peer_a3_in_ast;
  11614. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  11615. A_UINT32 invalid_peer_bmc_mpdus;
  11616. /* Number of MSDUs with err attention word */
  11617. A_UINT32 rxdesc_err_att;
  11618. /* Number of MSDUs with flag of peer_idx_invalid */
  11619. A_UINT32 rxdesc_err_peer_idx_inv;
  11620. /* Number of MSDUs with flag of peer_idx_timeout */
  11621. A_UINT32 rxdesc_err_peer_idx_to;
  11622. /* Number of MSDUs with flag of overflow */
  11623. A_UINT32 rxdesc_err_ov;
  11624. /* Number of MSDUs with flag of msdu_length_err */
  11625. A_UINT32 rxdesc_err_msdu_len;
  11626. /* Number of MSDUs with flag of mpdu_length_err */
  11627. A_UINT32 rxdesc_err_mpdu_len;
  11628. /* Number of MSDUs with flag of tkip_mic_err */
  11629. A_UINT32 rxdesc_err_tkip_mic;
  11630. /* Number of MSDUs with flag of decrypt_err */
  11631. A_UINT32 rxdesc_err_decrypt;
  11632. /* Number of MSDUs with flag of fcs_err */
  11633. A_UINT32 rxdesc_err_fcs;
  11634. /* Number of Unicast (bc_mc bit is not set in attention word)
  11635. * frames with invalid peer handler
  11636. */
  11637. A_UINT32 rxdesc_uc_msdus_inv_peer;
  11638. /* Number of unicast frame directly (direct bit is set in attention word)
  11639. * to DUT with invalid peer handler
  11640. */
  11641. A_UINT32 rxdesc_direct_msdus_inv_peer;
  11642. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  11643. * frames with invalid peer handler
  11644. */
  11645. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  11646. /* Number of MSDUs dropped due to no first MSDU flag */
  11647. A_UINT32 rxdesc_no_1st_msdu;
  11648. /* Number of MSDUs droped due to ring overflow */
  11649. A_UINT32 msdu_drop_ring_ov;
  11650. /* Number of MSDUs dropped due to FC mismatch */
  11651. A_UINT32 msdu_drop_fc_mismatch;
  11652. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  11653. A_UINT32 msdu_drop_mgmt_remote_ring;
  11654. /* Number of MSDUs dropped due to errors not reported in attention word */
  11655. A_UINT32 msdu_drop_misc;
  11656. /* Number of MSDUs go to offload before reorder */
  11657. A_UINT32 offload_msdu_wal;
  11658. /* Number of data frame dropped by offload after reorder */
  11659. A_UINT32 offload_msdu_reorder;
  11660. /* Number of MPDUs with sequence number in the past and within the BA window */
  11661. A_UINT32 dup_past_within_window;
  11662. /* Number of MPDUs with sequence number in the past and outside the BA window */
  11663. A_UINT32 dup_past_outside_window;
  11664. /* Number of MSDUs with decrypt/MIC error */
  11665. A_UINT32 rxdesc_err_decrypt_mic;
  11666. /* Number of data MSDUs received on both local and remote rings */
  11667. A_UINT32 data_msdus_on_both_rings;
  11668. /* MPDUs never filled */
  11669. A_UINT32 holes_not_filled;
  11670. };
  11671. /*
  11672. * Rx Remote buffer statistics
  11673. * NB: all the fields must be defined in 4 octets size.
  11674. */
  11675. struct rx_remote_buffer_mgmt_stats {
  11676. /* Total number of MSDUs reaped for Rx processing */
  11677. A_UINT32 remote_reaped;
  11678. /* MSDUs recycled within firmware */
  11679. A_UINT32 remote_recycled;
  11680. /* MSDUs stored by Data Rx */
  11681. A_UINT32 data_rx_msdus_stored;
  11682. /* Number of HTT indications from WAL Rx MSDU */
  11683. A_UINT32 wal_rx_ind;
  11684. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  11685. A_UINT32 wal_rx_ind_unconsumed;
  11686. /* Number of HTT indications from Data Rx MSDU */
  11687. A_UINT32 data_rx_ind;
  11688. /* Number of unconsumed HTT indications from Data Rx MSDU */
  11689. A_UINT32 data_rx_ind_unconsumed;
  11690. /* Number of HTT indications from ATHBUF */
  11691. A_UINT32 athbuf_rx_ind;
  11692. /* Number of remote buffers requested for refill */
  11693. A_UINT32 refill_buf_req;
  11694. /* Number of remote buffers filled by the host */
  11695. A_UINT32 refill_buf_rsp;
  11696. /* Number of times MAC hw_index = f/w write_index */
  11697. A_INT32 mac_no_bufs;
  11698. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  11699. A_INT32 fw_indices_equal;
  11700. /* Number of times f/w finds no buffers to post */
  11701. A_INT32 host_no_bufs;
  11702. };
  11703. /*
  11704. * TXBF MU/SU packets and NDPA statistics
  11705. * NB: all the fields must be defined in 4 octets size.
  11706. */
  11707. struct rx_txbf_musu_ndpa_pkts_stats {
  11708. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  11709. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  11710. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  11711. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  11712. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  11713. A_UINT32 reserved[3]; /* must be set to 0x0 */
  11714. };
  11715. /*
  11716. * htt_dbg_stats_status -
  11717. * present - The requested stats have been delivered in full.
  11718. * This indicates that either the stats information was contained
  11719. * in its entirety within this message, or else this message
  11720. * completes the delivery of the requested stats info that was
  11721. * partially delivered through earlier STATS_CONF messages.
  11722. * partial - The requested stats have been delivered in part.
  11723. * One or more subsequent STATS_CONF messages with the same
  11724. * cookie value will be sent to deliver the remainder of the
  11725. * information.
  11726. * error - The requested stats could not be delivered, for example due
  11727. * to a shortage of memory to construct a message holding the
  11728. * requested stats.
  11729. * invalid - The requested stat type is either not recognized, or the
  11730. * target is configured to not gather the stats type in question.
  11731. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  11732. * series_done - This special value indicates that no further stats info
  11733. * elements are present within a series of stats info elems
  11734. * (within a stats upload confirmation message).
  11735. */
  11736. enum htt_dbg_stats_status {
  11737. HTT_DBG_STATS_STATUS_PRESENT = 0,
  11738. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  11739. HTT_DBG_STATS_STATUS_ERROR = 2,
  11740. HTT_DBG_STATS_STATUS_INVALID = 3,
  11741. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  11742. };
  11743. /**
  11744. * @brief target -> host statistics upload
  11745. *
  11746. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  11747. *
  11748. * @details
  11749. * The following field definitions describe the format of the HTT target
  11750. * to host stats upload confirmation message.
  11751. * The message contains a cookie echoed from the HTT host->target stats
  11752. * upload request, which identifies which request the confirmation is
  11753. * for, and a series of tag-length-value stats information elements.
  11754. * The tag-length header for each stats info element also includes a
  11755. * status field, to indicate whether the request for the stat type in
  11756. * question was fully met, partially met, unable to be met, or invalid
  11757. * (if the stat type in question is disabled in the target).
  11758. * A special value of all 1's in this status field is used to indicate
  11759. * the end of the series of stats info elements.
  11760. *
  11761. *
  11762. * |31 16|15 8|7 5|4 0|
  11763. * |------------------------------------------------------------|
  11764. * | reserved | msg type |
  11765. * |------------------------------------------------------------|
  11766. * | cookie LSBs |
  11767. * |------------------------------------------------------------|
  11768. * | cookie MSBs |
  11769. * |------------------------------------------------------------|
  11770. * | stats entry length | reserved | S |stat type|
  11771. * |------------------------------------------------------------|
  11772. * | |
  11773. * | type-specific stats info |
  11774. * | |
  11775. * |------------------------------------------------------------|
  11776. * | stats entry length | reserved | S |stat type|
  11777. * |------------------------------------------------------------|
  11778. * | |
  11779. * | type-specific stats info |
  11780. * | |
  11781. * |------------------------------------------------------------|
  11782. * | n/a | reserved | 111 | n/a |
  11783. * |------------------------------------------------------------|
  11784. * Header fields:
  11785. * - MSG_TYPE
  11786. * Bits 7:0
  11787. * Purpose: identifies this is a statistics upload confirmation message
  11788. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  11789. * - COOKIE_LSBS
  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: LSBs of the opaque cookie specified by the host-side requestor
  11794. * - COOKIE_MSBS
  11795. * Bits 31:0
  11796. * Purpose: Provide a mechanism to match a target->host stats confirmation
  11797. * message with its preceding host->target stats request message.
  11798. * Value: MSBs of the opaque cookie specified by the host-side requestor
  11799. *
  11800. * Stats Information Element tag-length header fields:
  11801. * - STAT_TYPE
  11802. * Bits 4:0
  11803. * Purpose: identifies the type of statistics info held in the
  11804. * following information element
  11805. * Value: htt_dbg_stats_type
  11806. * - STATUS
  11807. * Bits 7:5
  11808. * Purpose: indicate whether the requested stats are present
  11809. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  11810. * the completion of the stats entry series
  11811. * - LENGTH
  11812. * Bits 31:16
  11813. * Purpose: indicate the stats information size
  11814. * Value: This field specifies the number of bytes of stats information
  11815. * that follows the element tag-length header.
  11816. * It is expected but not required that this length is a multiple of
  11817. * 4 bytes. Even if the length is not an integer multiple of 4, the
  11818. * subsequent stats entry header will begin on a 4-byte aligned
  11819. * boundary.
  11820. */
  11821. #define HTT_T2H_STATS_COOKIE_SIZE 8
  11822. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  11823. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  11824. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  11825. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  11826. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  11827. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  11828. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  11829. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  11830. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  11831. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  11832. do { \
  11833. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  11834. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  11835. } while (0)
  11836. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  11837. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  11838. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  11839. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  11840. do { \
  11841. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  11842. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  11843. } while (0)
  11844. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  11845. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  11846. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  11847. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  11848. do { \
  11849. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  11850. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  11851. } while (0)
  11852. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  11853. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  11854. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  11855. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  11856. #define HTT_MAX_AGGR 64
  11857. #define HTT_HL_MAX_AGGR 18
  11858. /**
  11859. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  11860. *
  11861. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  11862. *
  11863. * @details
  11864. * The following field definitions describe the format of the HTT host
  11865. * to target frag_desc/msdu_ext bank configuration message.
  11866. * The message contains the based address and the min and max id of the
  11867. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  11868. * MSDU_EXT/FRAG_DESC.
  11869. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  11870. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  11871. * the hardware does the mapping/translation.
  11872. *
  11873. * Total banks that can be configured is configured to 16.
  11874. *
  11875. * This should be called before any TX has be initiated by the HTT
  11876. *
  11877. * |31 16|15 8|7 5|4 0|
  11878. * |------------------------------------------------------------|
  11879. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  11880. * |------------------------------------------------------------|
  11881. * | BANK0_BASE_ADDRESS (bits 31:0) |
  11882. #if HTT_PADDR64
  11883. * | BANK0_BASE_ADDRESS (bits 63:32) |
  11884. #endif
  11885. * |------------------------------------------------------------|
  11886. * | ... |
  11887. * |------------------------------------------------------------|
  11888. * | BANK15_BASE_ADDRESS (bits 31:0) |
  11889. #if HTT_PADDR64
  11890. * | BANK15_BASE_ADDRESS (bits 63:32) |
  11891. #endif
  11892. * |------------------------------------------------------------|
  11893. * | BANK0_MAX_ID | BANK0_MIN_ID |
  11894. * |------------------------------------------------------------|
  11895. * | ... |
  11896. * |------------------------------------------------------------|
  11897. * | BANK15_MAX_ID | BANK15_MIN_ID |
  11898. * |------------------------------------------------------------|
  11899. * Header fields:
  11900. * - MSG_TYPE
  11901. * Bits 7:0
  11902. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  11903. * for systems with 64-bit format for bus addresses:
  11904. * - BANKx_BASE_ADDRESS_LO
  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: lower 4 bytes of MSDU_EXT bank physical / bus address
  11909. * - BANKx_BASE_ADDRESS_HI
  11910. * Bits 31:0
  11911. * Purpose: Provide a mechanism to specify the base address of the
  11912. * MSDU_EXT bank physical/bus address.
  11913. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  11914. * for systems with 32-bit format for bus addresses:
  11915. * - BANKx_BASE_ADDRESS
  11916. * Bits 31:0
  11917. * Purpose: Provide a mechanism to specify the base address of the
  11918. * MSDU_EXT bank physical/bus address.
  11919. * Value: MSDU_EXT bank physical / bus address
  11920. * - BANKx_MIN_ID
  11921. * Bits 15:0
  11922. * Purpose: Provide a mechanism to specify the min index that needs to
  11923. * mapped.
  11924. * - BANKx_MAX_ID
  11925. * Bits 31:16
  11926. * Purpose: Provide a mechanism to specify the max index that needs to
  11927. * mapped.
  11928. *
  11929. */
  11930. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  11931. * safe value.
  11932. * @note MAX supported banks is 16.
  11933. */
  11934. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  11935. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  11936. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  11937. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  11938. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  11939. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  11940. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  11941. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  11942. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  11943. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  11944. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  11945. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  11946. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  11947. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  11948. do { \
  11949. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  11950. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  11951. } while (0)
  11952. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  11953. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  11954. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  11955. do { \
  11956. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  11957. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  11958. } while (0)
  11959. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  11960. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  11961. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  11962. do { \
  11963. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  11964. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  11965. } while (0)
  11966. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  11967. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  11968. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  11969. do { \
  11970. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  11971. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  11972. } while (0)
  11973. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  11974. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  11975. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  11976. do { \
  11977. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  11978. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  11979. } while (0)
  11980. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  11981. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  11982. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  11983. do { \
  11984. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  11985. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  11986. } while (0)
  11987. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  11988. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  11989. /*
  11990. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  11991. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  11992. * addresses are stored in a XXX-bit field.
  11993. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  11994. * htt_tx_frag_desc64_bank_cfg_t structs.
  11995. */
  11996. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  11997. _paddr_bits_, \
  11998. _paddr__bank_base_address_) \
  11999. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  12000. /** word 0 \
  12001. * msg_type: 8, \
  12002. * pdev_id: 2, \
  12003. * swap: 1, \
  12004. * reserved0: 5, \
  12005. * num_banks: 8, \
  12006. * desc_size: 8; \
  12007. */ \
  12008. A_UINT32 word0; \
  12009. /* \
  12010. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12011. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12012. * the second A_UINT32). \
  12013. */ \
  12014. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12015. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12016. } POSTPACK
  12017. /* define htt_tx_frag_desc32_bank_cfg_t */
  12018. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12019. /* define htt_tx_frag_desc64_bank_cfg_t */
  12020. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12021. /*
  12022. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12023. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12024. */
  12025. #if HTT_PADDR64
  12026. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12027. #else
  12028. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12029. #endif
  12030. /**
  12031. * @brief target -> host HTT TX Credit total count update message definition
  12032. *
  12033. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12034. *
  12035. *|31 16|15|14 9| 8 |7 0 |
  12036. *|---------------------+--+----------+-------+----------|
  12037. *|cur htt credit delta | Q| reserved | sign | msg type |
  12038. *|------------------------------------------------------|
  12039. *
  12040. * Header fields:
  12041. * - MSG_TYPE
  12042. * Bits 7:0
  12043. * Purpose: identifies this as a htt tx credit delta update message
  12044. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12045. * - SIGN
  12046. * Bits 8
  12047. * identifies whether credit delta is positive or negative
  12048. * Value:
  12049. * - 0x0: credit delta is positive, rebalance in some buffers
  12050. * - 0x1: credit delta is negative, rebalance out some buffers
  12051. * - reserved
  12052. * Bits 14:9
  12053. * Value: 0x0
  12054. * - TXQ_GRP
  12055. * Bit 15
  12056. * Purpose: indicates whether any tx queue group information elements
  12057. * are appended to the tx credit update message
  12058. * Value: 0 -> no tx queue group information element is present
  12059. * 1 -> a tx queue group information element immediately follows
  12060. * - DELTA_COUNT
  12061. * Bits 31:16
  12062. * Purpose: Specify current htt credit delta absolute count
  12063. */
  12064. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12065. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12066. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12067. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12068. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12069. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12070. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12071. do { \
  12072. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12073. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12074. } while (0)
  12075. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12076. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12077. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12078. do { \
  12079. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12080. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12081. } while (0)
  12082. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12083. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12084. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12085. do { \
  12086. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12087. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12088. } while (0)
  12089. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12090. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12091. #define HTT_TX_CREDIT_MSG_BYTES 4
  12092. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12093. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12094. /**
  12095. * @brief HTT WDI_IPA Operation Response Message
  12096. *
  12097. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12098. *
  12099. * @details
  12100. * HTT WDI_IPA Operation Response message is sent by target
  12101. * to host confirming suspend or resume operation.
  12102. * |31 24|23 16|15 8|7 0|
  12103. * |----------------+----------------+----------------+----------------|
  12104. * | op_code | Rsvd | msg_type |
  12105. * |-------------------------------------------------------------------|
  12106. * | Rsvd | Response len |
  12107. * |-------------------------------------------------------------------|
  12108. * | |
  12109. * | Response-type specific info |
  12110. * | |
  12111. * | |
  12112. * |-------------------------------------------------------------------|
  12113. * Header fields:
  12114. * - MSG_TYPE
  12115. * Bits 7:0
  12116. * Purpose: Identifies this as WDI_IPA Operation Response message
  12117. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12118. * - OP_CODE
  12119. * Bits 31:16
  12120. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12121. * value: = enum htt_wdi_ipa_op_code
  12122. * - RSP_LEN
  12123. * Bits 16:0
  12124. * Purpose: length for the response-type specific info
  12125. * value: = length in bytes for response-type specific info
  12126. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12127. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12128. */
  12129. PREPACK struct htt_wdi_ipa_op_response_t
  12130. {
  12131. /* DWORD 0: flags and meta-data */
  12132. A_UINT32
  12133. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12134. reserved1: 8,
  12135. op_code: 16;
  12136. A_UINT32
  12137. rsp_len: 16,
  12138. reserved2: 16;
  12139. } POSTPACK;
  12140. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12141. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12142. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12143. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12144. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12145. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12146. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  12147. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  12148. do { \
  12149. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  12150. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  12151. } while (0)
  12152. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  12153. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  12154. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  12155. do { \
  12156. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  12157. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  12158. } while (0)
  12159. enum htt_phy_mode {
  12160. htt_phy_mode_11a = 0,
  12161. htt_phy_mode_11g = 1,
  12162. htt_phy_mode_11b = 2,
  12163. htt_phy_mode_11g_only = 3,
  12164. htt_phy_mode_11na_ht20 = 4,
  12165. htt_phy_mode_11ng_ht20 = 5,
  12166. htt_phy_mode_11na_ht40 = 6,
  12167. htt_phy_mode_11ng_ht40 = 7,
  12168. htt_phy_mode_11ac_vht20 = 8,
  12169. htt_phy_mode_11ac_vht40 = 9,
  12170. htt_phy_mode_11ac_vht80 = 10,
  12171. htt_phy_mode_11ac_vht20_2g = 11,
  12172. htt_phy_mode_11ac_vht40_2g = 12,
  12173. htt_phy_mode_11ac_vht80_2g = 13,
  12174. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  12175. htt_phy_mode_11ac_vht160 = 15,
  12176. htt_phy_mode_max,
  12177. };
  12178. /**
  12179. * @brief target -> host HTT channel change indication
  12180. *
  12181. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  12182. *
  12183. * @details
  12184. * Specify when a channel change occurs.
  12185. * This allows the host to precisely determine which rx frames arrived
  12186. * on the old channel and which rx frames arrived on the new channel.
  12187. *
  12188. *|31 |7 0 |
  12189. *|-------------------------------------------+----------|
  12190. *| reserved | msg type |
  12191. *|------------------------------------------------------|
  12192. *| primary_chan_center_freq_mhz |
  12193. *|------------------------------------------------------|
  12194. *| contiguous_chan1_center_freq_mhz |
  12195. *|------------------------------------------------------|
  12196. *| contiguous_chan2_center_freq_mhz |
  12197. *|------------------------------------------------------|
  12198. *| phy_mode |
  12199. *|------------------------------------------------------|
  12200. *
  12201. * Header fields:
  12202. * - MSG_TYPE
  12203. * Bits 7:0
  12204. * Purpose: identifies this as a htt channel change indication message
  12205. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  12206. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  12207. * Bits 31:0
  12208. * Purpose: identify the (center of the) new 20 MHz primary channel
  12209. * Value: center frequency of the 20 MHz primary channel, in MHz units
  12210. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  12211. * Bits 31:0
  12212. * Purpose: identify the (center of the) contiguous frequency range
  12213. * comprising the new channel.
  12214. * For example, if the new channel is a 80 MHz channel extending
  12215. * 60 MHz beyond the primary channel, this field would be 30 larger
  12216. * than the primary channel center frequency field.
  12217. * Value: center frequency of the contiguous frequency range comprising
  12218. * the full channel in MHz units
  12219. * (80+80 channels also use the CONTIG_CHAN2 field)
  12220. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  12221. * Bits 31:0
  12222. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  12223. * within a VHT 80+80 channel.
  12224. * This field is only relevant for VHT 80+80 channels.
  12225. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  12226. * channel (arbitrary value for cases besides VHT 80+80)
  12227. * - PHY_MODE
  12228. * Bits 31:0
  12229. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  12230. * and band
  12231. * Value: htt_phy_mode enum value
  12232. */
  12233. PREPACK struct htt_chan_change_t
  12234. {
  12235. /* DWORD 0: flags and meta-data */
  12236. A_UINT32
  12237. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12238. reserved1: 24;
  12239. A_UINT32 primary_chan_center_freq_mhz;
  12240. A_UINT32 contig_chan1_center_freq_mhz;
  12241. A_UINT32 contig_chan2_center_freq_mhz;
  12242. A_UINT32 phy_mode;
  12243. } POSTPACK;
  12244. /*
  12245. * Due to historical / backwards-compatibility reasons, maintain the
  12246. * below htt_chan_change_msg struct definition, which needs to be
  12247. * consistent with the above htt_chan_change_t struct definition
  12248. * (aside from the htt_chan_change_t definition including the msg_type
  12249. * dword within the message, and the htt_chan_change_msg only containing
  12250. * the payload of the message that follows the msg_type dword).
  12251. */
  12252. PREPACK struct htt_chan_change_msg {
  12253. A_UINT32 chan_mhz; /* frequency in mhz */
  12254. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  12255. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  12256. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  12257. } POSTPACK;
  12258. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  12259. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  12260. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  12261. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  12262. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  12263. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  12264. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  12265. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  12266. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  12267. do { \
  12268. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  12269. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  12270. } while (0)
  12271. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  12272. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  12273. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  12274. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  12275. do { \
  12276. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  12277. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  12278. } while (0)
  12279. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  12280. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  12281. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  12282. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  12283. do { \
  12284. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  12285. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  12286. } while (0)
  12287. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  12288. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  12289. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  12290. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  12291. do { \
  12292. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  12293. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  12294. } while (0)
  12295. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  12296. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  12297. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  12298. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  12299. /**
  12300. * @brief rx offload packet error message
  12301. *
  12302. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  12303. *
  12304. * @details
  12305. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  12306. * of target payload like mic err.
  12307. *
  12308. * |31 24|23 16|15 8|7 0|
  12309. * |----------------+----------------+----------------+----------------|
  12310. * | tid | vdev_id | msg_sub_type | msg_type |
  12311. * |-------------------------------------------------------------------|
  12312. * : (sub-type dependent content) :
  12313. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12314. * Header fields:
  12315. * - msg_type
  12316. * Bits 7:0
  12317. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  12318. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  12319. * - msg_sub_type
  12320. * Bits 15:8
  12321. * Purpose: Identifies which type of rx error is reported by this message
  12322. * value: htt_rx_ofld_pkt_err_type
  12323. * - vdev_id
  12324. * Bits 23:16
  12325. * Purpose: Identifies which vdev received the erroneous rx frame
  12326. * value:
  12327. * - tid
  12328. * Bits 31:24
  12329. * Purpose: Identifies the traffic type of the rx frame
  12330. * value:
  12331. *
  12332. * - The payload fields used if the sub-type == MIC error are shown below.
  12333. * Note - MIC err is per MSDU, while PN is per MPDU.
  12334. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  12335. * with MIC err in A-MSDU case, so FW will send only one HTT message
  12336. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  12337. * instead of sending separate HTT messages for each wrong MSDU within
  12338. * the MPDU.
  12339. *
  12340. * |31 24|23 16|15 8|7 0|
  12341. * |----------------+----------------+----------------+----------------|
  12342. * | Rsvd | key_id | peer_id |
  12343. * |-------------------------------------------------------------------|
  12344. * | receiver MAC addr 31:0 |
  12345. * |-------------------------------------------------------------------|
  12346. * | Rsvd | receiver MAC addr 47:32 |
  12347. * |-------------------------------------------------------------------|
  12348. * | transmitter MAC addr 31:0 |
  12349. * |-------------------------------------------------------------------|
  12350. * | Rsvd | transmitter MAC addr 47:32 |
  12351. * |-------------------------------------------------------------------|
  12352. * | PN 31:0 |
  12353. * |-------------------------------------------------------------------|
  12354. * | Rsvd | PN 47:32 |
  12355. * |-------------------------------------------------------------------|
  12356. * - peer_id
  12357. * Bits 15:0
  12358. * Purpose: identifies which peer is frame is from
  12359. * value:
  12360. * - key_id
  12361. * Bits 23:16
  12362. * Purpose: identifies key_id of rx frame
  12363. * value:
  12364. * - RA_31_0 (receiver MAC addr 31:0)
  12365. * Bits 31:0
  12366. * Purpose: identifies by MAC address which vdev received the frame
  12367. * value: MAC address lower 4 bytes
  12368. * - RA_47_32 (receiver MAC addr 47:32)
  12369. * Bits 15:0
  12370. * Purpose: identifies by MAC address which vdev received the frame
  12371. * value: MAC address upper 2 bytes
  12372. * - TA_31_0 (transmitter MAC addr 31:0)
  12373. * Bits 31:0
  12374. * Purpose: identifies by MAC address which peer transmitted the frame
  12375. * value: MAC address lower 4 bytes
  12376. * - TA_47_32 (transmitter MAC addr 47:32)
  12377. * Bits 15:0
  12378. * Purpose: identifies by MAC address which peer transmitted the frame
  12379. * value: MAC address upper 2 bytes
  12380. * - PN_31_0
  12381. * Bits 31:0
  12382. * Purpose: Identifies pn of rx frame
  12383. * value: PN lower 4 bytes
  12384. * - PN_47_32
  12385. * Bits 15:0
  12386. * Purpose: Identifies pn of rx frame
  12387. * value:
  12388. * TKIP or CCMP: PN upper 2 bytes
  12389. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  12390. */
  12391. enum htt_rx_ofld_pkt_err_type {
  12392. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  12393. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  12394. };
  12395. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  12396. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  12397. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  12398. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  12399. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  12400. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  12401. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  12402. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  12403. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  12404. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  12405. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  12406. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  12407. do { \
  12408. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  12409. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  12410. } while (0)
  12411. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  12412. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  12413. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  12414. do { \
  12415. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  12416. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  12417. } while (0)
  12418. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  12419. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  12420. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  12421. do { \
  12422. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  12423. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  12424. } while (0)
  12425. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  12426. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  12427. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  12428. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  12429. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  12430. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  12431. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  12432. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  12433. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  12434. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  12435. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  12436. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  12437. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  12438. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  12439. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  12440. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  12441. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  12442. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  12443. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  12444. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  12445. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  12446. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  12447. do { \
  12448. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  12449. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  12450. } while (0)
  12451. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  12452. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  12453. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  12454. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  12455. do { \
  12456. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  12457. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  12458. } while (0)
  12459. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  12460. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  12461. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  12462. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  12463. do { \
  12464. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  12465. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  12466. } while (0)
  12467. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  12468. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  12469. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  12470. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  12471. do { \
  12472. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  12473. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  12474. } while (0)
  12475. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  12476. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  12477. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  12478. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  12479. do { \
  12480. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  12481. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  12482. } while (0)
  12483. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  12484. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  12485. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  12486. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  12487. do { \
  12488. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  12489. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  12490. } while (0)
  12491. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  12492. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  12493. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  12494. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  12495. do { \
  12496. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  12497. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  12498. } while (0)
  12499. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  12500. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  12501. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  12502. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  12503. do { \
  12504. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  12505. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  12506. } while (0)
  12507. /**
  12508. * @brief target -> host peer rate report message
  12509. *
  12510. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  12511. *
  12512. * @details
  12513. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  12514. * justified rate of all the peers.
  12515. *
  12516. * |31 24|23 16|15 8|7 0|
  12517. * |----------------+----------------+----------------+----------------|
  12518. * | peer_count | | msg_type |
  12519. * |-------------------------------------------------------------------|
  12520. * : Payload (variant number of peer rate report) :
  12521. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  12522. * Header fields:
  12523. * - msg_type
  12524. * Bits 7:0
  12525. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  12526. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  12527. * - reserved
  12528. * Bits 15:8
  12529. * Purpose:
  12530. * value:
  12531. * - peer_count
  12532. * Bits 31:16
  12533. * Purpose: Specify how many peer rate report elements are present in the payload.
  12534. * value:
  12535. *
  12536. * Payload:
  12537. * There are variant number of peer rate report follow the first 32 bits.
  12538. * The peer rate report is defined as follows.
  12539. *
  12540. * |31 20|19 16|15 0|
  12541. * |-----------------------+---------+---------------------------------|-
  12542. * | reserved | phy | peer_id | \
  12543. * |-------------------------------------------------------------------| -> report #0
  12544. * | rate | /
  12545. * |-----------------------+---------+---------------------------------|-
  12546. * | reserved | phy | peer_id | \
  12547. * |-------------------------------------------------------------------| -> report #1
  12548. * | rate | /
  12549. * |-----------------------+---------+---------------------------------|-
  12550. * | reserved | phy | peer_id | \
  12551. * |-------------------------------------------------------------------| -> report #2
  12552. * | rate | /
  12553. * |-------------------------------------------------------------------|-
  12554. * : :
  12555. * : :
  12556. * : :
  12557. * :-------------------------------------------------------------------:
  12558. *
  12559. * - peer_id
  12560. * Bits 15:0
  12561. * Purpose: identify the peer
  12562. * value:
  12563. * - phy
  12564. * Bits 19:16
  12565. * Purpose: identify which phy is in use
  12566. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  12567. * Please see enum htt_peer_report_phy_type for detail.
  12568. * - reserved
  12569. * Bits 31:20
  12570. * Purpose:
  12571. * value:
  12572. * - rate
  12573. * Bits 31:0
  12574. * Purpose: represent the justified rate of the peer specified by peer_id
  12575. * value:
  12576. */
  12577. enum htt_peer_rate_report_phy_type {
  12578. HTT_PEER_RATE_REPORT_11B = 0,
  12579. HTT_PEER_RATE_REPORT_11A_G,
  12580. HTT_PEER_RATE_REPORT_11N,
  12581. HTT_PEER_RATE_REPORT_11AC,
  12582. };
  12583. #define HTT_PEER_RATE_REPORT_SIZE 8
  12584. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  12585. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  12586. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  12587. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  12588. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  12589. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  12590. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  12591. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  12592. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  12593. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  12594. do { \
  12595. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  12596. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  12597. } while (0)
  12598. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  12599. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  12600. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  12601. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  12602. do { \
  12603. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  12604. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  12605. } while (0)
  12606. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  12607. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  12608. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  12609. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  12610. do { \
  12611. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  12612. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  12613. } while (0)
  12614. /**
  12615. * @brief target -> host flow pool map message
  12616. *
  12617. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  12618. *
  12619. * @details
  12620. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  12621. * a flow of descriptors.
  12622. *
  12623. * This message is in TLV format and indicates the parameters to be setup a
  12624. * flow in the host. Each entry indicates that a particular flow ID is ready to
  12625. * receive descriptors from a specified pool.
  12626. *
  12627. * The message would appear as follows:
  12628. *
  12629. * |31 24|23 16|15 8|7 0|
  12630. * |----------------+----------------+----------------+----------------|
  12631. * header | reserved | num_flows | msg_type |
  12632. * |-------------------------------------------------------------------|
  12633. * | |
  12634. * : payload :
  12635. * | |
  12636. * |-------------------------------------------------------------------|
  12637. *
  12638. * The header field is one DWORD long and is interpreted as follows:
  12639. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  12640. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  12641. * this message
  12642. * b'16-31 - reserved: These bits are reserved for future use
  12643. *
  12644. * Payload:
  12645. * The payload would contain multiple objects of the following structure. Each
  12646. * object represents a flow.
  12647. *
  12648. * |31 24|23 16|15 8|7 0|
  12649. * |----------------+----------------+----------------+----------------|
  12650. * header | reserved | num_flows | msg_type |
  12651. * |-------------------------------------------------------------------|
  12652. * payload0| flow_type |
  12653. * |-------------------------------------------------------------------|
  12654. * | flow_id |
  12655. * |-------------------------------------------------------------------|
  12656. * | reserved0 | flow_pool_id |
  12657. * |-------------------------------------------------------------------|
  12658. * | reserved1 | flow_pool_size |
  12659. * |-------------------------------------------------------------------|
  12660. * | reserved2 |
  12661. * |-------------------------------------------------------------------|
  12662. * payload1| flow_type |
  12663. * |-------------------------------------------------------------------|
  12664. * | flow_id |
  12665. * |-------------------------------------------------------------------|
  12666. * | reserved0 | flow_pool_id |
  12667. * |-------------------------------------------------------------------|
  12668. * | reserved1 | flow_pool_size |
  12669. * |-------------------------------------------------------------------|
  12670. * | reserved2 |
  12671. * |-------------------------------------------------------------------|
  12672. * | . |
  12673. * | . |
  12674. * | . |
  12675. * |-------------------------------------------------------------------|
  12676. *
  12677. * Each payload is 5 DWORDS long and is interpreted as follows:
  12678. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  12679. * this flow is associated. It can be VDEV, peer,
  12680. * or tid (AC). Based on enum htt_flow_type.
  12681. *
  12682. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12683. * object. For flow_type vdev it is set to the
  12684. * vdevid, for peer it is peerid and for tid, it is
  12685. * tid_num.
  12686. *
  12687. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  12688. * in the host for this flow
  12689. * b'16:31 - reserved0: This field in reserved for the future. In case
  12690. * we have a hierarchical implementation (HCM) of
  12691. * pools, it can be used to indicate the ID of the
  12692. * parent-pool.
  12693. *
  12694. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  12695. * Descriptors for this flow will be
  12696. * allocated from this pool in the host.
  12697. * b'16:31 - reserved1: This field in reserved for the future. In case
  12698. * we have a hierarchical implementation of pools,
  12699. * it can be used to indicate the max number of
  12700. * descriptors in the pool. The b'0:15 can be used
  12701. * to indicate min number of descriptors in the
  12702. * HCM scheme.
  12703. *
  12704. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  12705. * we have a hierarchical implementation of pools,
  12706. * b'0:15 can be used to indicate the
  12707. * priority-based borrowing (PBB) threshold of
  12708. * the flow's pool. The b'16:31 are still left
  12709. * reserved.
  12710. */
  12711. enum htt_flow_type {
  12712. FLOW_TYPE_VDEV = 0,
  12713. /* Insert new flow types above this line */
  12714. };
  12715. PREPACK struct htt_flow_pool_map_payload_t {
  12716. A_UINT32 flow_type;
  12717. A_UINT32 flow_id;
  12718. A_UINT32 flow_pool_id:16,
  12719. reserved0:16;
  12720. A_UINT32 flow_pool_size:16,
  12721. reserved1:16;
  12722. A_UINT32 reserved2;
  12723. } POSTPACK;
  12724. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  12725. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  12726. (sizeof(struct htt_flow_pool_map_payload_t))
  12727. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  12728. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  12729. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  12730. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  12731. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  12732. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  12733. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  12734. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  12735. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  12736. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  12737. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  12738. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  12739. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  12740. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  12741. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  12742. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  12743. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  12744. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  12745. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  12746. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  12747. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  12748. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  12749. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  12750. do { \
  12751. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  12752. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  12753. } while (0)
  12754. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  12755. do { \
  12756. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  12757. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  12758. } while (0)
  12759. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  12760. do { \
  12761. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  12762. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  12763. } while (0)
  12764. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  12765. do { \
  12766. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  12767. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  12768. } while (0)
  12769. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  12770. do { \
  12771. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  12772. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  12773. } while (0)
  12774. /**
  12775. * @brief target -> host flow pool unmap message
  12776. *
  12777. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  12778. *
  12779. * @details
  12780. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  12781. * down a flow of descriptors.
  12782. * This message indicates that for the flow (whose ID is provided) is wanting
  12783. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  12784. * pool of descriptors from where descriptors are being allocated for this
  12785. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  12786. * be unmapped by the host.
  12787. *
  12788. * The message would appear as follows:
  12789. *
  12790. * |31 24|23 16|15 8|7 0|
  12791. * |----------------+----------------+----------------+----------------|
  12792. * | reserved0 | msg_type |
  12793. * |-------------------------------------------------------------------|
  12794. * | flow_type |
  12795. * |-------------------------------------------------------------------|
  12796. * | flow_id |
  12797. * |-------------------------------------------------------------------|
  12798. * | reserved1 | flow_pool_id |
  12799. * |-------------------------------------------------------------------|
  12800. *
  12801. * The message is interpreted as follows:
  12802. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  12803. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  12804. * b'8:31 - reserved0: Reserved for future use
  12805. *
  12806. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  12807. * this flow is associated. It can be VDEV, peer,
  12808. * or tid (AC). Based on enum htt_flow_type.
  12809. *
  12810. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  12811. * object. For flow_type vdev it is set to the
  12812. * vdevid, for peer it is peerid and for tid, it is
  12813. * tid_num.
  12814. *
  12815. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  12816. * used in the host for this flow
  12817. * b'16:31 - reserved0: This field in reserved for the future.
  12818. *
  12819. */
  12820. PREPACK struct htt_flow_pool_unmap_t {
  12821. A_UINT32 msg_type:8,
  12822. reserved0:24;
  12823. A_UINT32 flow_type;
  12824. A_UINT32 flow_id;
  12825. A_UINT32 flow_pool_id:16,
  12826. reserved1:16;
  12827. } POSTPACK;
  12828. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  12829. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  12830. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  12831. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  12832. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  12833. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  12834. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  12835. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  12836. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  12837. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  12838. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  12839. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  12840. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  12841. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  12842. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  12843. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  12844. do { \
  12845. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  12846. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  12847. } while (0)
  12848. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  12849. do { \
  12850. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  12851. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  12852. } while (0)
  12853. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  12854. do { \
  12855. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  12856. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  12857. } while (0)
  12858. /**
  12859. * @brief target -> host SRING setup done message
  12860. *
  12861. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  12862. *
  12863. * @details
  12864. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  12865. * SRNG ring setup is done
  12866. *
  12867. * This message indicates whether the last setup operation is successful.
  12868. * It will be sent to host when host set respose_required bit in
  12869. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  12870. * The message would appear as follows:
  12871. *
  12872. * |31 24|23 16|15 8|7 0|
  12873. * |--------------- +----------------+----------------+----------------|
  12874. * | setup_status | ring_id | pdev_id | msg_type |
  12875. * |-------------------------------------------------------------------|
  12876. *
  12877. * The message is interpreted as follows:
  12878. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  12879. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  12880. * b'8:15 - pdev_id:
  12881. * 0 (for rings at SOC/UMAC level),
  12882. * 1/2/3 mac id (for rings at LMAC level)
  12883. * b'16:23 - ring_id: Identify the ring which is set up
  12884. * More details can be got from enum htt_srng_ring_id
  12885. * b'24:31 - setup_status: Indicate status of setup operation
  12886. * Refer to htt_ring_setup_status
  12887. */
  12888. PREPACK struct htt_sring_setup_done_t {
  12889. A_UINT32 msg_type: 8,
  12890. pdev_id: 8,
  12891. ring_id: 8,
  12892. setup_status: 8;
  12893. } POSTPACK;
  12894. enum htt_ring_setup_status {
  12895. htt_ring_setup_status_ok = 0,
  12896. htt_ring_setup_status_error,
  12897. };
  12898. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  12899. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  12900. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  12901. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  12902. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  12903. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  12904. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  12905. do { \
  12906. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  12907. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  12908. } while (0)
  12909. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  12910. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  12911. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  12912. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  12913. HTT_SRING_SETUP_DONE_RING_ID_S)
  12914. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  12915. do { \
  12916. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  12917. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  12918. } while (0)
  12919. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  12920. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  12921. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  12922. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  12923. HTT_SRING_SETUP_DONE_STATUS_S)
  12924. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  12925. do { \
  12926. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  12927. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  12928. } while (0)
  12929. /**
  12930. * @brief target -> flow map flow info
  12931. *
  12932. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  12933. *
  12934. * @details
  12935. * HTT TX map flow entry with tqm flow pointer
  12936. * Sent from firmware to host to add tqm flow pointer in corresponding
  12937. * flow search entry. Flow metadata is replayed back to host as part of this
  12938. * struct to enable host to find the specific flow search entry
  12939. *
  12940. * The message would appear as follows:
  12941. *
  12942. * |31 28|27 18|17 14|13 8|7 0|
  12943. * |-------+------------------------------------------+----------------|
  12944. * | rsvd0 | fse_hsh_idx | msg_type |
  12945. * |-------------------------------------------------------------------|
  12946. * | rsvd1 | tid | peer_id |
  12947. * |-------------------------------------------------------------------|
  12948. * | tqm_flow_pntr_lo |
  12949. * |-------------------------------------------------------------------|
  12950. * | tqm_flow_pntr_hi |
  12951. * |-------------------------------------------------------------------|
  12952. * | fse_meta_data |
  12953. * |-------------------------------------------------------------------|
  12954. *
  12955. * The message is interpreted as follows:
  12956. *
  12957. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  12958. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  12959. *
  12960. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  12961. * for this flow entry
  12962. *
  12963. * dword0 - b'28:31 - rsvd0: Reserved for future use
  12964. *
  12965. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  12966. *
  12967. * dword1 - b'14:17 - tid
  12968. *
  12969. * dword1 - b'18:31 - rsvd1: Reserved for future use
  12970. *
  12971. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  12972. *
  12973. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  12974. *
  12975. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  12976. * given by host
  12977. */
  12978. PREPACK struct htt_tx_map_flow_info {
  12979. A_UINT32
  12980. msg_type: 8,
  12981. fse_hsh_idx: 20,
  12982. rsvd0: 4;
  12983. A_UINT32
  12984. peer_id: 14,
  12985. tid: 4,
  12986. rsvd1: 14;
  12987. A_UINT32 tqm_flow_pntr_lo;
  12988. A_UINT32 tqm_flow_pntr_hi;
  12989. struct htt_tx_flow_metadata fse_meta_data;
  12990. } POSTPACK;
  12991. /* DWORD 0 */
  12992. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  12993. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  12994. /* DWORD 1 */
  12995. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  12996. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  12997. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  12998. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  12999. /* DWORD 0 */
  13000. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  13001. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  13002. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  13003. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  13004. do { \
  13005. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13006. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13007. } while (0)
  13008. /* DWORD 1 */
  13009. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13010. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13011. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13012. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13013. do { \
  13014. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13015. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13016. } while (0)
  13017. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13018. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13019. HTT_TX_MAP_FLOW_INFO_TID_S)
  13020. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13021. do { \
  13022. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13023. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13024. } while (0)
  13025. /*
  13026. * htt_dbg_ext_stats_status -
  13027. * present - The requested stats have been delivered in full.
  13028. * This indicates that either the stats information was contained
  13029. * in its entirety within this message, or else this message
  13030. * completes the delivery of the requested stats info that was
  13031. * partially delivered through earlier STATS_CONF messages.
  13032. * partial - The requested stats have been delivered in part.
  13033. * One or more subsequent STATS_CONF messages with the same
  13034. * cookie value will be sent to deliver the remainder of the
  13035. * information.
  13036. * error - The requested stats could not be delivered, for example due
  13037. * to a shortage of memory to construct a message holding the
  13038. * requested stats.
  13039. * invalid - The requested stat type is either not recognized, or the
  13040. * target is configured to not gather the stats type in question.
  13041. */
  13042. enum htt_dbg_ext_stats_status {
  13043. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13044. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13045. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13046. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13047. };
  13048. /**
  13049. * @brief target -> host ppdu stats upload
  13050. *
  13051. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13052. *
  13053. * @details
  13054. * The following field definitions describe the format of the HTT target
  13055. * to host ppdu stats indication message.
  13056. *
  13057. *
  13058. * |31 16|15 12|11 10|9 8|7 0 |
  13059. * |----------------------------------------------------------------------|
  13060. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13061. * |----------------------------------------------------------------------|
  13062. * | ppdu_id |
  13063. * |----------------------------------------------------------------------|
  13064. * | Timestamp in us |
  13065. * |----------------------------------------------------------------------|
  13066. * | reserved |
  13067. * |----------------------------------------------------------------------|
  13068. * | type-specific stats info |
  13069. * | (see htt_ppdu_stats.h) |
  13070. * |----------------------------------------------------------------------|
  13071. * Header fields:
  13072. * - MSG_TYPE
  13073. * Bits 7:0
  13074. * Purpose: Identifies this is a PPDU STATS indication
  13075. * message.
  13076. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13077. * - mac_id
  13078. * Bits 9:8
  13079. * Purpose: mac_id of this ppdu_id
  13080. * Value: 0-3
  13081. * - pdev_id
  13082. * Bits 11:10
  13083. * Purpose: pdev_id of this ppdu_id
  13084. * Value: 0-3
  13085. * 0 (for rings at SOC level),
  13086. * 1/2/3 PDEV -> 0/1/2
  13087. * - payload_size
  13088. * Bits 31:16
  13089. * Purpose: total tlv size
  13090. * Value: payload_size in bytes
  13091. */
  13092. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13093. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13094. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13095. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13096. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13097. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13098. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13099. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13100. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13101. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13102. do { \
  13103. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13104. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13105. } while (0)
  13106. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13107. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13108. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13109. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13110. do { \
  13111. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13112. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13113. } while (0)
  13114. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13115. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13116. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13117. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13118. do { \
  13119. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13120. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13121. } while (0)
  13122. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13123. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13124. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13125. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13126. do { \
  13127. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13128. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13129. } while (0)
  13130. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13131. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13132. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13133. /* htt_t2h_ppdu_stats_ind_hdr_t
  13134. * This struct contains the fields within the header of the
  13135. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13136. * stats info.
  13137. * This struct assumes little-endian layout, and thus is only
  13138. * suitable for use within processors known to be little-endian
  13139. * (such as the target).
  13140. * In contrast, the above macros provide endian-portable methods
  13141. * to get and set the bitfields within this PPDU_STATS_IND header.
  13142. */
  13143. typedef struct {
  13144. A_UINT32 msg_type: 8, /* bits 7:0 */
  13145. mac_id: 2, /* bits 9:8 */
  13146. pdev_id: 2, /* bits 11:10 */
  13147. reserved1: 4, /* bits 15:12 */
  13148. payload_size: 16; /* bits 31:16 */
  13149. A_UINT32 ppdu_id;
  13150. A_UINT32 timestamp_us;
  13151. A_UINT32 reserved2;
  13152. } htt_t2h_ppdu_stats_ind_hdr_t;
  13153. /**
  13154. * @brief target -> host extended statistics upload
  13155. *
  13156. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  13157. *
  13158. * @details
  13159. * The following field definitions describe the format of the HTT target
  13160. * to host stats upload confirmation message.
  13161. * The message contains a cookie echoed from the HTT host->target stats
  13162. * upload request, which identifies which request the confirmation is
  13163. * for, and a single stats can span over multiple HTT stats indication
  13164. * due to the HTT message size limitation so every HTT ext stats indication
  13165. * will have tag-length-value stats information elements.
  13166. * The tag-length header for each HTT stats IND message also includes a
  13167. * status field, to indicate whether the request for the stat type in
  13168. * question was fully met, partially met, unable to be met, or invalid
  13169. * (if the stat type in question is disabled in the target).
  13170. * A Done bit 1's indicate the end of the of stats info elements.
  13171. *
  13172. *
  13173. * |31 16|15 12|11|10 8|7 5|4 0|
  13174. * |--------------------------------------------------------------|
  13175. * | reserved | msg type |
  13176. * |--------------------------------------------------------------|
  13177. * | cookie LSBs |
  13178. * |--------------------------------------------------------------|
  13179. * | cookie MSBs |
  13180. * |--------------------------------------------------------------|
  13181. * | stats entry length | rsvd | D| S | stat type |
  13182. * |--------------------------------------------------------------|
  13183. * | type-specific stats info |
  13184. * | (see htt_stats.h) |
  13185. * |--------------------------------------------------------------|
  13186. * Header fields:
  13187. * - MSG_TYPE
  13188. * Bits 7:0
  13189. * Purpose: Identifies this is a extended statistics upload confirmation
  13190. * message.
  13191. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  13192. * - COOKIE_LSBS
  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: LSBs of the opaque cookie specified by the host-side requestor
  13197. * - COOKIE_MSBS
  13198. * Bits 31:0
  13199. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13200. * message with its preceding host->target stats request message.
  13201. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13202. *
  13203. * Stats Information Element tag-length header fields:
  13204. * - STAT_TYPE
  13205. * Bits 7:0
  13206. * Purpose: identifies the type of statistics info held in the
  13207. * following information element
  13208. * Value: htt_dbg_ext_stats_type
  13209. * - STATUS
  13210. * Bits 10:8
  13211. * Purpose: indicate whether the requested stats are present
  13212. * Value: htt_dbg_ext_stats_status
  13213. * - DONE
  13214. * Bits 11
  13215. * Purpose:
  13216. * Indicates the completion of the stats entry, this will be the last
  13217. * stats conf HTT segment for the requested stats type.
  13218. * Value:
  13219. * 0 -> the stats retrieval is ongoing
  13220. * 1 -> the stats retrieval is complete
  13221. * - LENGTH
  13222. * Bits 31:16
  13223. * Purpose: indicate the stats information size
  13224. * Value: This field specifies the number of bytes of stats information
  13225. * that follows the element tag-length header.
  13226. * It is expected but not required that this length is a multiple of
  13227. * 4 bytes.
  13228. */
  13229. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  13230. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  13231. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  13232. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  13233. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  13234. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  13235. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  13236. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  13237. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  13238. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13239. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  13240. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  13241. do { \
  13242. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  13243. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  13244. } while (0)
  13245. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  13246. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  13247. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  13248. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  13249. do { \
  13250. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  13251. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  13252. } while (0)
  13253. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  13254. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  13255. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  13256. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  13257. do { \
  13258. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  13259. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  13260. } while (0)
  13261. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  13262. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  13263. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  13264. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13265. do { \
  13266. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  13267. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  13268. } while (0)
  13269. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  13270. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  13271. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  13272. typedef enum {
  13273. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  13274. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  13275. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  13276. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  13277. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  13278. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  13279. /* Reserved from 128 - 255 for target internal use.*/
  13280. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  13281. } HTT_PEER_TYPE;
  13282. /** macro to convert MAC address from char array to HTT word format */
  13283. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  13284. (phtt_mac_addr)->mac_addr31to0 = \
  13285. (((c_macaddr)[0] << 0) | \
  13286. ((c_macaddr)[1] << 8) | \
  13287. ((c_macaddr)[2] << 16) | \
  13288. ((c_macaddr)[3] << 24)); \
  13289. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  13290. } while (0)
  13291. /**
  13292. * @brief target -> host monitor mac header indication message
  13293. *
  13294. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  13295. *
  13296. * @details
  13297. * The following diagram shows the format of the monitor mac header message
  13298. * sent from the target to the host.
  13299. * This message is primarily sent when promiscuous rx mode is enabled.
  13300. * One message is sent per rx PPDU.
  13301. *
  13302. * |31 24|23 16|15 8|7 0|
  13303. * |-------------------------------------------------------------|
  13304. * | peer_id | reserved0 | msg_type |
  13305. * |-------------------------------------------------------------|
  13306. * | reserved1 | num_mpdu |
  13307. * |-------------------------------------------------------------|
  13308. * | struct hw_rx_desc |
  13309. * | (see wal_rx_desc.h) |
  13310. * |-------------------------------------------------------------|
  13311. * | struct ieee80211_frame_addr4 |
  13312. * | (see ieee80211_defs.h) |
  13313. * |-------------------------------------------------------------|
  13314. * | struct ieee80211_frame_addr4 |
  13315. * | (see ieee80211_defs.h) |
  13316. * |-------------------------------------------------------------|
  13317. * | ...... |
  13318. * |-------------------------------------------------------------|
  13319. *
  13320. * Header fields:
  13321. * - msg_type
  13322. * Bits 7:0
  13323. * Purpose: Identifies this is a monitor mac header indication message.
  13324. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  13325. * - peer_id
  13326. * Bits 31:16
  13327. * Purpose: Software peer id given by host during association,
  13328. * During promiscuous mode, the peer ID will be invalid (0xFF)
  13329. * for rx PPDUs received from unassociated peers.
  13330. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  13331. * - num_mpdu
  13332. * Bits 15:0
  13333. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  13334. * delivered within the message.
  13335. * Value: 1 to 32
  13336. * num_mpdu is limited to a maximum value of 32, due to buffer
  13337. * size limits. For PPDUs with more than 32 MPDUs, only the
  13338. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  13339. * the PPDU will be provided.
  13340. */
  13341. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  13342. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  13343. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  13344. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  13345. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  13346. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  13347. do { \
  13348. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  13349. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  13350. } while (0)
  13351. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  13352. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  13353. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  13354. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  13355. do { \
  13356. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  13357. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  13358. } while (0)
  13359. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  13360. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  13361. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  13362. /**
  13363. * @brief target -> host flow pool resize Message
  13364. *
  13365. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  13366. *
  13367. * @details
  13368. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  13369. * the flow pool associated with the specified ID is resized
  13370. *
  13371. * The message would appear as follows:
  13372. *
  13373. * |31 16|15 8|7 0|
  13374. * |---------------------------------+----------------+----------------|
  13375. * | reserved0 | Msg type |
  13376. * |-------------------------------------------------------------------|
  13377. * | flow pool new size | flow pool ID |
  13378. * |-------------------------------------------------------------------|
  13379. *
  13380. * The message is interpreted as follows:
  13381. * b'0:7 - msg_type: This will be set to 0x21
  13382. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  13383. *
  13384. * b'0:15 - flow pool ID: Existing flow pool ID
  13385. *
  13386. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  13387. *
  13388. */
  13389. PREPACK struct htt_flow_pool_resize_t {
  13390. A_UINT32 msg_type:8,
  13391. reserved0:24;
  13392. A_UINT32 flow_pool_id:16,
  13393. flow_pool_new_size:16;
  13394. } POSTPACK;
  13395. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  13396. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  13397. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  13398. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  13399. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  13400. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  13401. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  13402. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  13403. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  13404. do { \
  13405. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  13406. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  13407. } while (0)
  13408. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  13409. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  13410. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  13411. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  13412. do { \
  13413. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  13414. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  13415. } while (0)
  13416. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  13417. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  13418. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  13419. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  13420. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  13421. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  13422. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  13423. /*
  13424. * The read and write indices point to the data within the host buffer.
  13425. * Because the first 4 bytes of the host buffer is used for the read index and
  13426. * the next 4 bytes for the write index, the data itself starts at offset 8.
  13427. * The read index and write index are the byte offsets from the base of the
  13428. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  13429. * Refer the ASCII text picture below.
  13430. */
  13431. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  13432. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  13433. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  13434. /*
  13435. ***************************************************************************
  13436. *
  13437. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13438. *
  13439. ***************************************************************************
  13440. *
  13441. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  13442. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  13443. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  13444. * written into the Host memory region mentioned below.
  13445. *
  13446. * Read index is updated by the Host. At any point of time, the read index will
  13447. * indicate the index that will next be read by the Host. The read index is
  13448. * in units of bytes offset from the base of the meta-data buffer.
  13449. *
  13450. * Write index is updated by the FW. At any point of time, the write index will
  13451. * indicate from where the FW can start writing any new data. The write index is
  13452. * in units of bytes offset from the base of the meta-data buffer.
  13453. *
  13454. * If the Host is not fast enough in reading the CFR data, any new capture data
  13455. * would be dropped if there is no space left to write the new captures.
  13456. *
  13457. * The last 4 bytes of the memory region will have the magic pattern
  13458. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  13459. * not overrun the host buffer.
  13460. *
  13461. * ,--------------------. read and write indices store the
  13462. * | | byte offset from the base of the
  13463. * | ,--------+--------. meta-data buffer to the next
  13464. * | | | | location within the data buffer
  13465. * | | v v that will be read / written
  13466. * ************************************************************************
  13467. * * Read * Write * * Magic *
  13468. * * index * index * CFR data1 ...... CFR data N * pattern *
  13469. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  13470. * ************************************************************************
  13471. * |<---------- data buffer ---------->|
  13472. *
  13473. * |<----------------- meta-data buffer allocated in Host ----------------|
  13474. *
  13475. * Note:
  13476. * - Considering the 4 bytes needed to store the Read index (R) and the
  13477. * Write index (W), the initial value is as follows:
  13478. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  13479. * - Buffer empty condition:
  13480. * R = W
  13481. *
  13482. * Regarding CFR data format:
  13483. * --------------------------
  13484. *
  13485. * Each CFR tone is stored in HW as 16-bits with the following format:
  13486. * {bits[15:12], bits[11:6], bits[5:0]} =
  13487. * {unsigned exponent (4 bits),
  13488. * signed mantissa_real (6 bits),
  13489. * signed mantissa_imag (6 bits)}
  13490. *
  13491. * CFR_real = mantissa_real * 2^(exponent-5)
  13492. * CFR_imag = mantissa_imag * 2^(exponent-5)
  13493. *
  13494. *
  13495. * The CFR data is written to the 16-bit unsigned output array (buff) in
  13496. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  13497. *
  13498. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  13499. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  13500. * .
  13501. * .
  13502. * .
  13503. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  13504. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  13505. */
  13506. /* Bandwidth of peer CFR captures */
  13507. typedef enum {
  13508. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  13509. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  13510. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  13511. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  13512. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  13513. HTT_PEER_CFR_CAPTURE_BW_MAX,
  13514. } HTT_PEER_CFR_CAPTURE_BW;
  13515. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  13516. * was captured
  13517. */
  13518. typedef enum {
  13519. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  13520. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  13521. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  13522. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  13523. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  13524. } HTT_PEER_CFR_CAPTURE_MODE;
  13525. typedef enum {
  13526. /* This message type is currently used for the below purpose:
  13527. *
  13528. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  13529. * wmi_peer_cfr_capture_cmd.
  13530. * If payload_present bit is set to 0 then the associated memory region
  13531. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  13532. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  13533. * message; the CFR dump will be present at the end of the message,
  13534. * after the chan_phy_mode.
  13535. */
  13536. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  13537. /* Always keep this last */
  13538. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  13539. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  13540. /**
  13541. * @brief target -> host CFR dump completion indication message definition
  13542. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  13543. *
  13544. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  13545. *
  13546. * @details
  13547. * The following diagram shows the format of the Channel Frequency Response
  13548. * (CFR) dump completion indication. This inidcation is sent to the Host when
  13549. * the channel capture of a peer is copied by Firmware into the Host memory
  13550. *
  13551. * **************************************************************************
  13552. *
  13553. * Message format when the CFR capture message type is
  13554. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  13555. *
  13556. * **************************************************************************
  13557. *
  13558. * |31 16|15 |8|7 0|
  13559. * |----------------------------------------------------------------|
  13560. * header: | reserved |P| msg_type |
  13561. * word 0 | | | |
  13562. * |----------------------------------------------------------------|
  13563. * payload: | cfr_capture_msg_type |
  13564. * word 1 | |
  13565. * |----------------------------------------------------------------|
  13566. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  13567. * word 2 | | | | | | | | |
  13568. * |----------------------------------------------------------------|
  13569. * | mac_addr31to0 |
  13570. * word 3 | |
  13571. * |----------------------------------------------------------------|
  13572. * | unused / reserved | mac_addr47to32 |
  13573. * word 4 | | |
  13574. * |----------------------------------------------------------------|
  13575. * | index |
  13576. * word 5 | |
  13577. * |----------------------------------------------------------------|
  13578. * | length |
  13579. * word 6 | |
  13580. * |----------------------------------------------------------------|
  13581. * | timestamp |
  13582. * word 7 | |
  13583. * |----------------------------------------------------------------|
  13584. * | counter |
  13585. * word 8 | |
  13586. * |----------------------------------------------------------------|
  13587. * | chan_mhz |
  13588. * word 9 | |
  13589. * |----------------------------------------------------------------|
  13590. * | band_center_freq1 |
  13591. * word 10 | |
  13592. * |----------------------------------------------------------------|
  13593. * | band_center_freq2 |
  13594. * word 11 | |
  13595. * |----------------------------------------------------------------|
  13596. * | chan_phy_mode |
  13597. * word 12 | |
  13598. * |----------------------------------------------------------------|
  13599. * where,
  13600. * P - payload present bit (payload_present explained below)
  13601. * req_id - memory request id (mem_req_id explained below)
  13602. * S - status field (status explained below)
  13603. * capbw - capture bandwidth (capture_bw explained below)
  13604. * mode - mode of capture (mode explained below)
  13605. * sts - space time streams (sts_count explained below)
  13606. * chbw - channel bandwidth (channel_bw explained below)
  13607. * captype - capture type (cap_type explained below)
  13608. *
  13609. * The following field definitions describe the format of the CFR dump
  13610. * completion indication sent from the target to the host
  13611. *
  13612. * Header fields:
  13613. *
  13614. * Word 0
  13615. * - msg_type
  13616. * Bits 7:0
  13617. * Purpose: Identifies this as CFR TX completion indication
  13618. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  13619. * - payload_present
  13620. * Bit 8
  13621. * Purpose: Identifies how CFR data is sent to host
  13622. * Value: 0 - If CFR Payload is written to host memory
  13623. * 1 - If CFR Payload is sent as part of HTT message
  13624. * (This is the requirement for SDIO/USB where it is
  13625. * not possible to write CFR data to host memory)
  13626. * - reserved
  13627. * Bits 31:9
  13628. * Purpose: Reserved
  13629. * Value: 0
  13630. *
  13631. * Payload fields:
  13632. *
  13633. * Word 1
  13634. * - cfr_capture_msg_type
  13635. * Bits 31:0
  13636. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  13637. * to specify the format used for the remainder of the message
  13638. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13639. * (currently only MSG_TYPE_1 is defined)
  13640. *
  13641. * Word 2
  13642. * - mem_req_id
  13643. * Bits 6:0
  13644. * Purpose: Contain the mem request id of the region where the CFR capture
  13645. * has been stored - of type WMI_HOST_MEM_REQ_ID
  13646. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  13647. this value is invalid)
  13648. * - status
  13649. * Bit 7
  13650. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  13651. * Value: 1 (True) - Successful; 0 (False) - Not successful
  13652. * - capture_bw
  13653. * Bits 10:8
  13654. * Purpose: Carry the bandwidth of the CFR capture
  13655. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  13656. * - mode
  13657. * Bits 13:11
  13658. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  13659. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  13660. * - sts_count
  13661. * Bits 16:14
  13662. * Purpose: Carry the number of space time streams
  13663. * Value: Number of space time streams
  13664. * - channel_bw
  13665. * Bits 19:17
  13666. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  13667. * measurement
  13668. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  13669. * - cap_type
  13670. * Bits 23:20
  13671. * Purpose: Carry the type of the capture
  13672. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  13673. * - vdev_id
  13674. * Bits 31:24
  13675. * Purpose: Carry the virtual device id
  13676. * Value: vdev ID
  13677. *
  13678. * Word 3
  13679. * - mac_addr31to0
  13680. * Bits 31:0
  13681. * Purpose: Contain the bits 31:0 of the peer MAC address
  13682. * Value: Bits 31:0 of the peer MAC address
  13683. *
  13684. * Word 4
  13685. * - mac_addr47to32
  13686. * Bits 15:0
  13687. * Purpose: Contain the bits 47:32 of the peer MAC address
  13688. * Value: Bits 47:32 of the peer MAC address
  13689. *
  13690. * Word 5
  13691. * - index
  13692. * Bits 31:0
  13693. * Purpose: Contain the index at which this CFR dump was written in the Host
  13694. * allocated memory. This index is the number of bytes from the base address.
  13695. * Value: Index position
  13696. *
  13697. * Word 6
  13698. * - length
  13699. * Bits 31:0
  13700. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  13701. * Value: Length of the CFR capture of the peer
  13702. *
  13703. * Word 7
  13704. * - timestamp
  13705. * Bits 31:0
  13706. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  13707. * clock used for this timestamp is private to the target and not visible to
  13708. * the host i.e., Host can interpret only the relative timestamp deltas from
  13709. * one message to the next, but can't interpret the absolute timestamp from a
  13710. * single message.
  13711. * Value: Timestamp in microseconds
  13712. *
  13713. * Word 8
  13714. * - counter
  13715. * Bits 31:0
  13716. * Purpose: Carry the count of the current CFR capture from FW. This is
  13717. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  13718. * in host memory)
  13719. * Value: Count of the current CFR capture
  13720. *
  13721. * Word 9
  13722. * - chan_mhz
  13723. * Bits 31:0
  13724. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  13725. * Value: Primary 20 channel frequency
  13726. *
  13727. * Word 10
  13728. * - band_center_freq1
  13729. * Bits 31:0
  13730. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  13731. * Value: Center frequency 1 in MHz
  13732. *
  13733. * Word 11
  13734. * - band_center_freq2
  13735. * Bits 31:0
  13736. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  13737. * the VDEV
  13738. * 80plus80 mode
  13739. * Value: Center frequency 2 in MHz
  13740. *
  13741. * Word 12
  13742. * - chan_phy_mode
  13743. * Bits 31:0
  13744. * Purpose: Carry the phy mode of the channel, of the VDEV
  13745. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  13746. */
  13747. PREPACK struct htt_cfr_dump_ind_type_1 {
  13748. A_UINT32 mem_req_id:7,
  13749. status:1,
  13750. capture_bw:3,
  13751. mode:3,
  13752. sts_count:3,
  13753. channel_bw:3,
  13754. cap_type:4,
  13755. vdev_id:8;
  13756. htt_mac_addr addr;
  13757. A_UINT32 index;
  13758. A_UINT32 length;
  13759. A_UINT32 timestamp;
  13760. A_UINT32 counter;
  13761. struct htt_chan_change_msg chan;
  13762. } POSTPACK;
  13763. PREPACK struct htt_cfr_dump_compl_ind {
  13764. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  13765. union {
  13766. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  13767. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  13768. /* If there is a need to change the memory layout and its associated
  13769. * HTT indication format, a new CFR capture message type can be
  13770. * introduced and added into this union.
  13771. */
  13772. };
  13773. } POSTPACK;
  13774. /*
  13775. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  13776. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13777. */
  13778. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  13779. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  13780. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  13781. do { \
  13782. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  13783. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  13784. } while(0)
  13785. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  13786. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  13787. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  13788. /*
  13789. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  13790. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  13791. */
  13792. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  13793. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  13794. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  13795. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  13796. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  13797. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  13798. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  13799. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  13800. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  13801. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  13802. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  13803. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  13804. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  13805. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  13806. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  13807. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  13808. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  13809. do { \
  13810. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  13811. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  13812. } while (0)
  13813. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  13814. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  13815. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  13816. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  13817. do { \
  13818. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  13819. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  13820. } while (0)
  13821. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  13822. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  13823. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  13824. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  13825. do { \
  13826. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  13827. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  13828. } while (0)
  13829. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  13830. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  13831. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  13832. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  13833. do { \
  13834. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  13835. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  13836. } while (0)
  13837. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  13838. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  13839. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  13840. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  13841. do { \
  13842. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  13843. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  13844. } while (0)
  13845. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  13846. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  13847. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  13848. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  13849. do { \
  13850. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  13851. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  13852. } while (0)
  13853. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  13854. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  13855. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  13856. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  13857. do { \
  13858. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  13859. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  13860. } while (0)
  13861. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  13862. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  13863. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  13864. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  13865. do { \
  13866. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  13867. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  13868. } while (0)
  13869. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  13870. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  13871. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  13872. /**
  13873. * @brief target -> host peer (PPDU) stats message
  13874. *
  13875. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  13876. *
  13877. * @details
  13878. * This message is generated by FW when FW is sending stats to host
  13879. * about one or more PPDUs that the FW has transmitted to one or more peers.
  13880. * This message is sent autonomously by the target rather than upon request
  13881. * by the host.
  13882. * The following field definitions describe the format of the HTT target
  13883. * to host peer stats indication message.
  13884. *
  13885. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  13886. * or more PPDU stats records.
  13887. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  13888. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  13889. * then the message would start with the
  13890. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  13891. * below.
  13892. *
  13893. * |31 16|15|14|13 11|10 9|8|7 0|
  13894. * |-------------------------------------------------------------|
  13895. * | reserved |MSG_TYPE |
  13896. * |-------------------------------------------------------------|
  13897. * rec 0 | TLV header |
  13898. * rec 0 |-------------------------------------------------------------|
  13899. * rec 0 | ppdu successful bytes |
  13900. * rec 0 |-------------------------------------------------------------|
  13901. * rec 0 | ppdu retry bytes |
  13902. * rec 0 |-------------------------------------------------------------|
  13903. * rec 0 | ppdu failed bytes |
  13904. * rec 0 |-------------------------------------------------------------|
  13905. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  13906. * rec 0 |-------------------------------------------------------------|
  13907. * rec 0 | retried MSDUs | successful MSDUs |
  13908. * rec 0 |-------------------------------------------------------------|
  13909. * rec 0 | TX duration | failed MSDUs |
  13910. * rec 0 |-------------------------------------------------------------|
  13911. * ...
  13912. * |-------------------------------------------------------------|
  13913. * rec N | TLV header |
  13914. * rec N |-------------------------------------------------------------|
  13915. * rec N | ppdu successful bytes |
  13916. * rec N |-------------------------------------------------------------|
  13917. * rec N | ppdu retry bytes |
  13918. * rec N |-------------------------------------------------------------|
  13919. * rec N | ppdu failed bytes |
  13920. * rec N |-------------------------------------------------------------|
  13921. * rec N | peer id | S|SG| BW | BA |A|rate code|
  13922. * rec N |-------------------------------------------------------------|
  13923. * rec N | retried MSDUs | successful MSDUs |
  13924. * rec N |-------------------------------------------------------------|
  13925. * rec N | TX duration | failed MSDUs |
  13926. * rec N |-------------------------------------------------------------|
  13927. *
  13928. * where:
  13929. * A = is A-MPDU flag
  13930. * BA = block-ack failure flags
  13931. * BW = bandwidth spec
  13932. * SG = SGI enabled spec
  13933. * S = skipped rate ctrl
  13934. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  13935. *
  13936. * Header
  13937. * ------
  13938. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  13939. * dword0 - b'8:31 - reserved : Reserved for future use
  13940. *
  13941. * payload include below peer_stats information
  13942. * --------------------------------------------
  13943. * @TLV : HTT_PPDU_STATS_INFO_TLV
  13944. * @tx_success_bytes : total successful bytes in the PPDU.
  13945. * @tx_retry_bytes : total retried bytes in the PPDU.
  13946. * @tx_failed_bytes : total failed bytes in the PPDU.
  13947. * @tx_ratecode : rate code used for the PPDU.
  13948. * @is_ampdu : Indicates PPDU is AMPDU or not.
  13949. * @ba_ack_failed : BA/ACK failed for this PPDU
  13950. * b00 -> BA received
  13951. * b01 -> BA failed once
  13952. * b10 -> BA failed twice, when HW retry is enabled.
  13953. * @bw : BW
  13954. * b00 -> 20 MHz
  13955. * b01 -> 40 MHz
  13956. * b10 -> 80 MHz
  13957. * b11 -> 160 MHz (or 80+80)
  13958. * @sg : SGI enabled
  13959. * @s : skipped ratectrl
  13960. * @peer_id : peer id
  13961. * @tx_success_msdus : successful MSDUs
  13962. * @tx_retry_msdus : retried MSDUs
  13963. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  13964. * @tx_duration : Tx duration for the PPDU (microsecond units)
  13965. */
  13966. /**
  13967. * @brief target -> host backpressure event
  13968. *
  13969. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  13970. *
  13971. * @details
  13972. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  13973. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  13974. * This message will only be sent if the backpressure condition has existed
  13975. * continuously for an initial period (100 ms).
  13976. * Repeat messages with updated information will be sent after each
  13977. * subsequent period (100 ms) as long as the backpressure remains unabated.
  13978. * This message indicates the ring id along with current head and tail index
  13979. * locations (i.e. write and read indices).
  13980. * The backpressure time indicates the time in ms for which continous
  13981. * backpressure has been observed in the ring.
  13982. *
  13983. * The message format is as follows:
  13984. *
  13985. * |31 24|23 16|15 8|7 0|
  13986. * |----------------+----------------+----------------+----------------|
  13987. * | ring_id | ring_type | pdev_id | msg_type |
  13988. * |-------------------------------------------------------------------|
  13989. * | tail_idx | head_idx |
  13990. * |-------------------------------------------------------------------|
  13991. * | backpressure_time_ms |
  13992. * |-------------------------------------------------------------------|
  13993. *
  13994. * The message is interpreted as follows:
  13995. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  13996. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  13997. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  13998. * 1, 2, 3 indicates pdev_id 0,1,2 and
  13999. the msg is for LMAC ring.
  14000. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  14001. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  14002. * htt_backpressure_lmac_ring_id. This represents
  14003. * the ring id for which continous backpressure is seen
  14004. *
  14005. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14006. * the ring indicated by the ring_id
  14007. *
  14008. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14009. * the ring indicated by the ring id
  14010. *
  14011. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14012. * backpressure has been seen in the ring
  14013. * indicated by the ring_id.
  14014. * Units = milliseconds
  14015. */
  14016. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14017. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14018. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14019. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14020. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14021. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14022. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14023. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14024. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14025. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14026. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14027. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14028. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14029. do { \
  14030. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14031. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14032. } while (0)
  14033. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14034. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14035. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14036. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14037. do { \
  14038. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14039. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14040. } while (0)
  14041. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14042. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14043. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14044. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14045. do { \
  14046. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14047. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14048. } while (0)
  14049. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14050. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14051. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14052. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14053. do { \
  14054. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14055. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14056. } while (0)
  14057. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14058. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14059. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14060. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14061. do { \
  14062. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14063. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14064. } while (0)
  14065. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14066. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14067. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14068. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14069. do { \
  14070. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14071. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14072. } while (0)
  14073. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14074. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14075. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14076. enum htt_backpressure_ring_type {
  14077. HTT_SW_RING_TYPE_UMAC,
  14078. HTT_SW_RING_TYPE_LMAC,
  14079. HTT_SW_RING_TYPE_MAX,
  14080. };
  14081. /* Ring id for which the message is sent to host */
  14082. enum htt_backpressure_umac_ringid {
  14083. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14084. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14085. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14086. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14087. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14088. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14089. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14090. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14091. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14092. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14093. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14094. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14095. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14096. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14097. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14098. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14099. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14100. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14101. HTT_SW_UMAC_RING_IDX_MAX,
  14102. };
  14103. enum htt_backpressure_lmac_ringid {
  14104. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14105. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14106. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14107. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14108. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14109. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14110. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14111. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14112. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14113. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14114. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14115. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14116. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14117. HTT_SW_LMAC_RING_IDX_MAX,
  14118. };
  14119. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14120. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14121. pdev_id: 8,
  14122. ring_type: 8, /* htt_backpressure_ring_type */
  14123. /*
  14124. * ring_id holds an enum value from either
  14125. * htt_backpressure_umac_ringid or
  14126. * htt_backpressure_lmac_ringid, based on
  14127. * the ring_type setting.
  14128. */
  14129. ring_id: 8;
  14130. A_UINT16 head_idx;
  14131. A_UINT16 tail_idx;
  14132. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14133. } POSTPACK;
  14134. /*
  14135. * Defines two 32 bit words that can be used by the target to indicate a per
  14136. * user RU allocation and rate information.
  14137. *
  14138. * This information is currently provided in the "sw_response_reference_ptr"
  14139. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14140. * "rx_ppdu_end_user_stats" TLV.
  14141. *
  14142. * VALID:
  14143. * The consumer of these words must explicitly check the valid bit,
  14144. * and only attempt interpretation of any of the remaining fields if
  14145. * the valid bit is set to 1.
  14146. *
  14147. * VERSION:
  14148. * The consumer of these words must also explicitly check the version bit,
  14149. * and only use the V0 definition if the VERSION field is set to 0.
  14150. *
  14151. * Version 1 is currently undefined, with the exception of the VALID and
  14152. * VERSION fields.
  14153. *
  14154. * Version 0:
  14155. *
  14156. * The fields below are duplicated per BW.
  14157. *
  14158. * The consumer must determine which BW field to use, based on the UL OFDMA
  14159. * PPDU BW indicated by HW.
  14160. *
  14161. * RU_START: RU26 start index for the user.
  14162. * Note that this is always using the RU26 index, regardless
  14163. * of the actual RU assigned to the user
  14164. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  14165. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  14166. *
  14167. * For example, 20MHz (the value in the top row is RU_START)
  14168. *
  14169. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  14170. * RU Size 1 (52): | | | | | |
  14171. * RU Size 2 (106): | | | |
  14172. * RU Size 3 (242): | |
  14173. *
  14174. * RU_SIZE: Indicates the RU size, as defined by enum
  14175. * htt_ul_ofdma_user_info_ru_size.
  14176. *
  14177. * LDPC: LDPC enabled (if 0, BCC is used)
  14178. *
  14179. * DCM: DCM enabled
  14180. *
  14181. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  14182. * |---------------------------------+--------------------------------|
  14183. * |Ver|Valid| FW internal |
  14184. * |---------------------------------+--------------------------------|
  14185. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  14186. * |---------------------------------+--------------------------------|
  14187. */
  14188. enum htt_ul_ofdma_user_info_ru_size {
  14189. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  14190. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  14191. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  14192. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  14193. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  14194. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  14195. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  14196. };
  14197. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  14198. struct htt_ul_ofdma_user_info_v0 {
  14199. A_UINT32 word0;
  14200. A_UINT32 word1;
  14201. };
  14202. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  14203. A_UINT32 w0_fw_rsvd:30; \
  14204. A_UINT32 w0_valid:1; \
  14205. A_UINT32 w0_version:1;
  14206. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  14207. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14208. };
  14209. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  14210. A_UINT32 w1_nss:3; \
  14211. A_UINT32 w1_mcs:4; \
  14212. A_UINT32 w1_ldpc:1; \
  14213. A_UINT32 w1_dcm:1; \
  14214. A_UINT32 w1_ru_start:7; \
  14215. A_UINT32 w1_ru_size:3; \
  14216. A_UINT32 w1_trig_type:4; \
  14217. A_UINT32 w1_unused:9;
  14218. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  14219. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14220. };
  14221. /* htt_up_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  14222. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  14223. union {
  14224. A_UINT32 word0;
  14225. struct {
  14226. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14227. };
  14228. };
  14229. union {
  14230. A_UINT32 word1;
  14231. struct {
  14232. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14233. };
  14234. };
  14235. } POSTPACK;
  14236. enum HTT_UL_OFDMA_TRIG_TYPE {
  14237. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  14238. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  14239. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  14240. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  14241. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  14242. };
  14243. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  14244. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  14245. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  14246. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  14247. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  14248. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  14249. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  14250. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  14251. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  14252. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  14253. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  14254. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  14255. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  14256. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  14257. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  14258. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  14259. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  14260. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  14261. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  14262. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  14263. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  14264. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  14265. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  14266. /*--- word 0 ---*/
  14267. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  14268. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  14269. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  14270. do { \
  14271. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  14272. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  14273. } while (0)
  14274. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  14275. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  14276. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  14277. do { \
  14278. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  14279. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  14280. } while (0)
  14281. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  14282. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  14283. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  14284. do { \
  14285. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  14286. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  14287. } while (0)
  14288. /*--- word 1 ---*/
  14289. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  14290. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  14291. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  14292. do { \
  14293. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  14294. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  14295. } while (0)
  14296. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  14297. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  14298. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  14299. do { \
  14300. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  14301. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  14302. } while (0)
  14303. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  14304. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  14305. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  14306. do { \
  14307. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  14308. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  14309. } while (0)
  14310. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  14311. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  14312. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  14313. do { \
  14314. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  14315. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  14316. } while (0)
  14317. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  14318. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  14319. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  14320. do { \
  14321. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  14322. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  14323. } while (0)
  14324. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  14325. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  14326. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  14327. do { \
  14328. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  14329. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  14330. } while (0)
  14331. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  14332. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  14333. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  14334. do { \
  14335. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  14336. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  14337. } while (0)
  14338. /**
  14339. * @brief target -> host channel calibration data message
  14340. *
  14341. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  14342. *
  14343. * @brief host -> target channel calibration data message
  14344. *
  14345. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  14346. *
  14347. * @details
  14348. * The following field definitions describe the format of the channel
  14349. * calibration data message sent from the target to the host when
  14350. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  14351. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  14352. * The message is defined as htt_chan_caldata_msg followed by a variable
  14353. * number of 32-bit character values.
  14354. *
  14355. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  14356. * |------------------------------------------------------------------|
  14357. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  14358. * |------------------------------------------------------------------|
  14359. * | payload size | mhz |
  14360. * |------------------------------------------------------------------|
  14361. * | center frequency 2 | center frequency 1 |
  14362. * |------------------------------------------------------------------|
  14363. * | check sum |
  14364. * |------------------------------------------------------------------|
  14365. * | payload |
  14366. * |------------------------------------------------------------------|
  14367. * message info field:
  14368. * - MSG_TYPE
  14369. * Bits 7:0
  14370. * Purpose: identifies this as a channel calibration data message
  14371. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  14372. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  14373. * - SUB_TYPE
  14374. * Bits 11:8
  14375. * Purpose: T2H: indicates whether target is providing chan cal data
  14376. * to the host to store, or requesting that the host
  14377. * download previously-stored data.
  14378. * H2T: indicates whether the host is providing the requested
  14379. * channel cal data, or if it is rejecting the data
  14380. * request because it does not have the requested data.
  14381. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  14382. * - CHKSUM_VALID
  14383. * Bit 12
  14384. * Purpose: indicates if the checksum field is valid
  14385. * value:
  14386. * - FRAG
  14387. * Bit 19:16
  14388. * Purpose: indicates the fragment index for message
  14389. * value: 0 for first fragment, 1 for second fragment, ...
  14390. * - APPEND
  14391. * Bit 20
  14392. * Purpose: indicates if this is the last fragment
  14393. * value: 0 = final fragment, 1 = more fragments will be appended
  14394. *
  14395. * channel and payload size field
  14396. * - MHZ
  14397. * Bits 15:0
  14398. * Purpose: indicates the channel primary frequency
  14399. * Value:
  14400. * - PAYLOAD_SIZE
  14401. * Bits 31:16
  14402. * Purpose: indicates the bytes of calibration data in payload
  14403. * Value:
  14404. *
  14405. * center frequency field
  14406. * - CENTER FREQUENCY 1
  14407. * Bits 15:0
  14408. * Purpose: indicates the channel center frequency
  14409. * Value: channel center frequency, in MHz units
  14410. * - CENTER FREQUENCY 2
  14411. * Bits 31:16
  14412. * Purpose: indicates the secondary channel center frequency,
  14413. * only for 11acvht 80plus80 mode
  14414. * Value: secondary channel center frequeny, in MHz units, if applicable
  14415. *
  14416. * checksum field
  14417. * - CHECK_SUM
  14418. * Bits 31:0
  14419. * Purpose: check the payload data, it is just for this fragment.
  14420. * This is intended for the target to check that the channel
  14421. * calibration data returned by the host is the unmodified data
  14422. * that was previously provided to the host by the target.
  14423. * value: checksum of fragment payload
  14424. */
  14425. PREPACK struct htt_chan_caldata_msg {
  14426. /* DWORD 0: message info */
  14427. A_UINT32
  14428. msg_type: 8,
  14429. sub_type: 4 ,
  14430. chksum_valid: 1, /** 1:valid, 0:invalid */
  14431. reserved1: 3,
  14432. frag_idx: 4, /** fragment index for calibration data */
  14433. appending: 1, /** 0: no fragment appending,
  14434. * 1: extra fragment appending */
  14435. reserved2: 11;
  14436. /* DWORD 1: channel and payload size */
  14437. A_UINT32
  14438. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  14439. payload_size: 16; /** unit: bytes */
  14440. /* DWORD 2: center frequency */
  14441. A_UINT32
  14442. band_center_freq1: 16, /** Center frequency 1 in MHz */
  14443. band_center_freq2: 16; /** Center frequency 2 in MHz,
  14444. * valid only for 11acvht 80plus80 mode */
  14445. /* DWORD 3: check sum */
  14446. A_UINT32 chksum;
  14447. /* variable length for calibration data */
  14448. A_UINT32 payload[1/* or more */];
  14449. } POSTPACK;
  14450. /* T2H SUBTYPE */
  14451. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  14452. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  14453. /* H2T SUBTYPE */
  14454. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  14455. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  14456. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  14457. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  14458. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  14459. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  14460. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  14461. do { \
  14462. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  14463. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  14464. } while (0)
  14465. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  14466. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  14467. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  14468. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  14469. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  14470. do { \
  14471. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  14472. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  14473. } while (0)
  14474. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  14475. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  14476. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  14477. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  14478. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  14479. do { \
  14480. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  14481. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  14482. } while (0)
  14483. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  14484. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  14485. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  14486. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  14487. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  14488. do { \
  14489. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  14490. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  14491. } while (0)
  14492. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  14493. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  14494. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  14495. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  14496. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  14497. do { \
  14498. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  14499. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  14500. } while (0)
  14501. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  14502. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  14503. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  14504. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  14505. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  14506. do { \
  14507. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  14508. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  14509. } while (0)
  14510. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  14511. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  14512. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  14513. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  14514. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  14515. do { \
  14516. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  14517. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  14518. } while (0)
  14519. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  14520. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  14521. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  14522. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  14523. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  14524. do { \
  14525. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  14526. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  14527. } while (0)
  14528. /**
  14529. * @brief target -> host FSE CMEM based send
  14530. *
  14531. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  14532. *
  14533. * @details
  14534. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  14535. * FSE placement in CMEM is enabled.
  14536. *
  14537. * This message sends the non-secure CMEM base address.
  14538. * It will be sent to host in response to message
  14539. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  14540. * The message would appear as follows:
  14541. *
  14542. * |31 24|23 16|15 8|7 0|
  14543. * |----------------+----------------+----------------+----------------|
  14544. * | reserved | num_entries | msg_type |
  14545. * |----------------+----------------+----------------+----------------|
  14546. * | base_address_lo |
  14547. * |----------------+----------------+----------------+----------------|
  14548. * | base_address_hi |
  14549. * |-------------------------------------------------------------------|
  14550. *
  14551. * The message is interpreted as follows:
  14552. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  14553. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  14554. * b'8:15 - number_entries: Indicated the number of entries
  14555. * programmed.
  14556. * b'16:31 - reserved.
  14557. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  14558. * CMEM base address
  14559. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  14560. * CMEM base address
  14561. */
  14562. PREPACK struct htt_cmem_base_send_t {
  14563. A_UINT32 msg_type: 8,
  14564. num_entries: 8,
  14565. reserved: 16;
  14566. A_UINT32 base_address_lo;
  14567. A_UINT32 base_address_hi;
  14568. } POSTPACK;
  14569. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  14570. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  14571. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  14572. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  14573. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  14574. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  14575. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  14576. do { \
  14577. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  14578. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14579. } while (0)
  14580. /**
  14581. * @brief - HTT PPDU ID format
  14582. *
  14583. * @details
  14584. * The following field definitions describe the format of the PPDU ID.
  14585. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  14586. *
  14587. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  14588. * +--------------------------------------------------------------------------
  14589. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  14590. * +--------------------------------------------------------------------------
  14591. *
  14592. * sch id :Schedule command id
  14593. * Bits [11 : 0] : monotonically increasing counter to track the
  14594. * PPDU posted to a specific transmit queue.
  14595. *
  14596. * hwq_id: Hardware Queue ID.
  14597. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  14598. *
  14599. * mac_id: MAC ID
  14600. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  14601. *
  14602. * seq_idx: Sequence index.
  14603. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  14604. * a particular TXOP.
  14605. *
  14606. * tqm_cmd: HWSCH/TQM flag.
  14607. * Bit [23] : Always set to 0.
  14608. *
  14609. * seq_cmd_type: Sequence command type.
  14610. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  14611. * Refer to enum HTT_STATS_FTYPE for values.
  14612. */
  14613. PREPACK struct htt_ppdu_id {
  14614. A_UINT32
  14615. sch_id: 12,
  14616. hwq_id: 5,
  14617. mac_id: 2,
  14618. seq_idx: 2,
  14619. reserved1: 2,
  14620. tqm_cmd: 1,
  14621. seq_cmd_type: 6,
  14622. reserved2: 2;
  14623. } POSTPACK;
  14624. #define HTT_PPDU_ID_SCH_ID_S 0
  14625. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  14626. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  14627. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  14628. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  14629. do { \
  14630. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  14631. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  14632. } while (0)
  14633. #define HTT_PPDU_ID_HWQ_ID_S 12
  14634. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  14635. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  14636. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  14637. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  14638. do { \
  14639. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  14640. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  14641. } while (0)
  14642. #define HTT_PPDU_ID_MAC_ID_S 17
  14643. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  14644. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  14645. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  14646. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  14647. do { \
  14648. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  14649. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  14650. } while (0)
  14651. #define HTT_PPDU_ID_SEQ_IDX_S 19
  14652. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  14653. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  14654. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  14655. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  14656. do { \
  14657. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  14658. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  14659. } while (0)
  14660. #define HTT_PPDU_ID_TQM_CMD_S 23
  14661. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  14662. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  14663. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  14664. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  14665. do { \
  14666. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  14667. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  14668. } while (0)
  14669. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  14670. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  14671. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  14672. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  14673. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  14674. do { \
  14675. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  14676. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  14677. } while (0)
  14678. /**
  14679. * @brief target -> RX PEER METADATA V0 format
  14680. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14681. * message from target, and will confirm to the target which peer metadata
  14682. * version to use in the wmi_init message.
  14683. *
  14684. * The following diagram shows the format of the RX PEER METADATA.
  14685. *
  14686. * |31 24|23 16|15 8|7 0|
  14687. * |-----------------------------------------------------------------------|
  14688. * | Reserved | VDEV ID | PEER ID |
  14689. * |-----------------------------------------------------------------------|
  14690. */
  14691. PREPACK struct htt_rx_peer_metadata_v0 {
  14692. A_UINT32
  14693. peer_id: 16,
  14694. vdev_id: 8,
  14695. reserved1: 8;
  14696. } POSTPACK;
  14697. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  14698. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  14699. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  14700. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  14701. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  14702. do { \
  14703. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  14704. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  14705. } while (0)
  14706. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  14707. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  14708. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  14709. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  14710. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  14711. do { \
  14712. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  14713. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  14714. } while (0)
  14715. /**
  14716. * @brief target -> RX PEER METADATA V1 format
  14717. * Host will know the peer metadata version from the wmi_service_ready_ext2
  14718. * message from target, and will confirm to the target which peer metadata
  14719. * version to use in the wmi_init message.
  14720. *
  14721. * The following diagram shows the format of the RX PEER METADATA V1 format.
  14722. *
  14723. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  14724. * |-----------------------------------------------------------------------|
  14725. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  14726. * |-----------------------------------------------------------------------|
  14727. */
  14728. PREPACK struct htt_rx_peer_metadata_v1 {
  14729. A_UINT32
  14730. peer_id: 13,
  14731. ml_peer_valid: 1,
  14732. reserved1: 2,
  14733. vdev_id: 8,
  14734. lmac_id: 2,
  14735. chip_id: 3,
  14736. reserved2: 3;
  14737. } POSTPACK;
  14738. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  14739. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  14740. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  14741. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  14742. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  14743. do { \
  14744. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  14745. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  14746. } while (0)
  14747. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  14748. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  14749. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  14750. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  14751. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  14752. do { \
  14753. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  14754. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  14755. } while (0)
  14756. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  14757. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  14758. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  14759. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  14760. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  14761. do { \
  14762. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  14763. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  14764. } while (0)
  14765. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  14766. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  14767. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  14768. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  14769. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  14770. do { \
  14771. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  14772. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  14773. } while (0)
  14774. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  14775. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  14776. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  14777. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  14778. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  14779. do { \
  14780. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  14781. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  14782. } while (0)
  14783. /*
  14784. * In some systems, the host SW wants to specify priorities between
  14785. * different MSDU / flow queues within the same peer-TID.
  14786. * The below enums are used for the host to identify to the target
  14787. * which MSDU queue's priority it wants to adjust.
  14788. */
  14789. /*
  14790. * The MSDUQ index describe index of TCL HW, where each index is
  14791. * used for queuing particular types of MSDUs.
  14792. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  14793. */
  14794. enum HTT_MSDUQ_INDEX {
  14795. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  14796. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  14797. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  14798. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  14799. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  14800. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  14801. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  14802. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  14803. HTT_MSDUQ_MAX_INDEX,
  14804. };
  14805. /* MSDU qtype definition */
  14806. enum HTT_MSDU_QTYPE {
  14807. /*
  14808. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  14809. * relative priority. Instead, the relative priority of CRIT_0 versus
  14810. * CRIT_1 is controlled by the FW, through the configuration parameters
  14811. * it applies to the queues.
  14812. */
  14813. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  14814. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  14815. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  14816. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  14817. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  14818. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  14819. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  14820. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  14821. /* New MSDU_QTYPE should be added above this line */
  14822. /*
  14823. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  14824. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  14825. * any host/target message definitions. The QTYPE_MAX value can
  14826. * only be used internally within the host or within the target.
  14827. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  14828. * it must regard the unexpected value as a default qtype value,
  14829. * or ignore it.
  14830. */
  14831. HTT_MSDU_QTYPE_MAX,
  14832. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  14833. };
  14834. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  14835. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  14836. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  14837. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  14838. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  14839. };
  14840. /**
  14841. * @brief target -> host mlo timestamp offset indication
  14842. *
  14843. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14844. *
  14845. * @details
  14846. * The following field definitions describe the format of the HTT target
  14847. * to host mlo timestamp offset indication message.
  14848. *
  14849. *
  14850. * |31 16|15 12|11 10|9 8|7 0 |
  14851. * |----------------------------------------------------------------------|
  14852. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  14853. * |----------------------------------------------------------------------|
  14854. * | Sync time stamp lo in us |
  14855. * |----------------------------------------------------------------------|
  14856. * | Sync time stamp hi in us |
  14857. * |----------------------------------------------------------------------|
  14858. * | mlo time stamp offset lo in us |
  14859. * |----------------------------------------------------------------------|
  14860. * | mlo time stamp offset hi in us |
  14861. * |----------------------------------------------------------------------|
  14862. * | mlo time stamp offset clocks in clock ticks |
  14863. * |----------------------------------------------------------------------|
  14864. * |31 26|25 16|15 0 |
  14865. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  14866. * | | compensation in clks | |
  14867. * |----------------------------------------------------------------------|
  14868. * |31 22|21 0 |
  14869. * | rsvd 3 | mlo time stamp comp timer period |
  14870. * |----------------------------------------------------------------------|
  14871. * The message is interpreted as follows:
  14872. *
  14873. * dword0 - b'0:7 - msg_type: This will be set to
  14874. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  14875. * value: 0x28
  14876. *
  14877. * dword0 - b'9:8 - pdev_id
  14878. *
  14879. * dword0 - b'11:10 - chip_id
  14880. *
  14881. * dword0 - b'15:12 - rsvd1: Reserved for future use
  14882. *
  14883. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  14884. *
  14885. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  14886. * which last sync interrupt was received
  14887. *
  14888. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  14889. * which last sync interrupt was received
  14890. *
  14891. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  14892. *
  14893. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  14894. *
  14895. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  14896. *
  14897. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  14898. *
  14899. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  14900. * for sub us resolution
  14901. *
  14902. * dword6 - b'31:26 - rsvd2: Reserved for future use
  14903. *
  14904. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  14905. * is applied, in us
  14906. *
  14907. * dword7 - b'31:22 - rsvd3: Reserved for future use
  14908. */
  14909. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  14910. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  14911. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  14912. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  14913. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  14914. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  14915. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  14916. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  14917. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  14918. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  14919. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  14920. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  14921. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  14922. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  14923. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  14924. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  14925. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  14926. do { \
  14927. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  14928. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  14929. } while (0)
  14930. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  14931. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  14932. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  14933. do { \
  14934. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  14935. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  14936. } while (0)
  14937. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  14938. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  14939. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  14940. do { \
  14941. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  14942. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  14943. } while (0)
  14944. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  14945. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  14946. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  14947. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  14948. do { \
  14949. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  14950. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  14951. } while (0)
  14952. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  14953. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  14954. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  14955. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  14956. do { \
  14957. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  14958. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  14959. } while (0)
  14960. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  14961. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  14962. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  14963. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  14964. do { \
  14965. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  14966. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  14967. } while (0)
  14968. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  14969. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  14970. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  14971. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  14972. do { \
  14973. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  14974. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  14975. } while (0)
  14976. typedef struct {
  14977. A_UINT32 msg_type: 8, /* bits 7:0 */
  14978. pdev_id: 2, /* bits 9:8 */
  14979. chip_id: 2, /* bits 11:10 */
  14980. reserved1: 4, /* bits 15:12 */
  14981. mac_clk_freq_mhz: 16; /* bits 31:16 */
  14982. A_UINT32 sync_timestamp_lo_us;
  14983. A_UINT32 sync_timestamp_hi_us;
  14984. A_UINT32 mlo_timestamp_offset_lo_us;
  14985. A_UINT32 mlo_timestamp_offset_hi_us;
  14986. A_UINT32 mlo_timestamp_offset_clks;
  14987. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  14988. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  14989. reserved2: 6; /* bits 31:26 */
  14990. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  14991. reserved3: 10; /* bits 31:22 */
  14992. } htt_t2h_mlo_offset_ind_t;
  14993. /*
  14994. * @brief target -> host VDEV TX RX STATS
  14995. *
  14996. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  14997. *
  14998. * @details
  14999. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  15000. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  15001. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  15002. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  15003. * periodically by target even in the absence of any further HTT request
  15004. * messages from host.
  15005. *
  15006. * The message is formatted as follows:
  15007. *
  15008. * |31 16|15 8|7 0|
  15009. * |---------------------------------+----------------+----------------|
  15010. * | payload_size | pdev_id | msg_type |
  15011. * |---------------------------------+----------------+----------------|
  15012. * | reserved0 |
  15013. * |-------------------------------------------------------------------|
  15014. * | reserved1 |
  15015. * |-------------------------------------------------------------------|
  15016. * | reserved2 |
  15017. * |-------------------------------------------------------------------|
  15018. * | |
  15019. * | VDEV specific Tx Rx stats info |
  15020. * | |
  15021. * |-------------------------------------------------------------------|
  15022. *
  15023. * The message is interpreted as follows:
  15024. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15025. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15026. * b'8:15 - pdev_id
  15027. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15028. * message header fields (msg_type through reserved2)
  15029. * dword1 - b'0:31 - reserved0.
  15030. * dword2 - b'0:31 - reserved1.
  15031. * dword3 - b'0:31 - reserved2.
  15032. */
  15033. typedef struct {
  15034. A_UINT32 msg_type: 8,
  15035. pdev_id: 8,
  15036. payload_size: 16;
  15037. A_UINT32 reserved0;
  15038. A_UINT32 reserved1;
  15039. A_UINT32 reserved2;
  15040. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15041. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15042. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15043. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15044. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15045. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15046. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15047. do { \
  15048. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15049. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15050. } while (0)
  15051. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15052. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15053. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15054. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15055. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15056. do { \
  15057. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15058. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15059. } while (0)
  15060. /* SOC related stats */
  15061. typedef struct {
  15062. htt_tlv_hdr_t tlv_hdr;
  15063. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15064. * This can be due to either the peer is deleted or deletion is ongoing
  15065. * */
  15066. A_UINT32 inv_peers_msdu_drop_count_lo;
  15067. A_UINT32 inv_peers_msdu_drop_count_hi;
  15068. } htt_t2h_soc_txrx_stats_common_tlv;
  15069. /* VDEV HW Tx/Rx stats */
  15070. typedef struct {
  15071. htt_tlv_hdr_t tlv_hdr;
  15072. A_UINT32 vdev_id;
  15073. /* Rx msdu byte cnt */
  15074. A_UINT32 rx_msdu_byte_cnt_lo;
  15075. A_UINT32 rx_msdu_byte_cnt_hi;
  15076. /* Rx msdu cnt */
  15077. A_UINT32 rx_msdu_cnt_lo;
  15078. A_UINT32 rx_msdu_cnt_hi;
  15079. /* tx msdu byte cnt */
  15080. A_UINT32 tx_msdu_byte_cnt_lo;
  15081. A_UINT32 tx_msdu_byte_cnt_hi;
  15082. /* tx msdu cnt */
  15083. A_UINT32 tx_msdu_cnt_lo;
  15084. A_UINT32 tx_msdu_cnt_hi;
  15085. /* tx excessive retry discarded msdu cnt*/
  15086. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15087. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15088. /* TX congestion ctrl msdu drop cnt */
  15089. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15090. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15091. /* discarded tx msdus cnt coz of time to live expiry */
  15092. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15093. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15094. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15095. #endif