htt.h 834 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. */
  226. #define HTT_CURRENT_VERSION_MAJOR 3
  227. #define HTT_CURRENT_VERSION_MINOR 104
  228. #define HTT_NUM_TX_FRAG_DESC 1024
  229. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  230. #define HTT_CHECK_SET_VAL(field, val) \
  231. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  232. /* macros to assist in sign-extending fields from HTT messages */
  233. #define HTT_SIGN_BIT_MASK(field) \
  234. ((field ## _M + (1 << field ## _S)) >> 1)
  235. #define HTT_SIGN_BIT(_val, field) \
  236. (_val & HTT_SIGN_BIT_MASK(field))
  237. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  238. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  239. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  240. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  241. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  242. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  243. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  244. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  245. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  246. /*
  247. * TEMPORARY:
  248. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  249. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  250. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  251. * updated.
  252. */
  253. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  254. /*
  255. * TEMPORARY:
  256. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  257. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  258. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  259. * updated.
  260. */
  261. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  262. /**
  263. * htt_dbg_stats_type -
  264. * bit positions for each stats type within a stats type bitmask
  265. * The bitmask contains 24 bits.
  266. */
  267. enum htt_dbg_stats_type {
  268. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  269. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  270. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  271. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  272. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  273. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  274. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  275. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  276. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  277. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  278. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  279. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  280. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  281. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  282. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  283. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  284. /* bits 16-23 currently reserved */
  285. /* keep this last */
  286. HTT_DBG_NUM_STATS
  287. };
  288. /*=== HTT option selection TLVs ===
  289. * Certain HTT messages have alternatives or options.
  290. * For such cases, the host and target need to agree on which option to use.
  291. * Option specification TLVs can be appended to the VERSION_REQ and
  292. * VERSION_CONF messages to select options other than the default.
  293. * These TLVs are entirely optional - if they are not provided, there is a
  294. * well-defined default for each option. If they are provided, they can be
  295. * provided in any order. Each TLV can be present or absent independent of
  296. * the presence / absence of other TLVs.
  297. *
  298. * The HTT option selection TLVs use the following format:
  299. * |31 16|15 8|7 0|
  300. * |---------------------------------+----------------+----------------|
  301. * | value (payload) | length | tag |
  302. * |-------------------------------------------------------------------|
  303. * The value portion need not be only 2 bytes; it can be extended by any
  304. * integer number of 4-byte units. The total length of the TLV, including
  305. * the tag and length fields, must be a multiple of 4 bytes. The length
  306. * field specifies the total TLV size in 4-byte units. Thus, the typical
  307. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  308. * field, would store 0x1 in its length field, to show that the TLV occupies
  309. * a single 4-byte unit.
  310. */
  311. /*--- TLV header format - applies to all HTT option TLVs ---*/
  312. enum HTT_OPTION_TLV_TAGS {
  313. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  314. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  315. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  316. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  317. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  318. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  319. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  320. };
  321. PREPACK struct htt_option_tlv_header_t {
  322. A_UINT8 tag;
  323. A_UINT8 length;
  324. } POSTPACK;
  325. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  326. #define HTT_OPTION_TLV_TAG_S 0
  327. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  328. #define HTT_OPTION_TLV_LENGTH_S 8
  329. /*
  330. * value0 - 16 bit value field stored in word0
  331. * The TLV's value field may be longer than 2 bytes, in which case
  332. * the remainder of the value is stored in word1, word2, etc.
  333. */
  334. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  335. #define HTT_OPTION_TLV_VALUE0_S 16
  336. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  337. do { \
  338. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  339. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  340. } while (0)
  341. #define HTT_OPTION_TLV_TAG_GET(word) \
  342. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  343. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  344. do { \
  345. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  346. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  347. } while (0)
  348. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  349. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  350. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  351. do { \
  352. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  353. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  354. } while (0)
  355. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  356. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  357. /*--- format of specific HTT option TLVs ---*/
  358. /*
  359. * HTT option TLV for specifying LL bus address size
  360. * Some chips require bus addresses used by the target to access buffers
  361. * within the host's memory to be 32 bits; others require bus addresses
  362. * used by the target to access buffers within the host's memory to be
  363. * 64 bits.
  364. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  365. * a suffix to the VERSION_CONF message to specify which bus address format
  366. * the target requires.
  367. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  368. * default to providing bus addresses to the target in 32-bit format.
  369. */
  370. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  371. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  372. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  373. };
  374. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  375. struct htt_option_tlv_header_t hdr;
  376. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  377. } POSTPACK;
  378. /*
  379. * HTT option TLV for specifying whether HL systems should indicate
  380. * over-the-air tx completion for individual frames, or should instead
  381. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  382. * requests an OTA tx completion for a particular tx frame.
  383. * This option does not apply to LL systems, where the TX_COMPL_IND
  384. * is mandatory.
  385. * This option is primarily intended for HL systems in which the tx frame
  386. * downloads over the host --> target bus are as slow as or slower than
  387. * the transmissions over the WLAN PHY. For cases where the bus is faster
  388. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  389. * and consquently will send one TX_COMPL_IND message that covers several
  390. * tx frames. For cases where the WLAN PHY is faster than the bus,
  391. * the target will end up transmitting very short A-MPDUs, and consequently
  392. * sending many TX_COMPL_IND messages, which each cover a very small number
  393. * of tx frames.
  394. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  395. * a suffix to the VERSION_REQ message to request whether the host desires to
  396. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  397. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  398. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  399. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  400. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  401. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  402. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  403. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  404. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  405. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  406. * TLV.
  407. */
  408. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  409. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  410. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  411. };
  412. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  413. struct htt_option_tlv_header_t hdr;
  414. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  415. } POSTPACK;
  416. /*
  417. * HTT option TLV for specifying how many tx queue groups the target
  418. * may establish.
  419. * This TLV specifies the maximum value the target may send in the
  420. * txq_group_id field of any TXQ_GROUP information elements sent by
  421. * the target to the host. This allows the host to pre-allocate an
  422. * appropriate number of tx queue group structs.
  423. *
  424. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  425. * a suffix to the VERSION_REQ message to specify whether the host supports
  426. * tx queue groups at all, and if so if there is any limit on the number of
  427. * tx queue groups that the host supports.
  428. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  429. * a suffix to the VERSION_CONF message. If the host has specified in the
  430. * VER_REQ message a limit on the number of tx queue groups the host can
  431. * supprt, the target shall limit its specification of the maximum tx groups
  432. * to be no larger than this host-specified limit.
  433. *
  434. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  435. * shall preallocate 4 tx queue group structs, and the target shall not
  436. * specify a txq_group_id larger than 3.
  437. */
  438. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  439. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  440. /*
  441. * values 1 through N specify the max number of tx queue groups
  442. * the sender supports
  443. */
  444. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  445. };
  446. /* TEMPORARY backwards-compatibility alias for a typo fix -
  447. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  448. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  449. * to support the old name (with the typo) until all references to the
  450. * old name are replaced with the new name.
  451. */
  452. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  453. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  454. struct htt_option_tlv_header_t hdr;
  455. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  456. } POSTPACK;
  457. /*
  458. * HTT option TLV for specifying whether the target supports an extended
  459. * version of the HTT tx descriptor. If the target provides this TLV
  460. * and specifies in the TLV that the target supports an extended version
  461. * of the HTT tx descriptor, the target must check the "extension" bit in
  462. * the HTT tx descriptor, and if the extension bit is set, to expect a
  463. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  464. * descriptor. Furthermore, the target must provide room for the HTT
  465. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  466. * This option is intended for systems where the host needs to explicitly
  467. * control the transmission parameters such as tx power for individual
  468. * tx frames.
  469. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  470. * as a suffix to the VERSION_CONF message to explicitly specify whether
  471. * the target supports the HTT tx MSDU extension descriptor.
  472. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  473. * by the host as lack of target support for the HTT tx MSDU extension
  474. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  475. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  476. * the HTT tx MSDU extension descriptor.
  477. * The host is not required to provide the HTT tx MSDU extension descriptor
  478. * just because the target supports it; the target must check the
  479. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  480. * extension descriptor is present.
  481. */
  482. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  483. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  484. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  485. };
  486. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  487. struct htt_option_tlv_header_t hdr;
  488. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  489. } POSTPACK;
  490. /*
  491. * For the tcl data command V2 and higher support added a new
  492. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  493. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  494. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  495. * HTT option TLV for specifying which version of the TCL metadata struct
  496. * should be used:
  497. * V1 -> use htt_tx_tcl_metadata struct
  498. * V2 -> use htt_tx_tcl_metadata_v2 struct
  499. * Old FW will only support V1.
  500. * New FW will support V2. New FW will still support V1, at least during
  501. * a transition period.
  502. * Similarly, old host will only support V1, and new host will support V1 + V2.
  503. *
  504. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  505. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  506. * of TCL metadata the host supports. If the host doesn't provide a
  507. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  508. * is implicitly understood that the host only supports V1.
  509. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  510. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  511. * the host shall use. The target shall only select one of the versions
  512. * supported by the host. If the target doesn't provide a
  513. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  514. * is implicitly understood that the V1 TCL metadata shall be used.
  515. */
  516. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  517. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  518. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  519. };
  520. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  521. struct htt_option_tlv_header_t hdr;
  522. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  523. } POSTPACK;
  524. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  525. HTT_OPTION_TLV_VALUE0_SET(word, value)
  526. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  527. HTT_OPTION_TLV_VALUE0_GET(word)
  528. typedef struct {
  529. union {
  530. /* BIT [11 : 0] :- tag
  531. * BIT [23 : 12] :- length
  532. * BIT [31 : 24] :- reserved
  533. */
  534. A_UINT32 tag__length;
  535. /*
  536. * The following struct is not endian-portable.
  537. * It is suitable for use within the target, which is known to be
  538. * little-endian.
  539. * The host should use the above endian-portable macros to access
  540. * the tag and length bitfields in an endian-neutral manner.
  541. */
  542. struct {
  543. A_UINT32 tag : 12, /* BIT [11 : 0] */
  544. length : 12, /* BIT [23 : 12] */
  545. reserved : 8; /* BIT [31 : 24] */
  546. };
  547. };
  548. } htt_tlv_hdr_t;
  549. /** HTT stats TLV tag values */
  550. typedef enum {
  551. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  552. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  553. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  554. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  555. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  556. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  557. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  558. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  559. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  560. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  561. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  562. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  563. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  564. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  565. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  566. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  567. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  568. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  569. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  570. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  571. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  572. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  573. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  574. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  575. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  576. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  577. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  578. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  579. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  580. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  581. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  582. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  583. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  584. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  585. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  586. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  587. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  588. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  589. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  590. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  591. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  592. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  593. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  594. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  595. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  596. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  597. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  598. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  599. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  600. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  601. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  602. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  603. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  604. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  605. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  606. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  607. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  608. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  609. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  610. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  611. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  612. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  613. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  614. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  615. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  616. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  617. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  618. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  619. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  620. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  621. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  622. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  623. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  624. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  625. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  626. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  627. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  628. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  629. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  630. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  631. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  632. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  633. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  634. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  635. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  636. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  637. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  638. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  639. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  640. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  641. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  642. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  643. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  644. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  645. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  646. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  647. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  648. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  649. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  650. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  651. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  652. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  653. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  654. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  655. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  656. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  657. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  658. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  659. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  660. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  661. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  662. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  663. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  664. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  665. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  666. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  667. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  668. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  669. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  670. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  671. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  672. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  673. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  674. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  675. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  676. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  677. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  678. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  679. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  680. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  681. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  682. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  683. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  684. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  685. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  686. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  687. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  688. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  689. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  690. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  691. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  692. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  693. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  694. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  695. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  696. HTT_STATS_MAX_TAG,
  697. } htt_stats_tlv_tag_t;
  698. /* retain deprecated enum name as an alias for the current enum name */
  699. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  700. #define HTT_STATS_TLV_TAG_M 0x00000fff
  701. #define HTT_STATS_TLV_TAG_S 0
  702. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  703. #define HTT_STATS_TLV_LENGTH_S 12
  704. #define HTT_STATS_TLV_TAG_GET(_var) \
  705. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  706. HTT_STATS_TLV_TAG_S)
  707. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  708. do { \
  709. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  710. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  711. } while (0)
  712. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  713. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  714. HTT_STATS_TLV_LENGTH_S)
  715. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  716. do { \
  717. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  718. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  719. } while (0)
  720. /*=== host -> target messages ===============================================*/
  721. enum htt_h2t_msg_type {
  722. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  723. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  724. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  725. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  726. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  727. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  728. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  729. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  730. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  731. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  732. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  733. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  734. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  735. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  736. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  737. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  738. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  739. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  740. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  741. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  742. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  743. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  744. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  745. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  746. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  747. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  748. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  749. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  750. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  751. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  752. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  753. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  754. /* keep this last */
  755. HTT_H2T_NUM_MSGS
  756. };
  757. /*
  758. * HTT host to target message type -
  759. * stored in bits 7:0 of the first word of the message
  760. */
  761. #define HTT_H2T_MSG_TYPE_M 0xff
  762. #define HTT_H2T_MSG_TYPE_S 0
  763. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  764. do { \
  765. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  766. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  767. } while (0)
  768. #define HTT_H2T_MSG_TYPE_GET(word) \
  769. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  770. /**
  771. * @brief host -> target version number request message definition
  772. *
  773. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  774. *
  775. *
  776. * |31 24|23 16|15 8|7 0|
  777. * |----------------+----------------+----------------+----------------|
  778. * | reserved | msg type |
  779. * |-------------------------------------------------------------------|
  780. * : option request TLV (optional) |
  781. * :...................................................................:
  782. *
  783. * The VER_REQ message may consist of a single 4-byte word, or may be
  784. * extended with TLVs that specify which HTT options the host is requesting
  785. * from the target.
  786. * The following option TLVs may be appended to the VER_REQ message:
  787. * - HL_SUPPRESS_TX_COMPL_IND
  788. * - HL_MAX_TX_QUEUE_GROUPS
  789. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  790. * may be appended to the VER_REQ message (but only one TLV of each type).
  791. *
  792. * Header fields:
  793. * - MSG_TYPE
  794. * Bits 7:0
  795. * Purpose: identifies this as a version number request message
  796. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  797. */
  798. #define HTT_VER_REQ_BYTES 4
  799. /* TBDXXX: figure out a reasonable number */
  800. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  801. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  802. /**
  803. * @brief HTT tx MSDU descriptor
  804. *
  805. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  806. *
  807. * @details
  808. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  809. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  810. * the target firmware needs for the FW's tx processing, particularly
  811. * for creating the HW msdu descriptor.
  812. * The same HTT tx descriptor is used for HL and LL systems, though
  813. * a few fields within the tx descriptor are used only by LL or
  814. * only by HL.
  815. * The HTT tx descriptor is defined in two manners: by a struct with
  816. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  817. * definitions.
  818. * The target should use the struct def, for simplicitly and clarity,
  819. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  820. * neutral. Specifically, the host shall use the get/set macros built
  821. * around the mask + shift defs.
  822. */
  823. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  824. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  825. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  826. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  827. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  828. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  829. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  830. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  831. #define HTT_TX_VDEV_ID_WORD 0
  832. #define HTT_TX_VDEV_ID_MASK 0x3f
  833. #define HTT_TX_VDEV_ID_SHIFT 16
  834. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  835. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  836. #define HTT_TX_MSDU_LEN_DWORD 1
  837. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  838. /*
  839. * HTT_VAR_PADDR macros
  840. * Allow physical / bus addresses to be either a single 32-bit value,
  841. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  842. */
  843. #define HTT_VAR_PADDR32(var_name) \
  844. A_UINT32 var_name
  845. #define HTT_VAR_PADDR64_LE(var_name) \
  846. struct { \
  847. /* little-endian: lo precedes hi */ \
  848. A_UINT32 lo; \
  849. A_UINT32 hi; \
  850. } var_name
  851. /*
  852. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  853. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  854. * addresses are stored in a XXX-bit field.
  855. * This macro is used to define both htt_tx_msdu_desc32_t and
  856. * htt_tx_msdu_desc64_t structs.
  857. */
  858. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  859. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  860. { \
  861. /* DWORD 0: flags and meta-data */ \
  862. A_UINT32 \
  863. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  864. \
  865. /* pkt_subtype - \
  866. * Detailed specification of the tx frame contents, extending the \
  867. * general specification provided by pkt_type. \
  868. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  869. * pkt_type | pkt_subtype \
  870. * ============================================================== \
  871. * 802.3 | bit 0:3 - Reserved \
  872. * | bit 4: 0x0 - Copy-Engine Classification Results \
  873. * | not appended to the HTT message \
  874. * | 0x1 - Copy-Engine Classification Results \
  875. * | appended to the HTT message in the \
  876. * | format: \
  877. * | [HTT tx desc, frame header, \
  878. * | CE classification results] \
  879. * | The CE classification results begin \
  880. * | at the next 4-byte boundary after \
  881. * | the frame header. \
  882. * ------------+------------------------------------------------- \
  883. * Eth2 | bit 0:3 - Reserved \
  884. * | bit 4: 0x0 - Copy-Engine Classification Results \
  885. * | not appended to the HTT message \
  886. * | 0x1 - Copy-Engine Classification Results \
  887. * | appended to the HTT message. \
  888. * | See the above specification of the \
  889. * | CE classification results location. \
  890. * ------------+------------------------------------------------- \
  891. * native WiFi | bit 0:3 - Reserved \
  892. * | bit 4: 0x0 - Copy-Engine Classification Results \
  893. * | not appended to the HTT message \
  894. * | 0x1 - Copy-Engine Classification Results \
  895. * | appended to the HTT message. \
  896. * | See the above specification of the \
  897. * | CE classification results location. \
  898. * ------------+------------------------------------------------- \
  899. * mgmt | 0x0 - 802.11 MAC header absent \
  900. * | 0x1 - 802.11 MAC header present \
  901. * ------------+------------------------------------------------- \
  902. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  903. * | 0x1 - 802.11 MAC header present \
  904. * | bit 1: 0x0 - allow aggregation \
  905. * | 0x1 - don't allow aggregation \
  906. * | bit 2: 0x0 - perform encryption \
  907. * | 0x1 - don't perform encryption \
  908. * | bit 3: 0x0 - perform tx classification / queuing \
  909. * | 0x1 - don't perform tx classification; \
  910. * | insert the frame into the "misc" \
  911. * | tx queue \
  912. * | bit 4: 0x0 - Copy-Engine Classification Results \
  913. * | not appended to the HTT message \
  914. * | 0x1 - Copy-Engine Classification Results \
  915. * | appended to the HTT message. \
  916. * | See the above specification of the \
  917. * | CE classification results location. \
  918. */ \
  919. pkt_subtype: 5, \
  920. \
  921. /* pkt_type - \
  922. * General specification of the tx frame contents. \
  923. * The htt_pkt_type enum should be used to specify and check the \
  924. * value of this field. \
  925. */ \
  926. pkt_type: 3, \
  927. \
  928. /* vdev_id - \
  929. * ID for the vdev that is sending this tx frame. \
  930. * For certain non-standard packet types, e.g. pkt_type == raw \
  931. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  932. * This field is used primarily for determining where to queue \
  933. * broadcast and multicast frames. \
  934. */ \
  935. vdev_id: 6, \
  936. /* ext_tid - \
  937. * The extended traffic ID. \
  938. * If the TID is unknown, the extended TID is set to \
  939. * HTT_TX_EXT_TID_INVALID. \
  940. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  941. * value of the QoS TID. \
  942. * If the tx frame is non-QoS data, then the extended TID is set to \
  943. * HTT_TX_EXT_TID_NON_QOS. \
  944. * If the tx frame is multicast or broadcast, then the extended TID \
  945. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  946. */ \
  947. ext_tid: 5, \
  948. \
  949. /* postponed - \
  950. * This flag indicates whether the tx frame has been downloaded to \
  951. * the target before but discarded by the target, and now is being \
  952. * downloaded again; or if this is a new frame that is being \
  953. * downloaded for the first time. \
  954. * This flag allows the target to determine the correct order for \
  955. * transmitting new vs. old frames. \
  956. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  957. * This flag only applies to HL systems, since in LL systems, \
  958. * the tx flow control is handled entirely within the target. \
  959. */ \
  960. postponed: 1, \
  961. \
  962. /* extension - \
  963. * This flag indicates whether a HTT tx MSDU extension descriptor \
  964. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  965. * \
  966. * 0x0 - no extension MSDU descriptor is present \
  967. * 0x1 - an extension MSDU descriptor immediately follows the \
  968. * regular MSDU descriptor \
  969. */ \
  970. extension: 1, \
  971. \
  972. /* cksum_offload - \
  973. * This flag indicates whether checksum offload is enabled or not \
  974. * for this frame. Target FW use this flag to turn on HW checksumming \
  975. * 0x0 - No checksum offload \
  976. * 0x1 - L3 header checksum only \
  977. * 0x2 - L4 checksum only \
  978. * 0x3 - L3 header checksum + L4 checksum \
  979. */ \
  980. cksum_offload: 2, \
  981. \
  982. /* tx_comp_req - \
  983. * This flag indicates whether Tx Completion \
  984. * from fw is required or not. \
  985. * This flag is only relevant if tx completion is not \
  986. * universally enabled. \
  987. * For all LL systems, tx completion is mandatory, \
  988. * so this flag will be irrelevant. \
  989. * For HL systems tx completion is optional, but HL systems in which \
  990. * the bus throughput exceeds the WLAN throughput will \
  991. * probably want to always use tx completion, and thus \
  992. * would not check this flag. \
  993. * This flag is required when tx completions are not used universally, \
  994. * but are still required for certain tx frames for which \
  995. * an OTA delivery acknowledgment is needed by the host. \
  996. * In practice, this would be for HL systems in which the \
  997. * bus throughput is less than the WLAN throughput. \
  998. * \
  999. * 0x0 - Tx Completion Indication from Fw not required \
  1000. * 0x1 - Tx Completion Indication from Fw is required \
  1001. */ \
  1002. tx_compl_req: 1; \
  1003. \
  1004. \
  1005. /* DWORD 1: MSDU length and ID */ \
  1006. A_UINT32 \
  1007. len: 16, /* MSDU length, in bytes */ \
  1008. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1009. * and this id is used to calculate fragmentation \
  1010. * descriptor pointer inside the target based on \
  1011. * the base address, configured inside the target. \
  1012. */ \
  1013. \
  1014. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1015. /* frags_desc_ptr - \
  1016. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1017. * where the tx frame's fragments reside in memory. \
  1018. * This field only applies to LL systems, since in HL systems the \
  1019. * (degenerate single-fragment) fragmentation descriptor is created \
  1020. * within the target. \
  1021. */ \
  1022. _paddr__frags_desc_ptr_; \
  1023. \
  1024. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1025. /* \
  1026. * Peer ID : Target can use this value to know which peer-id packet \
  1027. * destined to. \
  1028. * It's intended to be specified by host in case of NAWDS. \
  1029. */ \
  1030. A_UINT16 peerid; \
  1031. \
  1032. /* \
  1033. * Channel frequency: This identifies the desired channel \
  1034. * frequency (in mhz) for tx frames. This is used by FW to help \
  1035. * determine when it is safe to transmit or drop frames for \
  1036. * off-channel operation. \
  1037. * The default value of zero indicates to FW that the corresponding \
  1038. * VDEV's home channel (if there is one) is the desired channel \
  1039. * frequency. \
  1040. */ \
  1041. A_UINT16 chanfreq; \
  1042. \
  1043. /* Reason reserved is commented is increasing the htt structure size \
  1044. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1045. * A_UINT32 reserved_dword3_bits0_31; \
  1046. */ \
  1047. } POSTPACK
  1048. /* define a htt_tx_msdu_desc32_t type */
  1049. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1050. /* define a htt_tx_msdu_desc64_t type */
  1051. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1052. /*
  1053. * Make htt_tx_msdu_desc_t be an alias for either
  1054. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1055. */
  1056. #if HTT_PADDR64
  1057. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1058. #else
  1059. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1060. #endif
  1061. /* decriptor information for Management frame*/
  1062. /*
  1063. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1064. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1065. */
  1066. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1067. extern A_UINT32 mgmt_hdr_len;
  1068. PREPACK struct htt_mgmt_tx_desc_t {
  1069. A_UINT32 msg_type;
  1070. #if HTT_PADDR64
  1071. A_UINT64 frag_paddr; /* DMAble address of the data */
  1072. #else
  1073. A_UINT32 frag_paddr; /* DMAble address of the data */
  1074. #endif
  1075. A_UINT32 desc_id; /* returned to host during completion
  1076. * to free the meory*/
  1077. A_UINT32 len; /* Fragment length */
  1078. A_UINT32 vdev_id; /* virtual device ID*/
  1079. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1080. } POSTPACK;
  1081. PREPACK struct htt_mgmt_tx_compl_ind {
  1082. A_UINT32 desc_id;
  1083. A_UINT32 status;
  1084. } POSTPACK;
  1085. /*
  1086. * This SDU header size comes from the summation of the following:
  1087. * 1. Max of:
  1088. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1089. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1090. * b. 802.11 header, for raw frames: 36 bytes
  1091. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1092. * QoS header, HT header)
  1093. * c. 802.3 header, for ethernet frames: 14 bytes
  1094. * (destination address, source address, ethertype / length)
  1095. * 2. Max of:
  1096. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1097. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1098. * 3. 802.1Q VLAN header: 4 bytes
  1099. * 4. LLC/SNAP header: 8 bytes
  1100. */
  1101. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1102. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1103. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1104. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1105. A_COMPILE_TIME_ASSERT(
  1106. htt_encap_hdr_size_max_check_nwifi,
  1107. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1108. A_COMPILE_TIME_ASSERT(
  1109. htt_encap_hdr_size_max_check_enet,
  1110. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1111. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1112. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1113. #define HTT_TX_HDR_SIZE_802_1Q 4
  1114. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1115. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1116. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1117. HTT_TX_HDR_SIZE_802_1Q + \
  1118. HTT_TX_HDR_SIZE_LLC_SNAP)
  1119. #define HTT_HL_TX_FRM_HDR_LEN \
  1120. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1121. #define HTT_LL_TX_FRM_HDR_LEN \
  1122. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1123. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1124. /* dword 0 */
  1125. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1126. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1127. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1128. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1129. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1130. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1131. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1132. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1133. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1134. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1135. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1136. #define HTT_TX_DESC_PKT_TYPE_S 13
  1137. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1138. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1139. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1140. #define HTT_TX_DESC_VDEV_ID_S 16
  1141. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1142. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1143. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1144. #define HTT_TX_DESC_EXT_TID_S 22
  1145. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1146. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1147. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1148. #define HTT_TX_DESC_POSTPONED_S 27
  1149. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1150. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1151. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1152. #define HTT_TX_DESC_EXTENSION_S 28
  1153. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1154. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1155. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1156. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1157. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1158. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1159. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1160. #define HTT_TX_DESC_TX_COMP_S 31
  1161. /* dword 1 */
  1162. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1163. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1164. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1165. #define HTT_TX_DESC_FRM_LEN_S 0
  1166. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1167. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1168. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1169. #define HTT_TX_DESC_FRM_ID_S 16
  1170. /* dword 2 */
  1171. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1172. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1173. /* for systems using 64-bit format for bus addresses */
  1174. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1175. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1176. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1177. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1178. /* for systems using 32-bit format for bus addresses */
  1179. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1180. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1181. /* dword 3 */
  1182. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1183. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1184. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1185. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1186. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1187. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1188. #if HTT_PADDR64
  1189. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1190. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1191. #else
  1192. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1193. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1194. #endif
  1195. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1196. #define HTT_TX_DESC_PEER_ID_S 0
  1197. /*
  1198. * TEMPORARY:
  1199. * The original definitions for the PEER_ID fields contained typos
  1200. * (with _DESC_PADDR appended to this PEER_ID field name).
  1201. * Retain deprecated original names for PEER_ID fields until all code that
  1202. * refers to them has been updated.
  1203. */
  1204. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1205. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1206. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1207. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1208. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1209. HTT_TX_DESC_PEER_ID_M
  1210. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1211. HTT_TX_DESC_PEER_ID_S
  1212. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1213. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1214. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1215. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1216. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1217. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1218. #if HTT_PADDR64
  1219. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1220. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1221. #else
  1222. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1223. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1224. #endif
  1225. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1226. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1227. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1228. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1229. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1230. do { \
  1231. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1232. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1233. } while (0)
  1234. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1235. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1236. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1237. do { \
  1238. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1239. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1240. } while (0)
  1241. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1242. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1243. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1244. do { \
  1245. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1246. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1247. } while (0)
  1248. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1249. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1250. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1251. do { \
  1252. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1253. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1254. } while (0)
  1255. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1256. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1257. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1258. do { \
  1259. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1260. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1261. } while (0)
  1262. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1263. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1264. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1265. do { \
  1266. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1267. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1268. } while (0)
  1269. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1270. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1271. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1272. do { \
  1273. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1274. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1275. } while (0)
  1276. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1277. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1278. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1279. do { \
  1280. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1281. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1282. } while (0)
  1283. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1284. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1285. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1286. do { \
  1287. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1288. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1289. } while (0)
  1290. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1291. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1292. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1295. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1296. } while (0)
  1297. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1298. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1299. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1300. do { \
  1301. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1302. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1303. } while (0)
  1304. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1305. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1306. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1307. do { \
  1308. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1309. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1310. } while (0)
  1311. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1312. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1313. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1314. do { \
  1315. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1316. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1317. } while (0)
  1318. /* enums used in the HTT tx MSDU extension descriptor */
  1319. enum {
  1320. htt_tx_guard_interval_regular = 0,
  1321. htt_tx_guard_interval_short = 1,
  1322. };
  1323. enum {
  1324. htt_tx_preamble_type_ofdm = 0,
  1325. htt_tx_preamble_type_cck = 1,
  1326. htt_tx_preamble_type_ht = 2,
  1327. htt_tx_preamble_type_vht = 3,
  1328. };
  1329. enum {
  1330. htt_tx_bandwidth_5MHz = 0,
  1331. htt_tx_bandwidth_10MHz = 1,
  1332. htt_tx_bandwidth_20MHz = 2,
  1333. htt_tx_bandwidth_40MHz = 3,
  1334. htt_tx_bandwidth_80MHz = 4,
  1335. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1336. };
  1337. /**
  1338. * @brief HTT tx MSDU extension descriptor
  1339. * @details
  1340. * If the target supports HTT tx MSDU extension descriptors, the host has
  1341. * the option of appending the following struct following the regular
  1342. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1343. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1344. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1345. * tx specs for each frame.
  1346. */
  1347. PREPACK struct htt_tx_msdu_desc_ext_t {
  1348. /* DWORD 0: flags */
  1349. A_UINT32
  1350. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1351. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1352. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1353. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1354. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1355. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1356. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1357. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1358. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1359. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1360. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1361. /* DWORD 1: tx power, tx rate, tx BW */
  1362. A_UINT32
  1363. /* pwr -
  1364. * Specify what power the tx frame needs to be transmitted at.
  1365. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1366. * The value needs to be appropriately sign-extended when extracting
  1367. * the value from the message and storing it in a variable that is
  1368. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1369. * automatically handles this sign-extension.)
  1370. * If the transmission uses multiple tx chains, this power spec is
  1371. * the total transmit power, assuming incoherent combination of
  1372. * per-chain power to produce the total power.
  1373. */
  1374. pwr: 8,
  1375. /* mcs_mask -
  1376. * Specify the allowable values for MCS index (modulation and coding)
  1377. * to use for transmitting the frame.
  1378. *
  1379. * For HT / VHT preamble types, this mask directly corresponds to
  1380. * the HT or VHT MCS indices that are allowed. For each bit N set
  1381. * within the mask, MCS index N is allowed for transmitting the frame.
  1382. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1383. * rates versus OFDM rates, so the host has the option of specifying
  1384. * that the target must transmit the frame with CCK or OFDM rates
  1385. * (not HT or VHT), but leaving the decision to the target whether
  1386. * to use CCK or OFDM.
  1387. *
  1388. * For CCK and OFDM, the bits within this mask are interpreted as
  1389. * follows:
  1390. * bit 0 -> CCK 1 Mbps rate is allowed
  1391. * bit 1 -> CCK 2 Mbps rate is allowed
  1392. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1393. * bit 3 -> CCK 11 Mbps rate is allowed
  1394. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1395. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1396. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1397. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1398. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1399. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1400. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1401. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1402. *
  1403. * The MCS index specification needs to be compatible with the
  1404. * bandwidth mask specification. For example, a MCS index == 9
  1405. * specification is inconsistent with a preamble type == VHT,
  1406. * Nss == 1, and channel bandwidth == 20 MHz.
  1407. *
  1408. * Furthermore, the host has only a limited ability to specify to
  1409. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1410. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1411. */
  1412. mcs_mask: 12,
  1413. /* nss_mask -
  1414. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1415. * Each bit in this mask corresponds to a Nss value:
  1416. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1417. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1418. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1419. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1420. * The values in the Nss mask must be suitable for the recipient, e.g.
  1421. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1422. * recipient which only supports 2x2 MIMO.
  1423. */
  1424. nss_mask: 4,
  1425. /* guard_interval -
  1426. * Specify a htt_tx_guard_interval enum value to indicate whether
  1427. * the transmission should use a regular guard interval or a
  1428. * short guard interval.
  1429. */
  1430. guard_interval: 1,
  1431. /* preamble_type_mask -
  1432. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1433. * may choose from for transmitting this frame.
  1434. * The bits in this mask correspond to the values in the
  1435. * htt_tx_preamble_type enum. For example, to allow the target
  1436. * to transmit the frame as either CCK or OFDM, this field would
  1437. * be set to
  1438. * (1 << htt_tx_preamble_type_ofdm) |
  1439. * (1 << htt_tx_preamble_type_cck)
  1440. */
  1441. preamble_type_mask: 4,
  1442. reserved1_31_29: 3; /* unused, set to 0x0 */
  1443. /* DWORD 2: tx chain mask, tx retries */
  1444. A_UINT32
  1445. /* chain_mask - specify which chains to transmit from */
  1446. chain_mask: 4,
  1447. /* retry_limit -
  1448. * Specify the maximum number of transmissions, including the
  1449. * initial transmission, to attempt before giving up if no ack
  1450. * is received.
  1451. * If the tx rate is specified, then all retries shall use the
  1452. * same rate as the initial transmission.
  1453. * If no tx rate is specified, the target can choose whether to
  1454. * retain the original rate during the retransmissions, or to
  1455. * fall back to a more robust rate.
  1456. */
  1457. retry_limit: 4,
  1458. /* bandwidth_mask -
  1459. * Specify what channel widths may be used for the transmission.
  1460. * A value of zero indicates "don't care" - the target may choose
  1461. * the transmission bandwidth.
  1462. * The bits within this mask correspond to the htt_tx_bandwidth
  1463. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1464. * The bandwidth_mask must be consistent with the preamble_type_mask
  1465. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1466. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1467. */
  1468. bandwidth_mask: 6,
  1469. reserved2_31_14: 18; /* unused, set to 0x0 */
  1470. /* DWORD 3: tx expiry time (TSF) LSBs */
  1471. A_UINT32 expire_tsf_lo;
  1472. /* DWORD 4: tx expiry time (TSF) MSBs */
  1473. A_UINT32 expire_tsf_hi;
  1474. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1475. } POSTPACK;
  1476. /* DWORD 0 */
  1477. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1478. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1479. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1480. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1481. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1482. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1483. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1484. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1485. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1486. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1487. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1488. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1489. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1490. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1491. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1492. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1493. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1494. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1495. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1496. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1497. /* DWORD 1 */
  1498. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1499. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1500. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1501. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1502. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1503. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1504. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1505. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1506. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1507. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1508. /* DWORD 2 */
  1509. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1510. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1511. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1512. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1513. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1514. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1515. /* DWORD 0 */
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1517. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1518. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1519. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1520. do { \
  1521. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1522. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1523. } while (0)
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1525. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1526. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1528. do { \
  1529. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1530. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1531. } while (0)
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1533. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1534. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1536. do { \
  1537. HTT_CHECK_SET_VAL( \
  1538. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1539. ((_var) |= ((_val) \
  1540. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1541. } while (0)
  1542. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1543. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1544. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1545. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1546. do { \
  1547. HTT_CHECK_SET_VAL( \
  1548. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1549. ((_var) |= ((_val) \
  1550. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1551. } while (0)
  1552. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1553. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1554. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1555. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1556. do { \
  1557. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1558. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1559. } while (0)
  1560. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1561. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1562. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1563. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1564. do { \
  1565. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1566. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1567. } while (0)
  1568. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1569. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1570. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1571. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1572. do { \
  1573. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1574. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1575. } while (0)
  1576. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1577. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1578. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1579. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1580. do { \
  1581. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1582. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1583. } while (0)
  1584. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1585. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1586. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1587. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1588. do { \
  1589. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1590. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1591. } while (0)
  1592. /* DWORD 1 */
  1593. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1594. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1595. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1596. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1597. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1598. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1599. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1600. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1601. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1602. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1603. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1604. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1605. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1606. do { \
  1607. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1608. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1609. } while (0)
  1610. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1611. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1612. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1613. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1614. do { \
  1615. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1616. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1617. } while (0)
  1618. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1619. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1620. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1621. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1622. do { \
  1623. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1624. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1625. } while (0)
  1626. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1627. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1628. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1629. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1630. do { \
  1631. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1632. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1633. } while (0)
  1634. /* DWORD 2 */
  1635. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1636. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1637. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1638. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1639. do { \
  1640. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1641. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1642. } while (0)
  1643. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1644. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1645. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1646. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1647. do { \
  1648. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1649. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1650. } while (0)
  1651. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1652. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1653. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1654. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1655. do { \
  1656. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1657. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1658. } while (0)
  1659. typedef enum {
  1660. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1661. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1662. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1663. } htt_11ax_ltf_subtype_t;
  1664. typedef enum {
  1665. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1666. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1667. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1668. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1669. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1670. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1671. } htt_tx_ext2_preamble_type_t;
  1672. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1673. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1674. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1675. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1676. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1677. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1678. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1679. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1680. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1681. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1682. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1683. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1684. /**
  1685. * @brief HTT tx MSDU extension descriptor v2
  1686. * @details
  1687. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1688. * is received as tcl_exit_base->host_meta_info in firmware.
  1689. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1690. * are already part of tcl_exit_base.
  1691. */
  1692. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1693. /* DWORD 0: flags */
  1694. A_UINT32
  1695. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1696. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1697. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1698. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1699. valid_retries : 1, /* if set, tx retries spec is valid */
  1700. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1701. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1702. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1703. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1704. valid_key_flags : 1, /* if set, key flags is valid */
  1705. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1706. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1707. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1708. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1709. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1710. 1 = ENCRYPT,
  1711. 2 ~ 3 - Reserved */
  1712. /* retry_limit -
  1713. * Specify the maximum number of transmissions, including the
  1714. * initial transmission, to attempt before giving up if no ack
  1715. * is received.
  1716. * If the tx rate is specified, then all retries shall use the
  1717. * same rate as the initial transmission.
  1718. * If no tx rate is specified, the target can choose whether to
  1719. * retain the original rate during the retransmissions, or to
  1720. * fall back to a more robust rate.
  1721. */
  1722. retry_limit : 4,
  1723. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1724. * Valid only for 11ax preamble types HE_SU
  1725. * and HE_EXT_SU
  1726. */
  1727. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1728. * Valid only for 11ax preamble types HE_SU
  1729. * and HE_EXT_SU
  1730. */
  1731. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1732. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1733. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1734. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1735. */
  1736. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1737. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1738. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1739. * Use cases:
  1740. * Any time firmware uses TQM-BYPASS for Data
  1741. * TID, firmware expect host to set this bit.
  1742. */
  1743. /* DWORD 1: tx power, tx rate */
  1744. A_UINT32
  1745. power : 8, /* unit of the power field is 0.5 dbm
  1746. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1747. * signed value ranging from -64dbm to 63.5 dbm
  1748. */
  1749. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1750. * Setting more than one MCS isn't currently
  1751. * supported by the target (but is supported
  1752. * in the interface in case in the future
  1753. * the target supports specifications of
  1754. * a limited set of MCS values.
  1755. */
  1756. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1757. * Setting more than one Nss isn't currently
  1758. * supported by the target (but is supported
  1759. * in the interface in case in the future
  1760. * the target supports specifications of
  1761. * a limited set of Nss values.
  1762. */
  1763. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1764. update_peer_cache : 1; /* When set these custom values will be
  1765. * used for all packets, until the next
  1766. * update via this ext header.
  1767. * This is to make sure not all packets
  1768. * need to include this header.
  1769. */
  1770. /* DWORD 2: tx chain mask, tx retries */
  1771. A_UINT32
  1772. /* chain_mask - specify which chains to transmit from */
  1773. chain_mask : 8,
  1774. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1775. * TODO: Update Enum values for key_flags
  1776. */
  1777. /*
  1778. * Channel frequency: This identifies the desired channel
  1779. * frequency (in MHz) for tx frames. This is used by FW to help
  1780. * determine when it is safe to transmit or drop frames for
  1781. * off-channel operation.
  1782. * The default value of zero indicates to FW that the corresponding
  1783. * VDEV's home channel (if there is one) is the desired channel
  1784. * frequency.
  1785. */
  1786. chanfreq : 16;
  1787. /* DWORD 3: tx expiry time (TSF) LSBs */
  1788. A_UINT32 expire_tsf_lo;
  1789. /* DWORD 4: tx expiry time (TSF) MSBs */
  1790. A_UINT32 expire_tsf_hi;
  1791. /* DWORD 5: flags to control routing / processing of the MSDU */
  1792. A_UINT32
  1793. /* learning_frame
  1794. * When this flag is set, this frame will be dropped by FW
  1795. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1796. */
  1797. learning_frame : 1,
  1798. /* send_as_standalone
  1799. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1800. * i.e. with no A-MSDU or A-MPDU aggregation.
  1801. * The scope is extended to other use-cases.
  1802. */
  1803. send_as_standalone : 1,
  1804. /* is_host_opaque_valid
  1805. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1806. * with valid information.
  1807. */
  1808. is_host_opaque_valid : 1,
  1809. rsvd0 : 29;
  1810. /* DWORD 6 : Host opaque cookie for special frames */
  1811. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1812. rsvd1 : 16;
  1813. /*
  1814. * This structure can be expanded further up to 40 bytes
  1815. * by adding further DWORDs as needed.
  1816. */
  1817. } POSTPACK;
  1818. /* DWORD 0 */
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1823. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1824. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1826. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1827. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1828. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1829. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1831. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1832. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1833. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1834. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1835. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1836. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1837. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1838. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1839. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1840. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1841. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1842. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1843. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1844. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1845. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1846. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1847. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1848. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1849. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1850. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1851. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1852. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1853. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1854. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1855. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1856. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1857. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1858. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1859. /* DWORD 1 */
  1860. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1861. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1862. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1863. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1864. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1865. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1866. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1867. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1868. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1869. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1870. /* DWORD 2 */
  1871. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1872. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1873. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1874. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1875. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1876. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1877. /* DWORD 5 */
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1884. /* DWORD 6 */
  1885. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1886. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1887. /* DWORD 0 */
  1888. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1889. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1890. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1891. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1892. do { \
  1893. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1894. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1895. } while (0)
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1897. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1898. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1899. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1900. do { \
  1901. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1902. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1903. } while (0)
  1904. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1905. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1906. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1907. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1908. do { \
  1909. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1910. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1911. } while (0)
  1912. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1913. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1914. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1915. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1916. do { \
  1917. HTT_CHECK_SET_VAL( \
  1918. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1919. ((_var) |= ((_val) \
  1920. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1921. } while (0)
  1922. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1923. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1924. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1925. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1926. do { \
  1927. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1928. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1929. } while (0)
  1930. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1931. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1932. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1933. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1934. do { \
  1935. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1936. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1937. } while (0)
  1938. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1939. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1940. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1941. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1942. do { \
  1943. HTT_CHECK_SET_VAL( \
  1944. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1945. ((_var) |= ((_val) \
  1946. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1947. } while (0)
  1948. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1949. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1950. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1951. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1952. do { \
  1953. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1954. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1955. } while (0)
  1956. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1957. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1958. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1959. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1960. do { \
  1961. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1962. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1963. } while (0)
  1964. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1965. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1966. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1967. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1968. do { \
  1969. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1970. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1971. } while (0)
  1972. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1973. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1974. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1975. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1976. do { \
  1977. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1978. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1979. } while (0)
  1980. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1981. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1982. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1983. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1984. do { \
  1985. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1986. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1987. } while (0)
  1988. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1989. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1990. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1991. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1992. do { \
  1993. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1994. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1995. } while (0)
  1996. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1997. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1998. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1999. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2000. do { \
  2001. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2002. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2003. } while (0)
  2004. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2005. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2006. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2007. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2008. do { \
  2009. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2010. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2011. } while (0)
  2012. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2013. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2014. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2015. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2016. do { \
  2017. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2018. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2019. } while (0)
  2020. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2021. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2022. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2023. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2024. do { \
  2025. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2026. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2027. } while (0)
  2028. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2029. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2030. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2031. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2032. do { \
  2033. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2034. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2035. } while (0)
  2036. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2037. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2038. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2039. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2040. do { \
  2041. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2042. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2043. } while (0)
  2044. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2045. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2046. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2047. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2048. do { \
  2049. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2050. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2051. } while (0)
  2052. /* DWORD 1 */
  2053. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2054. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2055. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2056. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2057. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2058. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2059. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2060. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2061. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2062. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2063. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2064. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2065. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2066. do { \
  2067. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2068. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2069. } while (0)
  2070. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2071. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2072. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2073. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2074. do { \
  2075. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2076. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2077. } while (0)
  2078. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2079. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2080. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2081. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2082. do { \
  2083. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2084. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2085. } while (0)
  2086. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2087. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2088. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2089. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2090. do { \
  2091. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2092. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2093. } while (0)
  2094. /* DWORD 2 */
  2095. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2096. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2097. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2098. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2099. do { \
  2100. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2101. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2102. } while (0)
  2103. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2104. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2105. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2106. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2107. do { \
  2108. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2109. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2110. } while (0)
  2111. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2112. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2113. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2114. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2115. do { \
  2116. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2117. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2118. } while (0)
  2119. /* DWORD 5 */
  2120. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2121. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2122. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2123. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2124. do { \
  2125. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2126. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2127. } while (0)
  2128. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2129. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2130. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2131. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2132. do { \
  2133. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2134. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2135. } while (0)
  2136. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2137. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2138. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2139. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2140. do { \
  2141. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2142. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2143. } while (0)
  2144. /* DWORD 6 */
  2145. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2146. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2147. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2148. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2149. do { \
  2150. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2151. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2152. } while (0)
  2153. typedef enum {
  2154. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2155. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2156. } htt_tcl_metadata_type;
  2157. /**
  2158. * @brief HTT TCL command number format
  2159. * @details
  2160. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2161. * available to firmware as tcl_exit_base->tcl_status_number.
  2162. * For regular / multicast packets host will send vdev and mac id and for
  2163. * NAWDS packets, host will send peer id.
  2164. * A_UINT32 is used to avoid endianness conversion problems.
  2165. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2166. */
  2167. typedef struct {
  2168. A_UINT32
  2169. type: 1, /* vdev_id based or peer_id based */
  2170. rsvd: 31;
  2171. } htt_tx_tcl_vdev_or_peer_t;
  2172. typedef struct {
  2173. A_UINT32
  2174. type: 1, /* vdev_id based or peer_id based */
  2175. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2176. vdev_id: 8,
  2177. pdev_id: 2,
  2178. host_inspected:1,
  2179. rsvd: 19;
  2180. } htt_tx_tcl_vdev_metadata;
  2181. typedef struct {
  2182. A_UINT32
  2183. type: 1, /* vdev_id based or peer_id based */
  2184. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2185. peer_id: 14,
  2186. rsvd: 16;
  2187. } htt_tx_tcl_peer_metadata;
  2188. PREPACK struct htt_tx_tcl_metadata {
  2189. union {
  2190. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2191. htt_tx_tcl_vdev_metadata vdev_meta;
  2192. htt_tx_tcl_peer_metadata peer_meta;
  2193. };
  2194. } POSTPACK;
  2195. /* DWORD 0 */
  2196. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2197. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2198. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2199. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2200. /* VDEV metadata */
  2201. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2202. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2203. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2204. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2205. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2206. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2207. /* PEER metadata */
  2208. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2209. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2210. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2211. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2212. HTT_TX_TCL_METADATA_TYPE_S)
  2213. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2214. do { \
  2215. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2216. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2217. } while (0)
  2218. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2219. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2220. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2221. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2222. do { \
  2223. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2224. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2225. } while (0)
  2226. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2227. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2228. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2229. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2230. do { \
  2231. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2232. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2233. } while (0)
  2234. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2235. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2236. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2237. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2238. do { \
  2239. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2240. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2241. } while (0)
  2242. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2243. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2244. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2245. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2246. do { \
  2247. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2248. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2249. } while (0)
  2250. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2251. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2252. HTT_TX_TCL_METADATA_PEER_ID_S)
  2253. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2254. do { \
  2255. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2256. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2257. } while (0)
  2258. /*------------------------------------------------------------------
  2259. * V2 Version of TCL Data Command
  2260. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2261. * MLO global_seq all flavours of TCL Data Cmd.
  2262. *-----------------------------------------------------------------*/
  2263. typedef enum {
  2264. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2265. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2266. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2267. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2268. } htt_tcl_metadata_type_v2;
  2269. /**
  2270. * @brief HTT TCL command number format
  2271. * @details
  2272. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2273. * available to firmware as tcl_exit_base->tcl_status_number.
  2274. * A_UINT32 is used to avoid endianness conversion problems.
  2275. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2276. */
  2277. typedef struct {
  2278. A_UINT32
  2279. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2280. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2281. vdev_id: 8,
  2282. pdev_id: 2,
  2283. host_inspected:1,
  2284. rsvd: 2,
  2285. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2286. } htt_tx_tcl_vdev_metadata_v2;
  2287. typedef struct {
  2288. A_UINT32
  2289. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2290. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2291. peer_id: 13,
  2292. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2293. } htt_tx_tcl_peer_metadata_v2;
  2294. typedef struct {
  2295. A_UINT32
  2296. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2297. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2298. svc_class_id: 8,
  2299. rsvd: 5,
  2300. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2301. } htt_tx_tcl_svc_class_id_metadata;
  2302. typedef struct {
  2303. A_UINT32
  2304. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2305. host_inspected: 1,
  2306. global_seq_no: 12,
  2307. rsvd: 1,
  2308. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2309. } htt_tx_tcl_global_seq_metadata;
  2310. PREPACK struct htt_tx_tcl_metadata_v2 {
  2311. union {
  2312. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2313. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2314. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2315. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2316. };
  2317. } POSTPACK;
  2318. /* DWORD 0 */
  2319. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2320. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2321. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2322. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2323. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2324. /* VDEV V2 metadata */
  2325. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2326. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2327. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2328. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2329. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2330. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2331. /* PEER V2 metadata */
  2332. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2333. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2334. /* SVC_CLASS_ID metadata */
  2335. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2336. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2337. /* Global Seq no metadata */
  2338. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2339. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2340. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2341. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2342. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2343. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2344. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2345. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2346. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2347. do { \
  2348. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2349. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2350. } while (0)
  2351. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2352. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2353. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2354. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2355. do { \
  2356. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2357. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2358. } while (0)
  2359. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2360. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2361. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2362. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2363. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2364. do { \
  2365. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2366. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2367. } while (0)
  2368. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2369. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2370. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2371. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2372. do { \
  2373. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2374. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2375. } while (0)
  2376. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2377. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2378. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2379. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2380. do { \
  2381. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2382. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2383. } while (0)
  2384. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2385. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2386. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2387. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2388. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2389. do { \
  2390. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2391. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2392. } while (0)
  2393. /*----- Get and Set V2 type field in Service Class fields ----*/
  2394. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2395. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2396. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2397. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2398. do { \
  2399. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2400. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2401. } while (0)
  2402. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2403. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2404. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2405. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2406. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2407. do { \
  2408. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2409. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2410. } while (0)
  2411. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2412. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2413. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2414. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2415. do { \
  2416. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2417. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2418. } while (0)
  2419. /*------------------------------------------------------------------
  2420. * End V2 Version of TCL Data Command
  2421. *-----------------------------------------------------------------*/
  2422. typedef enum {
  2423. HTT_TX_FW2WBM_TX_STATUS_OK,
  2424. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2425. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2426. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2427. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2428. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2429. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2430. HTT_TX_FW2WBM_TX_STATUS_MAX
  2431. } htt_tx_fw2wbm_tx_status_t;
  2432. typedef enum {
  2433. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2434. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2435. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2436. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2437. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2438. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2439. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2440. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2441. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2442. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2443. } htt_tx_fw2wbm_reinject_reason_t;
  2444. /**
  2445. * @brief HTT TX WBM Completion from firmware to host
  2446. * @details
  2447. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2448. * DWORD 3 and 4 for software based completions (Exception frames and
  2449. * TQM bypass frames)
  2450. * For software based completions, wbm_release_ring->release_source_module will
  2451. * be set to release_source_fw
  2452. */
  2453. PREPACK struct htt_tx_wbm_completion {
  2454. A_UINT32
  2455. sch_cmd_id: 24,
  2456. exception_frame: 1, /* If set, this packet was queued via exception path */
  2457. rsvd0_31_25: 7;
  2458. A_UINT32
  2459. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2460. * reception of an ACK or BA, this field indicates
  2461. * the RSSI of the received ACK or BA frame.
  2462. * When the frame is removed as result of a direct
  2463. * remove command from the SW, this field is set
  2464. * to 0x0 (which is never a valid value when real
  2465. * RSSI is available).
  2466. * Units: dB w.r.t noise floor
  2467. */
  2468. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2469. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2470. rsvd1_31_16: 16;
  2471. } POSTPACK;
  2472. /* DWORD 0 */
  2473. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2474. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2475. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2476. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2477. /* DWORD 1 */
  2478. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2479. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2480. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2481. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2482. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2483. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2484. /* DWORD 0 */
  2485. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2486. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2487. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2488. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2489. do { \
  2490. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2491. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2492. } while (0)
  2493. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2494. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2495. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2496. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2497. do { \
  2498. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2499. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2500. } while (0)
  2501. /* DWORD 1 */
  2502. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2503. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2504. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2505. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2506. do { \
  2507. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2508. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2509. } while (0)
  2510. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2511. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2512. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2513. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2514. do { \
  2515. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2516. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2517. } while (0)
  2518. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2519. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2520. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2521. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2522. do { \
  2523. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2524. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2525. } while (0)
  2526. /**
  2527. * @brief HTT TX WBM Completion from firmware to host
  2528. * @details
  2529. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2530. * (WBM) offload HW.
  2531. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2532. * For software based completions, release_source_module will
  2533. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2534. * struct wbm_release_ring and then switch to this after looking at
  2535. * release_source_module.
  2536. */
  2537. PREPACK struct htt_tx_wbm_completion_v2 {
  2538. A_UINT32
  2539. used_by_hw0; /* Refer to struct wbm_release_ring */
  2540. A_UINT32
  2541. used_by_hw1; /* Refer to struct wbm_release_ring */
  2542. A_UINT32
  2543. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2544. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2545. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2546. exception_frame: 1,
  2547. rsvd0: 12, /* For future use */
  2548. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2549. rsvd1: 1; /* For future use */
  2550. A_UINT32
  2551. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2552. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2553. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2554. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2555. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2556. */
  2557. A_UINT32
  2558. data1: 32;
  2559. A_UINT32
  2560. data2: 32;
  2561. A_UINT32
  2562. used_by_hw3; /* Refer to struct wbm_release_ring */
  2563. } POSTPACK;
  2564. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2565. /* DWORD 3 */
  2566. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2567. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2568. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2569. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2570. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2571. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2572. /* DWORD 3 */
  2573. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2574. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2575. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2576. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2577. do { \
  2578. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2579. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2580. } while (0)
  2581. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2582. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2583. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2584. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2585. do { \
  2586. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2587. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2588. } while (0)
  2589. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2590. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2591. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2592. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2593. do { \
  2594. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2595. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2596. } while (0)
  2597. /**
  2598. * @brief HTT TX WBM Completion from firmware to host (V3)
  2599. * @details
  2600. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2601. * (WBM) offload HW.
  2602. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2603. * For software based completions, release_source_module will
  2604. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2605. * struct wbm_release_ring and then switch to this after looking at
  2606. * release_source_module.
  2607. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2608. * by new generations of targets.
  2609. */
  2610. PREPACK struct htt_tx_wbm_completion_v3 {
  2611. A_UINT32
  2612. used_by_hw0; /* Refer to struct wbm_release_ring */
  2613. A_UINT32
  2614. used_by_hw1; /* Refer to struct wbm_release_ring */
  2615. A_UINT32
  2616. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2617. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2618. used_by_hw3: 15;
  2619. A_UINT32
  2620. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2621. exception_frame: 1,
  2622. rsvd0: 27; /* For future use */
  2623. A_UINT32
  2624. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2625. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2626. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2627. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2628. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2629. */
  2630. A_UINT32
  2631. data1: 32;
  2632. A_UINT32
  2633. data2: 32;
  2634. A_UINT32
  2635. rsvd1: 20,
  2636. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2637. } POSTPACK;
  2638. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2639. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2640. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2641. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2642. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2643. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2644. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2645. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2646. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2647. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2648. do { \
  2649. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2650. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2651. } while (0)
  2652. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2653. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2654. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2655. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2656. do { \
  2657. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2658. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2659. } while (0)
  2660. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2661. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2662. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2663. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2664. do { \
  2665. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2666. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2667. } while (0)
  2668. typedef enum {
  2669. TX_FRAME_TYPE_UNDEFINED = 0,
  2670. TX_FRAME_TYPE_EAPOL = 1,
  2671. } htt_tx_wbm_status_frame_type;
  2672. /**
  2673. * @brief HTT TX WBM transmit status from firmware to host
  2674. * @details
  2675. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2676. * (WBM) offload HW.
  2677. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2678. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2679. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2680. */
  2681. PREPACK struct htt_tx_wbm_transmit_status {
  2682. A_UINT32
  2683. sch_cmd_id: 24,
  2684. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2685. * reception of an ACK or BA, this field indicates
  2686. * the RSSI of the received ACK or BA frame.
  2687. * When the frame is removed as result of a direct
  2688. * remove command from the SW, this field is set
  2689. * to 0x0 (which is never a valid value when real
  2690. * RSSI is available).
  2691. * Units: dB w.r.t noise floor
  2692. */
  2693. A_UINT32
  2694. sw_peer_id: 16,
  2695. tid_num: 5,
  2696. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2697. * and tid_num fields contain valid data.
  2698. * If this "valid" flag is not set, the
  2699. * sw_peer_id and tid_num fields must be ignored.
  2700. */
  2701. mcast: 1,
  2702. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2703. * contains valid data.
  2704. */
  2705. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2706. reserved: 4;
  2707. A_UINT32
  2708. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2709. * packets in the wbm completion path
  2710. */
  2711. } POSTPACK;
  2712. /* DWORD 4 */
  2713. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2714. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2715. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2716. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2717. /* DWORD 5 */
  2718. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2719. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2720. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2721. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2722. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2723. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2724. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2725. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2726. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2727. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2728. /* DWORD 4 */
  2729. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2730. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2731. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2732. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2733. do { \
  2734. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2735. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2736. } while (0)
  2737. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2738. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2739. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2740. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2741. do { \
  2742. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2743. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2744. } while (0)
  2745. /* DWORD 5 */
  2746. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2747. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2748. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2749. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2750. do { \
  2751. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2752. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2753. } while (0)
  2754. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2755. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2756. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2757. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2758. do { \
  2759. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2760. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2761. } while (0)
  2762. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2763. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2764. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2765. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2766. do { \
  2767. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2768. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2769. } while (0)
  2770. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2771. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2772. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2773. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2774. do { \
  2775. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2776. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2777. } while (0)
  2778. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2779. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2780. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2781. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2782. do { \
  2783. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2784. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2785. } while (0)
  2786. /**
  2787. * @brief HTT TX WBM reinject status from firmware to host
  2788. * @details
  2789. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2790. * (WBM) offload HW.
  2791. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2792. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2793. */
  2794. PREPACK struct htt_tx_wbm_reinject_status {
  2795. A_UINT32
  2796. reserved0: 32;
  2797. A_UINT32
  2798. reserved1: 32;
  2799. A_UINT32
  2800. reserved2: 32;
  2801. } POSTPACK;
  2802. /**
  2803. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2804. * @details
  2805. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2806. * (WBM) offload HW.
  2807. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2808. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2809. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2810. * STA side.
  2811. */
  2812. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2813. A_UINT32
  2814. mec_sa_addr_31_0;
  2815. A_UINT32
  2816. mec_sa_addr_47_32: 16,
  2817. sa_ast_index: 16;
  2818. A_UINT32
  2819. vdev_id: 8,
  2820. reserved0: 24;
  2821. } POSTPACK;
  2822. /* DWORD 4 - mec_sa_addr_31_0 */
  2823. /* DWORD 5 */
  2824. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2825. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2826. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2827. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2828. /* DWORD 6 */
  2829. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2830. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2831. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2832. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2833. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2834. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2835. do { \
  2836. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2837. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2838. } while (0)
  2839. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2840. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2841. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2842. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2843. do { \
  2844. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2845. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2846. } while (0)
  2847. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2848. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2849. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2850. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2851. do { \
  2852. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2853. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2854. } while (0)
  2855. typedef enum {
  2856. TX_FLOW_PRIORITY_BE,
  2857. TX_FLOW_PRIORITY_HIGH,
  2858. TX_FLOW_PRIORITY_LOW,
  2859. } htt_tx_flow_priority_t;
  2860. typedef enum {
  2861. TX_FLOW_LATENCY_SENSITIVE,
  2862. TX_FLOW_LATENCY_INSENSITIVE,
  2863. } htt_tx_flow_latency_t;
  2864. typedef enum {
  2865. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2866. TX_FLOW_INTERACTIVE_TRAFFIC,
  2867. TX_FLOW_PERIODIC_TRAFFIC,
  2868. TX_FLOW_BURSTY_TRAFFIC,
  2869. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2870. } htt_tx_flow_traffic_pattern_t;
  2871. /**
  2872. * @brief HTT TX Flow search metadata format
  2873. * @details
  2874. * Host will set this metadata in flow table's flow search entry along with
  2875. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2876. * firmware and TQM ring if the flow search entry wins.
  2877. * This metadata is available to firmware in that first MSDU's
  2878. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2879. * to one of the available flows for specific tid and returns the tqm flow
  2880. * pointer as part of htt_tx_map_flow_info message.
  2881. */
  2882. PREPACK struct htt_tx_flow_metadata {
  2883. A_UINT32
  2884. rsvd0_1_0: 2,
  2885. tid: 4,
  2886. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2887. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2888. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2889. * Else choose final tid based on latency, priority.
  2890. */
  2891. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2892. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2893. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2894. } POSTPACK;
  2895. /* DWORD 0 */
  2896. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2897. #define HTT_TX_FLOW_METADATA_TID_S 2
  2898. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2899. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2900. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2901. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2902. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2903. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2904. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2905. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2906. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2907. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2908. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2909. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2910. /* DWORD 0 */
  2911. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2912. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2913. HTT_TX_FLOW_METADATA_TID_S)
  2914. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2915. do { \
  2916. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2917. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2918. } while (0)
  2919. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2920. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2921. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2922. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2923. do { \
  2924. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2925. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2926. } while (0)
  2927. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2928. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2929. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2930. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2931. do { \
  2932. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2933. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2934. } while (0)
  2935. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2936. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2937. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2938. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2939. do { \
  2940. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2941. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2942. } while (0)
  2943. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2944. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2945. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2946. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2947. do { \
  2948. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2949. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2950. } while (0)
  2951. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2952. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2953. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2954. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2955. do { \
  2956. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2957. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2958. } while (0)
  2959. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2960. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2961. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2962. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2963. do { \
  2964. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2965. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2966. } while (0)
  2967. /**
  2968. * @brief host -> target ADD WDS Entry
  2969. *
  2970. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2971. *
  2972. * @brief host -> target DELETE WDS Entry
  2973. *
  2974. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2975. *
  2976. * @details
  2977. * HTT wds entry from source port learning
  2978. * Host will learn wds entries from rx and send this message to firmware
  2979. * to enable firmware to configure/delete AST entries for wds clients.
  2980. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2981. * and when SA's entry is deleted, firmware removes this AST entry
  2982. *
  2983. * The message would appear as follows:
  2984. *
  2985. * |31 30|29 |17 16|15 8|7 0|
  2986. * |----------------+----------------+----------------+----------------|
  2987. * | rsvd0 |PDVID| vdev_id | msg_type |
  2988. * |-------------------------------------------------------------------|
  2989. * | sa_addr_31_0 |
  2990. * |-------------------------------------------------------------------|
  2991. * | | ta_peer_id | sa_addr_47_32 |
  2992. * |-------------------------------------------------------------------|
  2993. * Where PDVID = pdev_id
  2994. *
  2995. * The message is interpreted as follows:
  2996. *
  2997. * dword0 - b'0:7 - msg_type: This will be set to
  2998. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2999. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3000. *
  3001. * dword0 - b'8:15 - vdev_id
  3002. *
  3003. * dword0 - b'16:17 - pdev_id
  3004. *
  3005. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3006. *
  3007. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3008. *
  3009. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3010. *
  3011. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3012. */
  3013. PREPACK struct htt_wds_entry {
  3014. A_UINT32
  3015. msg_type: 8,
  3016. vdev_id: 8,
  3017. pdev_id: 2,
  3018. rsvd0: 14;
  3019. A_UINT32 sa_addr_31_0;
  3020. A_UINT32
  3021. sa_addr_47_32: 16,
  3022. ta_peer_id: 14,
  3023. rsvd2: 2;
  3024. } POSTPACK;
  3025. /* DWORD 0 */
  3026. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3027. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3028. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3029. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3030. /* DWORD 2 */
  3031. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3032. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3033. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3034. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3035. /* DWORD 0 */
  3036. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3037. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3038. HTT_WDS_ENTRY_VDEV_ID_S)
  3039. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3040. do { \
  3041. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3042. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3043. } while (0)
  3044. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3045. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3046. HTT_WDS_ENTRY_PDEV_ID_S)
  3047. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3048. do { \
  3049. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3050. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3051. } while (0)
  3052. /* DWORD 2 */
  3053. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3054. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3055. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3056. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3057. do { \
  3058. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3059. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3060. } while (0)
  3061. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3062. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3063. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3064. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3065. do { \
  3066. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3067. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3068. } while (0)
  3069. /**
  3070. * @brief MAC DMA rx ring setup specification
  3071. *
  3072. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3073. *
  3074. * @details
  3075. * To allow for dynamic rx ring reconfiguration and to avoid race
  3076. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3077. * it uses. Instead, it sends this message to the target, indicating how
  3078. * the rx ring used by the host should be set up and maintained.
  3079. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3080. * specifications.
  3081. *
  3082. * |31 16|15 8|7 0|
  3083. * |---------------------------------------------------------------|
  3084. * header: | reserved | num rings | msg type |
  3085. * |---------------------------------------------------------------|
  3086. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3087. #if HTT_PADDR64
  3088. * | FW_IDX shadow register physical address (bits 63:32) |
  3089. #endif
  3090. * |---------------------------------------------------------------|
  3091. * | rx ring base physical address (bits 31:0) |
  3092. #if HTT_PADDR64
  3093. * | rx ring base physical address (bits 63:32) |
  3094. #endif
  3095. * |---------------------------------------------------------------|
  3096. * | rx ring buffer size | rx ring length |
  3097. * |---------------------------------------------------------------|
  3098. * | FW_IDX initial value | enabled flags |
  3099. * |---------------------------------------------------------------|
  3100. * | MSDU payload offset | 802.11 header offset |
  3101. * |---------------------------------------------------------------|
  3102. * | PPDU end offset | PPDU start offset |
  3103. * |---------------------------------------------------------------|
  3104. * | MPDU end offset | MPDU start offset |
  3105. * |---------------------------------------------------------------|
  3106. * | MSDU end offset | MSDU start offset |
  3107. * |---------------------------------------------------------------|
  3108. * | frag info offset | rx attention offset |
  3109. * |---------------------------------------------------------------|
  3110. * payload 2, if present, has the same format as payload 1
  3111. * Header fields:
  3112. * - MSG_TYPE
  3113. * Bits 7:0
  3114. * Purpose: identifies this as an rx ring configuration message
  3115. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3116. * - NUM_RINGS
  3117. * Bits 15:8
  3118. * Purpose: indicates whether the host is setting up one rx ring or two
  3119. * Value: 1 or 2
  3120. * Payload:
  3121. * for systems using 64-bit format for bus addresses:
  3122. * - IDX_SHADOW_REG_PADDR_LO
  3123. * Bits 31:0
  3124. * Value: lower 4 bytes of physical address of the host's
  3125. * FW_IDX shadow register
  3126. * - IDX_SHADOW_REG_PADDR_HI
  3127. * Bits 31:0
  3128. * Value: upper 4 bytes of physical address of the host's
  3129. * FW_IDX shadow register
  3130. * - RING_BASE_PADDR_LO
  3131. * Bits 31:0
  3132. * Value: lower 4 bytes of physical address of the host's rx ring
  3133. * - RING_BASE_PADDR_HI
  3134. * Bits 31:0
  3135. * Value: uppper 4 bytes of physical address of the host's rx ring
  3136. * for systems using 32-bit format for bus addresses:
  3137. * - IDX_SHADOW_REG_PADDR
  3138. * Bits 31:0
  3139. * Value: physical address of the host's FW_IDX shadow register
  3140. * - RING_BASE_PADDR
  3141. * Bits 31:0
  3142. * Value: physical address of the host's rx ring
  3143. * - RING_LEN
  3144. * Bits 15:0
  3145. * Value: number of elements in the rx ring
  3146. * - RING_BUF_SZ
  3147. * Bits 31:16
  3148. * Value: size of the buffers referenced by the rx ring, in byte units
  3149. * - ENABLED_FLAGS
  3150. * Bits 15:0
  3151. * Value: 1-bit flags to show whether different rx fields are enabled
  3152. * bit 0: 802.11 header enabled (1) or disabled (0)
  3153. * bit 1: MSDU payload enabled (1) or disabled (0)
  3154. * bit 2: PPDU start enabled (1) or disabled (0)
  3155. * bit 3: PPDU end enabled (1) or disabled (0)
  3156. * bit 4: MPDU start enabled (1) or disabled (0)
  3157. * bit 5: MPDU end enabled (1) or disabled (0)
  3158. * bit 6: MSDU start enabled (1) or disabled (0)
  3159. * bit 7: MSDU end enabled (1) or disabled (0)
  3160. * bit 8: rx attention enabled (1) or disabled (0)
  3161. * bit 9: frag info enabled (1) or disabled (0)
  3162. * bit 10: unicast rx enabled (1) or disabled (0)
  3163. * bit 11: multicast rx enabled (1) or disabled (0)
  3164. * bit 12: ctrl rx enabled (1) or disabled (0)
  3165. * bit 13: mgmt rx enabled (1) or disabled (0)
  3166. * bit 14: null rx enabled (1) or disabled (0)
  3167. * bit 15: phy data rx enabled (1) or disabled (0)
  3168. * - IDX_INIT_VAL
  3169. * Bits 31:16
  3170. * Purpose: Specify the initial value for the FW_IDX.
  3171. * Value: the number of buffers initially present in the host's rx ring
  3172. * - OFFSET_802_11_HDR
  3173. * Bits 15:0
  3174. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3175. * - OFFSET_MSDU_PAYLOAD
  3176. * Bits 31:16
  3177. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3178. * - OFFSET_PPDU_START
  3179. * Bits 15:0
  3180. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3181. * - OFFSET_PPDU_END
  3182. * Bits 31:16
  3183. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3184. * - OFFSET_MPDU_START
  3185. * Bits 15:0
  3186. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3187. * - OFFSET_MPDU_END
  3188. * Bits 31:16
  3189. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3190. * - OFFSET_MSDU_START
  3191. * Bits 15:0
  3192. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3193. * - OFFSET_MSDU_END
  3194. * Bits 31:16
  3195. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3196. * - OFFSET_RX_ATTN
  3197. * Bits 15:0
  3198. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3199. * - OFFSET_FRAG_INFO
  3200. * Bits 31:16
  3201. * Value: offset in QUAD-bytes of frag info table
  3202. */
  3203. /* header fields */
  3204. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3205. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3206. /* payload fields */
  3207. /* for systems using a 64-bit format for bus addresses */
  3208. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3209. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3210. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3211. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3212. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3213. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3214. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3215. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3216. /* for systems using a 32-bit format for bus addresses */
  3217. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3218. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3219. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3220. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3221. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3222. #define HTT_RX_RING_CFG_LEN_S 0
  3223. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3224. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3225. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3226. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3227. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3228. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3229. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3230. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3231. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3232. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3233. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3234. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3235. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3236. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3237. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3238. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3239. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3240. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3241. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3242. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3243. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3244. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3245. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3246. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3247. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3248. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3249. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3250. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3251. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3252. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3253. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3254. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3255. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3256. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3257. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3258. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3259. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3260. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3261. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3262. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3263. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3264. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3265. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3266. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3267. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3268. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3269. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3270. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3271. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3272. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3273. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3274. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3275. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3276. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3277. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3278. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3279. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3280. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3281. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3282. #if HTT_PADDR64
  3283. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3284. #else
  3285. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3286. #endif
  3287. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3288. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3289. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3290. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3291. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3292. do { \
  3293. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3294. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3295. } while (0)
  3296. /* degenerate case for 32-bit fields */
  3297. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3298. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3299. ((_var) = (_val))
  3300. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3301. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3302. ((_var) = (_val))
  3303. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3304. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3305. ((_var) = (_val))
  3306. /* degenerate case for 32-bit fields */
  3307. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3308. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3309. ((_var) = (_val))
  3310. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3311. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3312. ((_var) = (_val))
  3313. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3314. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3315. ((_var) = (_val))
  3316. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3317. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3318. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3319. do { \
  3320. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3321. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3322. } while (0)
  3323. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3324. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3325. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3326. do { \
  3327. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3328. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3329. } while (0)
  3330. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3331. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3332. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3333. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3334. do { \
  3335. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3336. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3337. } while (0)
  3338. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3339. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3340. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3341. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3342. do { \
  3343. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3344. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3345. } while (0)
  3346. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3347. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3348. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3349. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3350. do { \
  3351. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3352. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3353. } while (0)
  3354. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3355. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3356. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3357. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3358. do { \
  3359. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3360. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3361. } while (0)
  3362. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3363. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3364. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3365. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3366. do { \
  3367. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3368. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3369. } while (0)
  3370. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3371. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3372. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3373. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3374. do { \
  3375. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3376. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3377. } while (0)
  3378. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3379. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3380. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3381. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3382. do { \
  3383. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3384. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3385. } while (0)
  3386. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3387. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3388. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3389. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3390. do { \
  3391. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3392. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3393. } while (0)
  3394. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3395. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3396. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3397. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3398. do { \
  3399. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3400. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3401. } while (0)
  3402. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3403. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3404. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3405. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3406. do { \
  3407. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3408. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3409. } while (0)
  3410. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3411. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3412. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3413. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3414. do { \
  3415. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3416. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3417. } while (0)
  3418. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3419. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3420. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3421. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3422. do { \
  3423. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3424. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3425. } while (0)
  3426. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3427. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3428. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3429. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3430. do { \
  3431. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3432. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3433. } while (0)
  3434. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3435. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3436. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3437. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3438. do { \
  3439. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3440. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3441. } while (0)
  3442. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3443. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3444. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3445. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3446. do { \
  3447. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3448. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3449. } while (0)
  3450. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3451. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3452. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3453. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3454. do { \
  3455. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3456. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3457. } while (0)
  3458. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3459. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3460. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3461. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3462. do { \
  3463. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3464. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3465. } while (0)
  3466. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3467. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3468. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3469. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3470. do { \
  3471. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3472. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3473. } while (0)
  3474. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3475. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3476. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3477. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3478. do { \
  3479. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3480. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3481. } while (0)
  3482. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3483. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3484. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3485. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3486. do { \
  3487. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3488. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3489. } while (0)
  3490. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3491. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3492. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3493. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3494. do { \
  3495. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3496. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3497. } while (0)
  3498. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3499. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3500. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3501. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3502. do { \
  3503. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3504. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3505. } while (0)
  3506. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3507. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3508. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3509. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3510. do { \
  3511. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3512. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3513. } while (0)
  3514. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3515. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3516. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3517. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3518. do { \
  3519. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3520. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3521. } while (0)
  3522. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3523. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3524. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3525. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3526. do { \
  3527. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3528. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3529. } while (0)
  3530. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3531. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3532. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3533. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3534. do { \
  3535. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3536. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3537. } while (0)
  3538. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3539. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3540. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3541. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3542. do { \
  3543. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3544. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3545. } while (0)
  3546. /**
  3547. * @brief host -> target FW statistics retrieve
  3548. *
  3549. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3550. *
  3551. * @details
  3552. * The following field definitions describe the format of the HTT host
  3553. * to target FW stats retrieve message. The message specifies the type of
  3554. * stats host wants to retrieve.
  3555. *
  3556. * |31 24|23 16|15 8|7 0|
  3557. * |-----------------------------------------------------------|
  3558. * | stats types request bitmask | msg type |
  3559. * |-----------------------------------------------------------|
  3560. * | stats types reset bitmask | reserved |
  3561. * |-----------------------------------------------------------|
  3562. * | stats type | config value |
  3563. * |-----------------------------------------------------------|
  3564. * | cookie LSBs |
  3565. * |-----------------------------------------------------------|
  3566. * | cookie MSBs |
  3567. * |-----------------------------------------------------------|
  3568. * Header fields:
  3569. * - MSG_TYPE
  3570. * Bits 7:0
  3571. * Purpose: identifies this is a stats upload request message
  3572. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3573. * - UPLOAD_TYPES
  3574. * Bits 31:8
  3575. * Purpose: identifies which types of FW statistics to upload
  3576. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3577. * - RESET_TYPES
  3578. * Bits 31:8
  3579. * Purpose: identifies which types of FW statistics to reset
  3580. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3581. * - CFG_VAL
  3582. * Bits 23:0
  3583. * Purpose: give an opaque configuration value to the specified stats type
  3584. * Value: stats-type specific configuration value
  3585. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3586. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3587. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3588. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3589. * - CFG_STAT_TYPE
  3590. * Bits 31:24
  3591. * Purpose: specify which stats type (if any) the config value applies to
  3592. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3593. * a valid configuration specification
  3594. * - COOKIE_LSBS
  3595. * Bits 31:0
  3596. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3597. * message with its preceding host->target stats request message.
  3598. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3599. * - COOKIE_MSBS
  3600. * Bits 31:0
  3601. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3602. * message with its preceding host->target stats request message.
  3603. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3604. */
  3605. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3606. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3607. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3608. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3609. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3610. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3611. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3612. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3613. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3614. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3615. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3616. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3617. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3618. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3619. do { \
  3620. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3621. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3622. } while (0)
  3623. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3624. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3625. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3626. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3627. do { \
  3628. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3629. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3630. } while (0)
  3631. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3632. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3633. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3634. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3635. do { \
  3636. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3637. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3638. } while (0)
  3639. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3640. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3641. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3642. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3643. do { \
  3644. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3645. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3646. } while (0)
  3647. /**
  3648. * @brief host -> target HTT out-of-band sync request
  3649. *
  3650. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3651. *
  3652. * @details
  3653. * The HTT SYNC tells the target to suspend processing of subsequent
  3654. * HTT host-to-target messages until some other target agent locally
  3655. * informs the target HTT FW that the current sync counter is equal to
  3656. * or greater than (in a modulo sense) the sync counter specified in
  3657. * the SYNC message.
  3658. * This allows other host-target components to synchronize their operation
  3659. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3660. * security key has been downloaded to and activated by the target.
  3661. * In the absence of any explicit synchronization counter value
  3662. * specification, the target HTT FW will use zero as the default current
  3663. * sync value.
  3664. *
  3665. * |31 24|23 16|15 8|7 0|
  3666. * |-----------------------------------------------------------|
  3667. * | reserved | sync count | msg type |
  3668. * |-----------------------------------------------------------|
  3669. * Header fields:
  3670. * - MSG_TYPE
  3671. * Bits 7:0
  3672. * Purpose: identifies this as a sync message
  3673. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3674. * - SYNC_COUNT
  3675. * Bits 15:8
  3676. * Purpose: specifies what sync value the HTT FW will wait for from
  3677. * an out-of-band specification to resume its operation
  3678. * Value: in-band sync counter value to compare against the out-of-band
  3679. * counter spec.
  3680. * The HTT target FW will suspend its host->target message processing
  3681. * as long as
  3682. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3683. */
  3684. #define HTT_H2T_SYNC_MSG_SZ 4
  3685. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3686. #define HTT_H2T_SYNC_COUNT_S 8
  3687. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3688. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3689. HTT_H2T_SYNC_COUNT_S)
  3690. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3691. do { \
  3692. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3693. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3694. } while (0)
  3695. /**
  3696. * @brief host -> target HTT aggregation configuration
  3697. *
  3698. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3699. */
  3700. #define HTT_AGGR_CFG_MSG_SZ 4
  3701. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3702. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3703. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3704. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3705. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3706. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3707. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3708. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3709. do { \
  3710. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3711. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3712. } while (0)
  3713. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3714. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3715. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3716. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3717. do { \
  3718. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3719. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3720. } while (0)
  3721. /**
  3722. * @brief host -> target HTT configure max amsdu info per vdev
  3723. *
  3724. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3725. *
  3726. * @details
  3727. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3728. *
  3729. * |31 21|20 16|15 8|7 0|
  3730. * |-----------------------------------------------------------|
  3731. * | reserved | vdev id | max amsdu | msg type |
  3732. * |-----------------------------------------------------------|
  3733. * Header fields:
  3734. * - MSG_TYPE
  3735. * Bits 7:0
  3736. * Purpose: identifies this as a aggr cfg ex message
  3737. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3738. * - MAX_NUM_AMSDU_SUBFRM
  3739. * Bits 15:8
  3740. * Purpose: max MSDUs per A-MSDU
  3741. * - VDEV_ID
  3742. * Bits 20:16
  3743. * Purpose: ID of the vdev to which this limit is applied
  3744. */
  3745. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3746. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3747. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3748. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3749. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3750. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3751. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3752. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3753. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3754. do { \
  3755. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3756. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3757. } while (0)
  3758. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3759. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3760. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3761. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3762. do { \
  3763. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3764. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3765. } while (0)
  3766. /**
  3767. * @brief HTT WDI_IPA Config Message
  3768. *
  3769. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3770. *
  3771. * @details
  3772. * The HTT WDI_IPA config message is created/sent by host at driver
  3773. * init time. It contains information about data structures used on
  3774. * WDI_IPA TX and RX path.
  3775. * TX CE ring is used for pushing packet metadata from IPA uC
  3776. * to WLAN FW
  3777. * TX Completion ring is used for generating TX completions from
  3778. * WLAN FW to IPA uC
  3779. * RX Indication ring is used for indicating RX packets from FW
  3780. * to IPA uC
  3781. * RX Ring2 is used as either completion ring or as second
  3782. * indication ring. when Ring2 is used as completion ring, IPA uC
  3783. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3784. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3785. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3786. * indicated in RX Indication ring. Please see WDI_IPA specification
  3787. * for more details.
  3788. * |31 24|23 16|15 8|7 0|
  3789. * |----------------+----------------+----------------+----------------|
  3790. * | tx pkt pool size | Rsvd | msg_type |
  3791. * |-------------------------------------------------------------------|
  3792. * | tx comp ring base (bits 31:0) |
  3793. #if HTT_PADDR64
  3794. * | tx comp ring base (bits 63:32) |
  3795. #endif
  3796. * |-------------------------------------------------------------------|
  3797. * | tx comp ring size |
  3798. * |-------------------------------------------------------------------|
  3799. * | tx comp WR_IDX physical address (bits 31:0) |
  3800. #if HTT_PADDR64
  3801. * | tx comp WR_IDX physical address (bits 63:32) |
  3802. #endif
  3803. * |-------------------------------------------------------------------|
  3804. * | tx CE WR_IDX physical address (bits 31:0) |
  3805. #if HTT_PADDR64
  3806. * | tx CE WR_IDX physical address (bits 63:32) |
  3807. #endif
  3808. * |-------------------------------------------------------------------|
  3809. * | rx indication ring base (bits 31:0) |
  3810. #if HTT_PADDR64
  3811. * | rx indication ring base (bits 63:32) |
  3812. #endif
  3813. * |-------------------------------------------------------------------|
  3814. * | rx indication ring size |
  3815. * |-------------------------------------------------------------------|
  3816. * | rx ind RD_IDX physical address (bits 31:0) |
  3817. #if HTT_PADDR64
  3818. * | rx ind RD_IDX physical address (bits 63:32) |
  3819. #endif
  3820. * |-------------------------------------------------------------------|
  3821. * | rx ind WR_IDX physical address (bits 31:0) |
  3822. #if HTT_PADDR64
  3823. * | rx ind WR_IDX physical address (bits 63:32) |
  3824. #endif
  3825. * |-------------------------------------------------------------------|
  3826. * |-------------------------------------------------------------------|
  3827. * | rx ring2 base (bits 31:0) |
  3828. #if HTT_PADDR64
  3829. * | rx ring2 base (bits 63:32) |
  3830. #endif
  3831. * |-------------------------------------------------------------------|
  3832. * | rx ring2 size |
  3833. * |-------------------------------------------------------------------|
  3834. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3835. #if HTT_PADDR64
  3836. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3837. #endif
  3838. * |-------------------------------------------------------------------|
  3839. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3840. #if HTT_PADDR64
  3841. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3842. #endif
  3843. * |-------------------------------------------------------------------|
  3844. *
  3845. * Header fields:
  3846. * Header fields:
  3847. * - MSG_TYPE
  3848. * Bits 7:0
  3849. * Purpose: Identifies this as WDI_IPA config message
  3850. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3851. * - TX_PKT_POOL_SIZE
  3852. * Bits 15:0
  3853. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3854. * WDI_IPA TX path
  3855. * For systems using 32-bit format for bus addresses:
  3856. * - TX_COMP_RING_BASE_ADDR
  3857. * Bits 31:0
  3858. * Purpose: TX Completion Ring base address in DDR
  3859. * - TX_COMP_RING_SIZE
  3860. * Bits 31:0
  3861. * Purpose: TX Completion Ring size (must be power of 2)
  3862. * - TX_COMP_WR_IDX_ADDR
  3863. * Bits 31:0
  3864. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3865. * updates the Write Index for WDI_IPA TX completion ring
  3866. * - TX_CE_WR_IDX_ADDR
  3867. * Bits 31:0
  3868. * Purpose: DDR address where IPA uC
  3869. * updates the WR Index for TX CE ring
  3870. * (needed for fusion platforms)
  3871. * - RX_IND_RING_BASE_ADDR
  3872. * Bits 31:0
  3873. * Purpose: RX Indication Ring base address in DDR
  3874. * - RX_IND_RING_SIZE
  3875. * Bits 31:0
  3876. * Purpose: RX Indication Ring size
  3877. * - RX_IND_RD_IDX_ADDR
  3878. * Bits 31:0
  3879. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3880. * RX indication ring
  3881. * - RX_IND_WR_IDX_ADDR
  3882. * Bits 31:0
  3883. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3884. * updates the Write Index for WDI_IPA RX indication ring
  3885. * - RX_RING2_BASE_ADDR
  3886. * Bits 31:0
  3887. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3888. * - RX_RING2_SIZE
  3889. * Bits 31:0
  3890. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3891. * - RX_RING2_RD_IDX_ADDR
  3892. * Bits 31:0
  3893. * Purpose: If Second RX ring is Indication ring, DDR address where
  3894. * IPA uC updates the Read Index for Ring2.
  3895. * If Second RX ring is completion ring, this is NOT used
  3896. * - RX_RING2_WR_IDX_ADDR
  3897. * Bits 31:0
  3898. * Purpose: If Second RX ring is Indication ring, DDR address where
  3899. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3900. * If second RX ring is completion ring, DDR address where
  3901. * IPA uC updates the Write Index for Ring 2.
  3902. * For systems using 64-bit format for bus addresses:
  3903. * - TX_COMP_RING_BASE_ADDR_LO
  3904. * Bits 31:0
  3905. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3906. * - TX_COMP_RING_BASE_ADDR_HI
  3907. * Bits 31:0
  3908. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3909. * - TX_COMP_RING_SIZE
  3910. * Bits 31:0
  3911. * Purpose: TX Completion Ring size (must be power of 2)
  3912. * - TX_COMP_WR_IDX_ADDR_LO
  3913. * Bits 31:0
  3914. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3915. * Lower 4 bytes of DDR address where WIFI FW
  3916. * updates the Write Index for WDI_IPA TX completion ring
  3917. * - TX_COMP_WR_IDX_ADDR_HI
  3918. * Bits 31:0
  3919. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3920. * Higher 4 bytes of DDR address where WIFI FW
  3921. * updates the Write Index for WDI_IPA TX completion ring
  3922. * - TX_CE_WR_IDX_ADDR_LO
  3923. * Bits 31:0
  3924. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3925. * updates the WR Index for TX CE ring
  3926. * (needed for fusion platforms)
  3927. * - TX_CE_WR_IDX_ADDR_HI
  3928. * Bits 31:0
  3929. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3930. * updates the WR Index for TX CE ring
  3931. * (needed for fusion platforms)
  3932. * - RX_IND_RING_BASE_ADDR_LO
  3933. * Bits 31:0
  3934. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3935. * - RX_IND_RING_BASE_ADDR_HI
  3936. * Bits 31:0
  3937. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3938. * - RX_IND_RING_SIZE
  3939. * Bits 31:0
  3940. * Purpose: RX Indication Ring size
  3941. * - RX_IND_RD_IDX_ADDR_LO
  3942. * Bits 31:0
  3943. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3944. * for WDI_IPA RX indication ring
  3945. * - RX_IND_RD_IDX_ADDR_HI
  3946. * Bits 31:0
  3947. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3948. * for WDI_IPA RX indication ring
  3949. * - RX_IND_WR_IDX_ADDR_LO
  3950. * Bits 31:0
  3951. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3952. * Lower 4 bytes of DDR address where WIFI FW
  3953. * updates the Write Index for WDI_IPA RX indication ring
  3954. * - RX_IND_WR_IDX_ADDR_HI
  3955. * Bits 31:0
  3956. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3957. * Higher 4 bytes of DDR address where WIFI FW
  3958. * updates the Write Index for WDI_IPA RX indication ring
  3959. * - RX_RING2_BASE_ADDR_LO
  3960. * Bits 31:0
  3961. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3962. * - RX_RING2_BASE_ADDR_HI
  3963. * Bits 31:0
  3964. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3965. * - RX_RING2_SIZE
  3966. * Bits 31:0
  3967. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3968. * - RX_RING2_RD_IDX_ADDR_LO
  3969. * Bits 31:0
  3970. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3971. * DDR address where IPA uC updates the Read Index for Ring2.
  3972. * If Second RX ring is completion ring, this is NOT used
  3973. * - RX_RING2_RD_IDX_ADDR_HI
  3974. * Bits 31:0
  3975. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3976. * DDR address where IPA uC updates the Read Index for Ring2.
  3977. * If Second RX ring is completion ring, this is NOT used
  3978. * - RX_RING2_WR_IDX_ADDR_LO
  3979. * Bits 31:0
  3980. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3981. * DDR address where WIFI FW updates the Write Index
  3982. * for WDI_IPA RX ring2
  3983. * If second RX ring is completion ring, lower 4 bytes of
  3984. * DDR address where IPA uC updates the Write Index for Ring 2.
  3985. * - RX_RING2_WR_IDX_ADDR_HI
  3986. * Bits 31:0
  3987. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3988. * DDR address where WIFI FW updates the Write Index
  3989. * for WDI_IPA RX ring2
  3990. * If second RX ring is completion ring, higher 4 bytes of
  3991. * DDR address where IPA uC updates the Write Index for Ring 2.
  3992. */
  3993. #if HTT_PADDR64
  3994. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3995. #else
  3996. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3997. #endif
  3998. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3999. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4000. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4001. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4002. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4003. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4004. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4005. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4006. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4007. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4008. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4009. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4010. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4011. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4012. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4013. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4014. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4015. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4016. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4017. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4018. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4019. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4020. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4021. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4022. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4023. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4024. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4025. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4026. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4027. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4028. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4029. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4030. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4031. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4032. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4033. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4034. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4035. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4036. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4037. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4038. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4039. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4040. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4041. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4042. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4043. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4044. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4045. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4046. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4047. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4048. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4049. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4050. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4051. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4052. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4053. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4054. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4055. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4056. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4057. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4058. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4059. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4060. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4061. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4062. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4063. do { \
  4064. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4065. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4066. } while (0)
  4067. /* for systems using 32-bit format for bus addr */
  4068. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4069. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4070. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4071. do { \
  4072. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4073. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4074. } while (0)
  4075. /* for systems using 64-bit format for bus addr */
  4076. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4077. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4078. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4079. do { \
  4080. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4081. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4082. } while (0)
  4083. /* for systems using 64-bit format for bus addr */
  4084. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4085. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4086. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4087. do { \
  4088. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4089. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4090. } while (0)
  4091. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4092. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4093. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4094. do { \
  4095. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4096. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4097. } while (0)
  4098. /* for systems using 32-bit format for bus addr */
  4099. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4100. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4101. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4102. do { \
  4103. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4104. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4105. } while (0)
  4106. /* for systems using 64-bit format for bus addr */
  4107. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4108. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4109. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4110. do { \
  4111. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4112. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4113. } while (0)
  4114. /* for systems using 64-bit format for bus addr */
  4115. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4116. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4117. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4118. do { \
  4119. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4120. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4121. } while (0)
  4122. /* for systems using 32-bit format for bus addr */
  4123. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4124. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4125. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4126. do { \
  4127. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4128. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4129. } while (0)
  4130. /* for systems using 64-bit format for bus addr */
  4131. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4132. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4133. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4134. do { \
  4135. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4136. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4137. } while (0)
  4138. /* for systems using 64-bit format for bus addr */
  4139. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4140. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4141. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4142. do { \
  4143. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4144. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4145. } while (0)
  4146. /* for systems using 32-bit format for bus addr */
  4147. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4148. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4149. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4150. do { \
  4151. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4152. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4153. } while (0)
  4154. /* for systems using 64-bit format for bus addr */
  4155. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4156. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4157. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4158. do { \
  4159. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4160. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4161. } while (0)
  4162. /* for systems using 64-bit format for bus addr */
  4163. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4164. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4165. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4166. do { \
  4167. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4168. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4169. } while (0)
  4170. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4171. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4172. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4173. do { \
  4174. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4175. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4176. } while (0)
  4177. /* for systems using 32-bit format for bus addr */
  4178. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4179. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4180. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4181. do { \
  4182. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4183. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4184. } while (0)
  4185. /* for systems using 64-bit format for bus addr */
  4186. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4187. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4188. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4189. do { \
  4190. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4191. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4192. } while (0)
  4193. /* for systems using 64-bit format for bus addr */
  4194. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4195. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4196. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4197. do { \
  4198. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4199. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4200. } while (0)
  4201. /* for systems using 32-bit format for bus addr */
  4202. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4203. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4204. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4205. do { \
  4206. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4207. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4208. } while (0)
  4209. /* for systems using 64-bit format for bus addr */
  4210. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4211. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4212. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4213. do { \
  4214. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4215. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4216. } while (0)
  4217. /* for systems using 64-bit format for bus addr */
  4218. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4219. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4220. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4221. do { \
  4222. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4223. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4224. } while (0)
  4225. /* for systems using 32-bit format for bus addr */
  4226. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4227. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4228. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4229. do { \
  4230. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4231. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4232. } while (0)
  4233. /* for systems using 64-bit format for bus addr */
  4234. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4235. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4236. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4237. do { \
  4238. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4239. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4240. } while (0)
  4241. /* for systems using 64-bit format for bus addr */
  4242. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4243. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4244. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4245. do { \
  4246. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4247. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4248. } while (0)
  4249. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4250. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4251. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4252. do { \
  4253. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4254. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4255. } while (0)
  4256. /* for systems using 32-bit format for bus addr */
  4257. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4258. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4259. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4260. do { \
  4261. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4262. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4263. } while (0)
  4264. /* for systems using 64-bit format for bus addr */
  4265. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4266. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4267. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4268. do { \
  4269. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4270. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4271. } while (0)
  4272. /* for systems using 64-bit format for bus addr */
  4273. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4274. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4275. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4276. do { \
  4277. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4278. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4279. } while (0)
  4280. /* for systems using 32-bit format for bus addr */
  4281. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4282. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4283. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4284. do { \
  4285. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4286. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4287. } while (0)
  4288. /* for systems using 64-bit format for bus addr */
  4289. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4290. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4291. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4292. do { \
  4293. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4294. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4295. } while (0)
  4296. /* for systems using 64-bit format for bus addr */
  4297. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4298. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4299. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4300. do { \
  4301. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4302. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4303. } while (0)
  4304. /*
  4305. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4306. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4307. * addresses are stored in a XXX-bit field.
  4308. * This macro is used to define both htt_wdi_ipa_config32_t and
  4309. * htt_wdi_ipa_config64_t structs.
  4310. */
  4311. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4312. _paddr__tx_comp_ring_base_addr_, \
  4313. _paddr__tx_comp_wr_idx_addr_, \
  4314. _paddr__tx_ce_wr_idx_addr_, \
  4315. _paddr__rx_ind_ring_base_addr_, \
  4316. _paddr__rx_ind_rd_idx_addr_, \
  4317. _paddr__rx_ind_wr_idx_addr_, \
  4318. _paddr__rx_ring2_base_addr_,\
  4319. _paddr__rx_ring2_rd_idx_addr_,\
  4320. _paddr__rx_ring2_wr_idx_addr_) \
  4321. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4322. { \
  4323. /* DWORD 0: flags and meta-data */ \
  4324. A_UINT32 \
  4325. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4326. reserved: 8, \
  4327. tx_pkt_pool_size: 16;\
  4328. /* DWORD 1 */\
  4329. _paddr__tx_comp_ring_base_addr_;\
  4330. /* DWORD 2 (or 3)*/\
  4331. A_UINT32 tx_comp_ring_size;\
  4332. /* DWORD 3 (or 4)*/\
  4333. _paddr__tx_comp_wr_idx_addr_;\
  4334. /* DWORD 4 (or 6)*/\
  4335. _paddr__tx_ce_wr_idx_addr_;\
  4336. /* DWORD 5 (or 8)*/\
  4337. _paddr__rx_ind_ring_base_addr_;\
  4338. /* DWORD 6 (or 10)*/\
  4339. A_UINT32 rx_ind_ring_size;\
  4340. /* DWORD 7 (or 11)*/\
  4341. _paddr__rx_ind_rd_idx_addr_;\
  4342. /* DWORD 8 (or 13)*/\
  4343. _paddr__rx_ind_wr_idx_addr_;\
  4344. /* DWORD 9 (or 15)*/\
  4345. _paddr__rx_ring2_base_addr_;\
  4346. /* DWORD 10 (or 17) */\
  4347. A_UINT32 rx_ring2_size;\
  4348. /* DWORD 11 (or 18) */\
  4349. _paddr__rx_ring2_rd_idx_addr_;\
  4350. /* DWORD 12 (or 20) */\
  4351. _paddr__rx_ring2_wr_idx_addr_;\
  4352. } POSTPACK
  4353. /* define a htt_wdi_ipa_config32_t type */
  4354. 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));
  4355. /* define a htt_wdi_ipa_config64_t type */
  4356. 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));
  4357. #if HTT_PADDR64
  4358. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4359. #else
  4360. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4361. #endif
  4362. enum htt_wdi_ipa_op_code {
  4363. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4364. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4365. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4366. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4367. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4368. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4369. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4370. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4371. /* keep this last */
  4372. HTT_WDI_IPA_OPCODE_MAX
  4373. };
  4374. /**
  4375. * @brief HTT WDI_IPA Operation Request Message
  4376. *
  4377. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4378. *
  4379. * @details
  4380. * HTT WDI_IPA Operation Request message is sent by host
  4381. * to either suspend or resume WDI_IPA TX or RX path.
  4382. * |31 24|23 16|15 8|7 0|
  4383. * |----------------+----------------+----------------+----------------|
  4384. * | op_code | Rsvd | msg_type |
  4385. * |-------------------------------------------------------------------|
  4386. *
  4387. * Header fields:
  4388. * - MSG_TYPE
  4389. * Bits 7:0
  4390. * Purpose: Identifies this as WDI_IPA Operation Request message
  4391. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4392. * - OP_CODE
  4393. * Bits 31:16
  4394. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4395. * value: = enum htt_wdi_ipa_op_code
  4396. */
  4397. PREPACK struct htt_wdi_ipa_op_request_t
  4398. {
  4399. /* DWORD 0: flags and meta-data */
  4400. A_UINT32
  4401. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4402. reserved: 8,
  4403. op_code: 16;
  4404. } POSTPACK;
  4405. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4406. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4407. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4408. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4409. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4410. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4411. do { \
  4412. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4413. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4414. } while (0)
  4415. /*
  4416. * @brief host -> target HTT_MSI_SETUP message
  4417. *
  4418. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4419. *
  4420. * @details
  4421. * After target is booted up, host can send MSI setup message so that
  4422. * target sets up HW registers based on setup message.
  4423. *
  4424. * The message would appear as follows:
  4425. * |31 24|23 16|15|14 8|7 0|
  4426. * |---------------+-----------------+-----------------+-----------------|
  4427. * | reserved | msi_type | pdev_id | msg_type |
  4428. * |---------------------------------------------------------------------|
  4429. * | msi_addr_lo |
  4430. * |---------------------------------------------------------------------|
  4431. * | msi_addr_hi |
  4432. * |---------------------------------------------------------------------|
  4433. * | msi_data |
  4434. * |---------------------------------------------------------------------|
  4435. *
  4436. * The message is interpreted as follows:
  4437. * dword0 - b'0:7 - msg_type: This will be set to
  4438. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4439. * b'8:15 - pdev_id:
  4440. * 0 (for rings at SOC/UMAC level),
  4441. * 1/2/3 mac id (for rings at LMAC level)
  4442. * b'16:23 - msi_type: identify which msi registers need to be setup
  4443. * more details can be got from enum htt_msi_setup_type
  4444. * b'24:31 - reserved
  4445. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4446. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4447. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4448. */
  4449. PREPACK struct htt_msi_setup_t {
  4450. A_UINT32 msg_type: 8,
  4451. pdev_id: 8,
  4452. msi_type: 8,
  4453. reserved: 8;
  4454. A_UINT32 msi_addr_lo;
  4455. A_UINT32 msi_addr_hi;
  4456. A_UINT32 msi_data;
  4457. } POSTPACK;
  4458. enum htt_msi_setup_type {
  4459. HTT_PPDU_END_MSI_SETUP_TYPE,
  4460. /* Insert new types here*/
  4461. };
  4462. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4463. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4464. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4465. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4466. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4467. HTT_MSI_SETUP_PDEV_ID_S)
  4468. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4469. do { \
  4470. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4471. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4472. } while (0)
  4473. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4474. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4475. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4476. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4477. HTT_MSI_SETUP_MSI_TYPE_S)
  4478. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4479. do { \
  4480. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4481. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4482. } while (0)
  4483. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4484. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4485. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4486. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4487. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4488. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4489. do { \
  4490. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4491. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4492. } while (0)
  4493. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4494. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4495. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4496. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4497. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4498. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4499. do { \
  4500. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4501. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4502. } while (0)
  4503. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4504. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4505. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4506. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4507. HTT_MSI_SETUP_MSI_DATA_S)
  4508. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4509. do { \
  4510. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4511. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4512. } while (0)
  4513. /*
  4514. * @brief host -> target HTT_SRING_SETUP message
  4515. *
  4516. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4517. *
  4518. * @details
  4519. * After target is booted up, Host can send SRING setup message for
  4520. * each host facing LMAC SRING. Target setups up HW registers based
  4521. * on setup message and confirms back to Host if response_required is set.
  4522. * Host should wait for confirmation message before sending new SRING
  4523. * setup message
  4524. *
  4525. * The message would appear as follows:
  4526. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4527. * |--------------- +-----------------+-----------------+-----------------|
  4528. * | ring_type | ring_id | pdev_id | msg_type |
  4529. * |----------------------------------------------------------------------|
  4530. * | ring_base_addr_lo |
  4531. * |----------------------------------------------------------------------|
  4532. * | ring_base_addr_hi |
  4533. * |----------------------------------------------------------------------|
  4534. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4535. * |----------------------------------------------------------------------|
  4536. * | ring_head_offset32_remote_addr_lo |
  4537. * |----------------------------------------------------------------------|
  4538. * | ring_head_offset32_remote_addr_hi |
  4539. * |----------------------------------------------------------------------|
  4540. * | ring_tail_offset32_remote_addr_lo |
  4541. * |----------------------------------------------------------------------|
  4542. * | ring_tail_offset32_remote_addr_hi |
  4543. * |----------------------------------------------------------------------|
  4544. * | ring_msi_addr_lo |
  4545. * |----------------------------------------------------------------------|
  4546. * | ring_msi_addr_hi |
  4547. * |----------------------------------------------------------------------|
  4548. * | ring_msi_data |
  4549. * |----------------------------------------------------------------------|
  4550. * | intr_timer_th |IM| intr_batch_counter_th |
  4551. * |----------------------------------------------------------------------|
  4552. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4553. * |----------------------------------------------------------------------|
  4554. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4555. * |----------------------------------------------------------------------|
  4556. * Where
  4557. * IM = sw_intr_mode
  4558. * RR = response_required
  4559. * PTCF = prefetch_timer_cfg
  4560. * IP = IPA drop flag
  4561. *
  4562. * The message is interpreted as follows:
  4563. * dword0 - b'0:7 - msg_type: This will be set to
  4564. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4565. * b'8:15 - pdev_id:
  4566. * 0 (for rings at SOC/UMAC level),
  4567. * 1/2/3 mac id (for rings at LMAC level)
  4568. * b'16:23 - ring_id: identify which ring is to setup,
  4569. * more details can be got from enum htt_srng_ring_id
  4570. * b'24:31 - ring_type: identify type of host rings,
  4571. * more details can be got from enum htt_srng_ring_type
  4572. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4573. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4574. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4575. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4576. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4577. * SW_TO_HW_RING.
  4578. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4579. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4580. * Lower 32 bits of memory address of the remote variable
  4581. * storing the 4-byte word offset that identifies the head
  4582. * element within the ring.
  4583. * (The head offset variable has type A_UINT32.)
  4584. * Valid for HW_TO_SW and SW_TO_SW rings.
  4585. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4586. * Upper 32 bits of memory address of the remote variable
  4587. * storing the 4-byte word offset that identifies the head
  4588. * element within the ring.
  4589. * (The head offset variable has type A_UINT32.)
  4590. * Valid for HW_TO_SW and SW_TO_SW rings.
  4591. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4592. * Lower 32 bits of memory address of the remote variable
  4593. * storing the 4-byte word offset that identifies the tail
  4594. * element within the ring.
  4595. * (The tail offset variable has type A_UINT32.)
  4596. * Valid for HW_TO_SW and SW_TO_SW rings.
  4597. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4598. * Upper 32 bits of memory address of the remote variable
  4599. * storing the 4-byte word offset that identifies the tail
  4600. * element within the ring.
  4601. * (The tail offset variable has type A_UINT32.)
  4602. * Valid for HW_TO_SW and SW_TO_SW rings.
  4603. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4604. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4605. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4606. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4607. * dword10 - b'0:31 - ring_msi_data: MSI data
  4608. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4609. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4610. * dword11 - b'0:14 - intr_batch_counter_th:
  4611. * batch counter threshold is in units of 4-byte words.
  4612. * HW internally maintains and increments batch count.
  4613. * (see SRING spec for detail description).
  4614. * When batch count reaches threshold value, an interrupt
  4615. * is generated by HW.
  4616. * b'15 - sw_intr_mode:
  4617. * This configuration shall be static.
  4618. * Only programmed at power up.
  4619. * 0: generate pulse style sw interrupts
  4620. * 1: generate level style sw interrupts
  4621. * b'16:31 - intr_timer_th:
  4622. * The timer init value when timer is idle or is
  4623. * initialized to start downcounting.
  4624. * In 8us units (to cover a range of 0 to 524 ms)
  4625. * dword12 - b'0:15 - intr_low_threshold:
  4626. * Used only by Consumer ring to generate ring_sw_int_p.
  4627. * Ring entries low threshold water mark, that is used
  4628. * in combination with the interrupt timer as well as
  4629. * the the clearing of the level interrupt.
  4630. * b'16:18 - prefetch_timer_cfg:
  4631. * Used only by Consumer ring to set timer mode to
  4632. * support Application prefetch handling.
  4633. * The external tail offset/pointer will be updated
  4634. * at following intervals:
  4635. * 3'b000: (Prefetch feature disabled; used only for debug)
  4636. * 3'b001: 1 usec
  4637. * 3'b010: 4 usec
  4638. * 3'b011: 8 usec (default)
  4639. * 3'b100: 16 usec
  4640. * Others: Reserverd
  4641. * b'19 - response_required:
  4642. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4643. * b'20 - ipa_drop_flag:
  4644. Indicates that host will config ipa drop threshold percentage
  4645. * b'21:31 - reserved: reserved for future use
  4646. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4647. * b'8:15 - ipa drop high threshold percentage:
  4648. * b'16:31 - Reserved
  4649. */
  4650. PREPACK struct htt_sring_setup_t {
  4651. A_UINT32 msg_type: 8,
  4652. pdev_id: 8,
  4653. ring_id: 8,
  4654. ring_type: 8;
  4655. A_UINT32 ring_base_addr_lo;
  4656. A_UINT32 ring_base_addr_hi;
  4657. A_UINT32 ring_size: 16,
  4658. ring_entry_size: 8,
  4659. ring_misc_cfg_flag: 8;
  4660. A_UINT32 ring_head_offset32_remote_addr_lo;
  4661. A_UINT32 ring_head_offset32_remote_addr_hi;
  4662. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4663. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4664. A_UINT32 ring_msi_addr_lo;
  4665. A_UINT32 ring_msi_addr_hi;
  4666. A_UINT32 ring_msi_data;
  4667. A_UINT32 intr_batch_counter_th: 15,
  4668. sw_intr_mode: 1,
  4669. intr_timer_th: 16;
  4670. A_UINT32 intr_low_threshold: 16,
  4671. prefetch_timer_cfg: 3,
  4672. response_required: 1,
  4673. ipa_drop_flag: 1,
  4674. reserved1: 11;
  4675. A_UINT32 ipa_drop_low_threshold: 8,
  4676. ipa_drop_high_threshold: 8,
  4677. reserved: 16;
  4678. } POSTPACK;
  4679. enum htt_srng_ring_type {
  4680. HTT_HW_TO_SW_RING = 0,
  4681. HTT_SW_TO_HW_RING,
  4682. HTT_SW_TO_SW_RING,
  4683. /* Insert new ring types above this line */
  4684. };
  4685. enum htt_srng_ring_id {
  4686. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4687. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4688. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4689. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4690. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4691. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4692. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4693. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4694. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4695. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4696. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4697. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4698. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4699. /* Add Other SRING which can't be directly configured by host software above this line */
  4700. };
  4701. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4702. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4703. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4704. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4705. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4706. HTT_SRING_SETUP_PDEV_ID_S)
  4707. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4708. do { \
  4709. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4710. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4711. } while (0)
  4712. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4713. #define HTT_SRING_SETUP_RING_ID_S 16
  4714. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4715. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4716. HTT_SRING_SETUP_RING_ID_S)
  4717. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4718. do { \
  4719. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4720. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4721. } while (0)
  4722. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4723. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4724. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4725. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4726. HTT_SRING_SETUP_RING_TYPE_S)
  4727. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4728. do { \
  4729. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4730. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4731. } while (0)
  4732. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4733. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4734. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4735. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4736. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4737. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4738. do { \
  4739. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4740. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4741. } while (0)
  4742. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4743. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4744. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4745. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4746. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4747. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4748. do { \
  4749. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4750. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4751. } while (0)
  4752. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4753. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4754. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4755. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4756. HTT_SRING_SETUP_RING_SIZE_S)
  4757. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4758. do { \
  4759. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4760. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4761. } while (0)
  4762. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4763. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4764. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4765. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4766. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4767. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4768. do { \
  4769. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4770. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4771. } while (0)
  4772. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4773. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4774. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4775. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4776. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4777. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4778. do { \
  4779. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4780. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4781. } while (0)
  4782. /* This control bit is applicable to only Producer, which updates Ring ID field
  4783. * of each descriptor before pushing into the ring.
  4784. * 0: updates ring_id(default)
  4785. * 1: ring_id updating disabled */
  4786. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4787. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4788. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4789. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4790. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4791. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4792. do { \
  4793. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4794. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4795. } while (0)
  4796. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4797. * of each descriptor before pushing into the ring.
  4798. * 0: updates Loopcnt(default)
  4799. * 1: Loopcnt updating disabled */
  4800. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4801. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4802. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4803. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4804. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4805. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4806. do { \
  4807. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4808. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4809. } while (0)
  4810. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4811. * into security_id port of GXI/AXI. */
  4812. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4813. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4814. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4815. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4816. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4817. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4818. do { \
  4819. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4820. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4821. } while (0)
  4822. /* During MSI write operation, SRNG drives value of this register bit into
  4823. * swap bit of GXI/AXI. */
  4824. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4825. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4826. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4827. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4828. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4829. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4830. do { \
  4831. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4832. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4833. } while (0)
  4834. /* During Pointer write operation, SRNG drives value of this register bit into
  4835. * swap bit of GXI/AXI. */
  4836. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4837. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4838. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4839. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4840. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4841. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4842. do { \
  4843. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4844. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4845. } while (0)
  4846. /* During any data or TLV write operation, SRNG drives value of this register
  4847. * bit into swap bit of GXI/AXI. */
  4848. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4849. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4850. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4851. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4852. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4853. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4854. do { \
  4855. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4856. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4857. } while (0)
  4858. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4859. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4860. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4861. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4862. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4863. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4864. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4865. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4866. do { \
  4867. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4868. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4869. } while (0)
  4870. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4871. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4872. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4873. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4874. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4875. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4876. do { \
  4877. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4878. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4879. } while (0)
  4880. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4881. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4882. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4883. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4884. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4885. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4886. do { \
  4887. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4888. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4889. } while (0)
  4890. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4891. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4892. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4893. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4894. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4895. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4896. do { \
  4897. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4898. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4899. } while (0)
  4900. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4901. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4902. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4903. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4904. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4905. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4906. do { \
  4907. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4908. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4909. } while (0)
  4910. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4911. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4912. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4913. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4914. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4915. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4916. do { \
  4917. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4918. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4919. } while (0)
  4920. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4921. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4922. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4923. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4924. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4925. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4926. do { \
  4927. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4928. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4929. } while (0)
  4930. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4931. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4932. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4933. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4934. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4935. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4936. do { \
  4937. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4938. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4939. } while (0)
  4940. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4941. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4942. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4943. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4944. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4945. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4946. do { \
  4947. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4948. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4949. } while (0)
  4950. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4951. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4952. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4953. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4954. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4955. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4956. do { \
  4957. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4958. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4959. } while (0)
  4960. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4961. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4962. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4963. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4964. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4965. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4966. do { \
  4967. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4968. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4969. } while (0)
  4970. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4971. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4972. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4973. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4974. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4975. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4976. do { \
  4977. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4978. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4979. } while (0)
  4980. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4981. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4982. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4983. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4984. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4985. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4986. do { \
  4987. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4988. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4989. } while (0)
  4990. /**
  4991. * @brief host -> target RX ring selection config message
  4992. *
  4993. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4994. *
  4995. * @details
  4996. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4997. * configure RXDMA rings.
  4998. * The configuration is per ring based and includes both packet subtypes
  4999. * and PPDU/MPDU TLVs.
  5000. *
  5001. * The message would appear as follows:
  5002. *
  5003. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5004. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5005. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5006. * |-------------------------------------------------------------------|
  5007. * | rsvd2 | ring_buffer_size |
  5008. * |-------------------------------------------------------------------|
  5009. * | packet_type_enable_flags_0 |
  5010. * |-------------------------------------------------------------------|
  5011. * | packet_type_enable_flags_1 |
  5012. * |-------------------------------------------------------------------|
  5013. * | packet_type_enable_flags_2 |
  5014. * |-------------------------------------------------------------------|
  5015. * | packet_type_enable_flags_3 |
  5016. * |-------------------------------------------------------------------|
  5017. * | tlv_filter_in_flags |
  5018. * |-------------------------------------------------------------------|
  5019. * | rx_header_offset | rx_packet_offset |
  5020. * |-------------------------------------------------------------------|
  5021. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5022. * |-------------------------------------------------------------------|
  5023. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5024. * |-------------------------------------------------------------------|
  5025. * | rsvd3 | rx_attention_offset |
  5026. * |-------------------------------------------------------------------|
  5027. * | rsvd4 | mo| fp| rx_drop_threshold |
  5028. * | |ndp|ndp| |
  5029. * |-------------------------------------------------------------------|
  5030. * Where:
  5031. * PS = pkt_swap
  5032. * SS = status_swap
  5033. * OV = rx_offsets_valid
  5034. * DT = drop_thresh_valid
  5035. * The message is interpreted as follows:
  5036. * dword0 - b'0:7 - msg_type: This will be set to
  5037. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5038. * b'8:15 - pdev_id:
  5039. * 0 (for rings at SOC/UMAC level),
  5040. * 1/2/3 mac id (for rings at LMAC level)
  5041. * b'16:23 - ring_id : Identify the ring to configure.
  5042. * More details can be got from enum htt_srng_ring_id
  5043. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5044. * BUF_RING_CFG_0 defs within HW .h files,
  5045. * e.g. wmac_top_reg_seq_hwioreg.h
  5046. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5047. * BUF_RING_CFG_0 defs within HW .h files,
  5048. * e.g. wmac_top_reg_seq_hwioreg.h
  5049. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5050. * configuration fields are valid
  5051. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5052. * rx_drop_threshold field is valid
  5053. * b'28:31 - rsvd1: reserved for future use
  5054. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5055. * in byte units.
  5056. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5057. * b'16:18 - config_length_mgmt (MGMT):
  5058. * Represents the length of mpdu bytes for mgmt pkt.
  5059. * valid values:
  5060. * 001 - 64bytes
  5061. * 010 - 128bytes
  5062. * 100 - 256bytes
  5063. * 111 - Full mpdu bytes
  5064. * b'19:21 - config_length_ctrl (CTRL):
  5065. * Represents the length of mpdu bytes for ctrl pkt.
  5066. * valid values:
  5067. * 001 - 64bytes
  5068. * 010 - 128bytes
  5069. * 100 - 256bytes
  5070. * 111 - Full mpdu bytes
  5071. * b'22:24 - config_length_data (DATA):
  5072. * Represents the length of mpdu bytes for data pkt.
  5073. * valid values:
  5074. * 001 - 64bytes
  5075. * 010 - 128bytes
  5076. * 100 - 256bytes
  5077. * 111 - Full mpdu bytes
  5078. * b'25:31 - rsvd2: Reserved for future use
  5079. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5080. * Enable MGMT packet from 0b0000 to 0b1001
  5081. * bits from low to high: FP, MD, MO - 3 bits
  5082. * FP: Filter_Pass
  5083. * MD: Monitor_Direct
  5084. * MO: Monitor_Other
  5085. * 10 mgmt subtypes * 3 bits -> 30 bits
  5086. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5087. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5088. * Enable MGMT packet from 0b1010 to 0b1111
  5089. * bits from low to high: FP, MD, MO - 3 bits
  5090. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5091. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5092. * Enable CTRL packet from 0b0000 to 0b1001
  5093. * bits from low to high: FP, MD, MO - 3 bits
  5094. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5095. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5096. * Enable CTRL packet from 0b1010 to 0b1111,
  5097. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5098. * bits from low to high: FP, MD, MO - 3 bits
  5099. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5100. * dword6 - b'0:31 - tlv_filter_in_flags:
  5101. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5102. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5103. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5104. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5105. * A value of 0 will be considered as ignore this config.
  5106. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5107. * e.g. wmac_top_reg_seq_hwioreg.h
  5108. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5109. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5110. * A value of 0 will be considered as ignore this config.
  5111. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5112. * e.g. wmac_top_reg_seq_hwioreg.h
  5113. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5114. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5115. * A value of 0 will be considered as ignore this config.
  5116. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5117. * e.g. wmac_top_reg_seq_hwioreg.h
  5118. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5119. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5120. * A value of 0 will be considered as ignore this config.
  5121. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5122. * e.g. wmac_top_reg_seq_hwioreg.h
  5123. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5124. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5125. * A value of 0 will be considered as ignore this config.
  5126. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5127. * e.g. wmac_top_reg_seq_hwioreg.h
  5128. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5129. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5130. * A value of 0 will be considered as ignore this config.
  5131. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5132. * e.g. wmac_top_reg_seq_hwioreg.h
  5133. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5134. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5135. * A value of 0 will be considered as ignore this config.
  5136. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5137. * e.g. wmac_top_reg_seq_hwioreg.h
  5138. * - b'16:31 - rsvd3 for future use
  5139. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5140. * to source rings. Consumer drops packets if the available
  5141. * words in the ring falls below the configured threshold
  5142. * value.
  5143. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5144. * by host. 1 -> subscribed
  5145. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5146. * by host. 1 -> subscribed
  5147. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5148. * subscribed by host. 1 -> subscribed
  5149. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5150. * selection for the FP PHY ERR status tlv.
  5151. * 0 - wbm2rxdma_buf_source_ring
  5152. * 1 - fw2rxdma_buf_source_ring
  5153. * 2 - sw2rxdma_buf_source_ring
  5154. * 3 - no_buffer_ring
  5155. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5156. * selection for the FP PHY ERR status tlv.
  5157. * 0 - rxdma_release_ring
  5158. * 1 - rxdma2fw_ring
  5159. * 2 - rxdma2sw_ring
  5160. * 3 - rxdma2reo_ring
  5161. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5162. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5163. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5164. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5165. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5166. * 0: MSDU level logging
  5167. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5168. * 0: MSDU level logging
  5169. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5170. * 0: MSDU level logging
  5171. * - b'23 - word_mask_compaction: enable/disable word mask for
  5172. * mpdu/msdu start/end tlvs
  5173. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5174. * manager override
  5175. * - b'25:28 - rbm_override_val: return buffer manager override value
  5176. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5177. * which have to be posted to host from phy.
  5178. * Corresponding to errors defined in
  5179. * phyrx_abort_request_reason enums 0 to 31.
  5180. * Refer to RXPCU register definition header files for the
  5181. * phyrx_abort_request_reason enum definition.
  5182. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5183. * errors which have to be posted to host from phy.
  5184. * Corresponding to errors defined in
  5185. * phyrx_abort_request_reason enums 32 to 63.
  5186. * Refer to RXPCU register definition header files for the
  5187. * phyrx_abort_request_reason enum definition.
  5188. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5189. * applicable if word mask enabled
  5190. * - b'16:31 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5191. * applicable if word mask enabled
  5192. * dword15- b'0:16 - rx_msdu_end_word_mask
  5193. b'17:31 - rsvd5
  5194. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5195. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5196. * buffer
  5197. * 1: RX_PKT TLV logging at specified offset for the
  5198. * subsequent buffer
  5199. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5200. */
  5201. PREPACK struct htt_rx_ring_selection_cfg_t {
  5202. A_UINT32 msg_type: 8,
  5203. pdev_id: 8,
  5204. ring_id: 8,
  5205. status_swap: 1,
  5206. pkt_swap: 1,
  5207. rx_offsets_valid: 1,
  5208. drop_thresh_valid: 1,
  5209. rsvd1: 4;
  5210. A_UINT32 ring_buffer_size: 16,
  5211. config_length_mgmt:3,
  5212. config_length_ctrl:3,
  5213. config_length_data:3,
  5214. rsvd2: 7;
  5215. A_UINT32 packet_type_enable_flags_0;
  5216. A_UINT32 packet_type_enable_flags_1;
  5217. A_UINT32 packet_type_enable_flags_2;
  5218. A_UINT32 packet_type_enable_flags_3;
  5219. A_UINT32 tlv_filter_in_flags;
  5220. A_UINT32 rx_packet_offset: 16,
  5221. rx_header_offset: 16;
  5222. A_UINT32 rx_mpdu_end_offset: 16,
  5223. rx_mpdu_start_offset: 16;
  5224. A_UINT32 rx_msdu_end_offset: 16,
  5225. rx_msdu_start_offset: 16;
  5226. A_UINT32 rx_attn_offset: 16,
  5227. rsvd3: 16;
  5228. A_UINT32 rx_drop_threshold: 10,
  5229. fp_ndp: 1,
  5230. mo_ndp: 1,
  5231. fp_phy_err: 1,
  5232. fp_phy_err_buf_src: 2,
  5233. fp_phy_err_buf_dest: 2,
  5234. pkt_type_enable_msdu_or_mpdu_logging:3,
  5235. dma_mpdu_mgmt: 1,
  5236. dma_mpdu_ctrl: 1,
  5237. dma_mpdu_data: 1,
  5238. word_mask_compaction_enable:1,
  5239. rbm_override_enable: 1,
  5240. rbm_override_val: 4,
  5241. rsvd4: 3;
  5242. A_UINT32 phy_err_mask;
  5243. A_UINT32 phy_err_mask_cont;
  5244. A_UINT32 rx_mpdu_start_word_mask:16,
  5245. rx_mpdu_end_word_mask: 16;
  5246. A_UINT32 rx_msdu_end_word_mask: 17,
  5247. rsvd5: 15;
  5248. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5249. rx_pkt_tlv_offset: 15,
  5250. rsvd6: 16;
  5251. } POSTPACK;
  5252. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5253. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5254. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5255. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5256. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5257. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5258. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5259. do { \
  5260. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5261. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5262. } while (0)
  5263. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5264. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5265. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5266. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5267. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5268. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5269. do { \
  5270. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5271. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5272. } while (0)
  5273. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5274. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5275. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5276. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5277. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5278. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5279. do { \
  5280. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5281. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5282. } while (0)
  5283. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5284. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5285. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5286. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5287. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5288. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5289. do { \
  5290. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5291. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5292. } while (0)
  5293. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5294. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5295. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5296. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5297. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5298. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5299. do { \
  5300. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5301. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5302. } while (0)
  5303. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5304. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5305. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5306. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5307. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5308. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5309. do { \
  5310. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5311. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5312. } while (0)
  5313. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5314. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5315. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5316. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5317. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5318. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5319. do { \
  5320. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5321. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5322. } while (0)
  5323. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5324. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5325. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5326. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5327. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5328. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5329. do { \
  5330. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5331. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5332. } while (0)
  5333. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5334. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5335. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5336. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5337. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5338. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5339. do { \
  5340. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5341. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5342. } while (0)
  5343. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5344. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5345. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5346. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5347. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5348. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5349. do { \
  5350. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5351. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5352. } while (0)
  5353. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5354. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5355. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5356. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5357. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5358. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5359. do { \
  5360. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5361. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5362. } while (0)
  5363. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5364. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5365. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5366. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5367. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5368. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5369. do { \
  5370. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5371. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5372. } while (0)
  5373. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5374. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5375. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5376. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5377. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5378. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5379. do { \
  5380. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5381. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5382. } while (0)
  5383. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5384. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5385. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5386. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5387. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5388. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5389. do { \
  5390. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5391. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5392. } while (0)
  5393. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5394. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5395. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5396. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5397. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5398. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5399. do { \
  5400. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5401. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5402. } while (0)
  5403. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5404. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5405. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5406. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5407. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5408. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5409. do { \
  5410. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5411. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5412. } while (0)
  5413. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5414. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5415. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5416. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5417. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5418. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5419. do { \
  5420. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5421. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5422. } while (0)
  5423. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5424. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5425. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5426. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5427. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5428. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5429. do { \
  5430. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5431. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5432. } while (0)
  5433. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5434. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5435. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5436. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5437. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5438. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5439. do { \
  5440. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5441. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5442. } while (0)
  5443. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5444. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5445. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5446. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5447. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5448. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5449. do { \
  5450. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5451. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5452. } while (0)
  5453. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5454. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5455. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5456. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5457. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5458. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5459. do { \
  5460. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5461. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5462. } while (0)
  5463. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5464. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5465. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5466. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5467. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5468. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5469. do { \
  5470. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5471. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5472. } while (0)
  5473. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5474. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5475. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5476. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5477. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5478. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5479. do { \
  5480. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5481. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5482. } while (0)
  5483. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5484. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5485. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5486. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5487. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5488. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5489. do { \
  5490. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5491. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5492. } while (0)
  5493. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5494. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5495. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5496. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5497. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5498. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5499. do { \
  5500. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5501. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5502. } while (0)
  5503. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5504. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5505. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5506. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5507. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5508. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5509. do { \
  5510. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5511. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5512. } while (0)
  5513. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5514. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5515. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5516. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5517. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5518. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5519. do { \
  5520. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5521. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5522. } while (0)
  5523. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5524. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5525. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5526. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5527. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5528. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5529. do { \
  5530. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5531. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5532. } while (0)
  5533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5536. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5537. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5539. do { \
  5540. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5541. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5542. } while (0)
  5543. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5544. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5545. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5546. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5547. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5548. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5549. do { \
  5550. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5551. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5552. } while (0)
  5553. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5554. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5555. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5556. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5557. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5558. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5559. do { \
  5560. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5561. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5562. } while (0)
  5563. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5564. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5565. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5566. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5567. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5568. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5569. do { \
  5570. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5571. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5572. } while (0)
  5573. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5574. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5575. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5576. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5577. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5578. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5579. do { \
  5580. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5581. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5582. } while (0)
  5583. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5584. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5585. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5586. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5587. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5588. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5589. do { \
  5590. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5591. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5592. } while (0)
  5593. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5594. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5595. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5596. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5597. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5598. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5599. do { \
  5600. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5601. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5602. } while (0)
  5603. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5604. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5605. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5606. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5607. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5608. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5609. do { \
  5610. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5611. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5612. } while (0)
  5613. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5614. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5615. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5616. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5617. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5618. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5619. do { \
  5620. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5621. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5622. } while (0)
  5623. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5624. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5625. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5626. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5627. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5628. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5629. do { \
  5630. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5631. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5632. } while (0)
  5633. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0xFFFF0000
  5634. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5635. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5636. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5637. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5638. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5639. do { \
  5640. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5641. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5642. } while (0)
  5643. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5644. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5645. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5646. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5647. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5648. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5649. do { \
  5650. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5651. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5652. } while (0)
  5653. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5654. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5655. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5656. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5657. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5658. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5659. do { \
  5660. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5661. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5662. } while (0)
  5663. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5664. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5665. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5666. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5667. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5668. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5669. do { \
  5670. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5671. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5672. } while (0)
  5673. /*
  5674. * Subtype based MGMT frames enable bits.
  5675. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5676. */
  5677. /* association request */
  5678. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5679. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5680. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5681. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5682. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5683. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5684. /* association response */
  5685. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5686. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5687. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5688. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5689. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5690. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5691. /* Reassociation request */
  5692. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5693. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5694. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5695. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5696. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5697. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5698. /* Reassociation response */
  5699. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5700. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5701. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5702. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5703. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5704. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5705. /* Probe request */
  5706. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5707. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5708. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5709. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5710. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5711. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5712. /* Probe response */
  5713. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5714. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5715. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5716. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5717. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5718. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5719. /* Timing Advertisement */
  5720. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5721. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5722. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5723. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5724. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5725. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5726. /* Reserved */
  5727. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5728. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5733. /* Beacon */
  5734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5735. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5740. /* ATIM */
  5741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5747. /* Disassociation */
  5748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5754. /* Authentication */
  5755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5761. /* Deauthentication */
  5762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5768. /* Action */
  5769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5775. /* Action No Ack */
  5776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5782. /* Reserved */
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5789. /*
  5790. * Subtype based CTRL frames enable bits.
  5791. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5792. */
  5793. /* Reserved */
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5800. /* Reserved */
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5807. /* Reserved */
  5808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5814. /* Reserved */
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5821. /* Reserved */
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5828. /* Reserved */
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5835. /* Reserved */
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5842. /* Control Wrapper */
  5843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5849. /* Block Ack Request */
  5850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5856. /* Block Ack*/
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5863. /* PS-POLL */
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5870. /* RTS */
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5877. /* CTS */
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5884. /* ACK */
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5891. /* CF-END */
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5898. /* CF-END + CF-ACK */
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5905. /* Multicast data */
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5912. /* Unicast data */
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5919. /* NULL data */
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5927. do { \
  5928. HTT_CHECK_SET_VAL(httsym, value); \
  5929. (word) |= (value) << httsym##_S; \
  5930. } while (0)
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5932. (((word) & httsym##_M) >> httsym##_S)
  5933. #define htt_rx_ring_pkt_enable_subtype_set( \
  5934. word, flag, mode, type, subtype, val) \
  5935. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5936. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5937. #define htt_rx_ring_pkt_enable_subtype_get( \
  5938. word, flag, mode, type, subtype) \
  5939. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5940. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5941. /* Definition to filter in TLVs */
  5942. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5943. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5944. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5945. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5946. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5947. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5948. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5949. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5950. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5951. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5952. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5953. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5954. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5955. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5956. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5957. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5958. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5959. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5960. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5961. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5962. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5963. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5964. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5965. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5966. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5967. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5968. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5969. do { \
  5970. HTT_CHECK_SET_VAL(httsym, enable); \
  5971. (word) |= (enable) << httsym##_S; \
  5972. } while (0)
  5973. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5974. (((word) & httsym##_M) >> httsym##_S)
  5975. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5976. HTT_RX_RING_TLV_ENABLE_SET( \
  5977. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5978. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5979. HTT_RX_RING_TLV_ENABLE_GET( \
  5980. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5981. /**
  5982. * @brief host -> target TX monitor config message
  5983. *
  5984. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5985. *
  5986. * @details
  5987. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5988. * configure RXDMA rings.
  5989. * The configuration is per ring based and includes both packet types
  5990. * and PPDU/MPDU TLVs.
  5991. *
  5992. * The message would appear as follows:
  5993. *
  5994. * |31 26|25|24|23 22|21|20|19|18 16|15|14|13|12|11|10|9|8|7|6|5|4|3|2 0|
  5995. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5996. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5997. * |-----------+--------+--------+-----+------------------------------------|
  5998. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  5999. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6000. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6001. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6002. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6003. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6004. * |------------------------------------------------------------------------|
  6005. * | tlv_filter_mask_in0 |
  6006. * |------------------------------------------------------------------------|
  6007. * | tlv_filter_mask_in1 |
  6008. * |------------------------------------------------------------------------|
  6009. * | tlv_filter_mask_in2 |
  6010. * |------------------------------------------------------------------------|
  6011. * | tlv_filter_mask_in3 |
  6012. * |-----------------+-----------------+---------------------+--------------|
  6013. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6014. * |------------------------------------------------------------------------|
  6015. * | pcu_ppdu_setup_word_mask |
  6016. * |--------------------+--+--+--+-----+---------------------+--------------|
  6017. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6018. * |------------------------------------------------------------------------|
  6019. *
  6020. * Where:
  6021. * PS = pkt_swap
  6022. * SS = status_swap
  6023. * The message is interpreted as follows:
  6024. * dword0 - b'0:7 - msg_type: This will be set to
  6025. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6026. * b'8:15 - pdev_id:
  6027. * 0 (for rings at SOC level),
  6028. * 1/2/3 mac id (for rings at LMAC level)
  6029. * b'16:23 - ring_id : Identify the ring to configure.
  6030. * More details can be got from enum htt_srng_ring_id
  6031. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6032. * BUF_RING_CFG_0 defs within HW .h files,
  6033. * e.g. wmac_top_reg_seq_hwioreg.h
  6034. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6035. * BUF_RING_CFG_0 defs within HW .h files,
  6036. * e.g. wmac_top_reg_seq_hwioreg.h
  6037. * b'26:31 - rsvd1: reserved for future use
  6038. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6039. * in byte units.
  6040. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6041. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6042. * 64, 128, 256.
  6043. * If all 3 bits are set config length is > 256.
  6044. * if val is '0', then ignore this field.
  6045. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6046. * 64, 128, 256.
  6047. * If all 3 bits are set config length is > 256.
  6048. * if val is '0', then ignore this field.
  6049. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6050. * 64, 128, 256.
  6051. * If all 3 bits are set config length is > 256.
  6052. * If val is '0', then ignore this field.
  6053. * - b'25:31 - rsvd2: Reserved for future use
  6054. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6055. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6056. * If packet_type_enable_flags is '1' for MGMT type,
  6057. * monitor will ignore this bit and allow this TLV.
  6058. * If packet_type_enable_flags is '0' for MGMT type,
  6059. * monitor will use this bit to enable/disable logging
  6060. * of this TLV.
  6061. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6062. * If packet_type_enable_flags is '1' for CTRL type,
  6063. * monitor will ignore this bit and allow this TLV.
  6064. * If packet_type_enable_flags is '0' for CTRL type,
  6065. * monitor will use this bit to enable/disable logging
  6066. * of this TLV.
  6067. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6068. * If packet_type_enable_flags is '1' for DATA type,
  6069. * monitor will ignore this bit and allow this TLV.
  6070. * If packet_type_enable_flags is '0' for DATA type,
  6071. * monitor will use this bit to enable/disable logging
  6072. * of this TLV.
  6073. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6074. * If packet_type_enable_flags is '1' for MGMT type,
  6075. * monitor will ignore this bit and allow this TLV.
  6076. * If packet_type_enable_flags is '0' for MGMT type,
  6077. * monitor will use this bit to enable/disable logging
  6078. * of this TLV.
  6079. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6080. * If packet_type_enable_flags is '1' for CTRL type,
  6081. * monitor will ignore this bit and allow this TLV.
  6082. * If packet_type_enable_flags is '0' for CTRL type,
  6083. * monitor will use this bit to enable/disable logging
  6084. * of this TLV.
  6085. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6086. * If packet_type_enable_flags is '1' for DATA type,
  6087. * monitor will ignore this bit and allow this TLV.
  6088. * If packet_type_enable_flags is '0' for DATA type,
  6089. * monitor will use this bit to enable/disable logging
  6090. * of this TLV.
  6091. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6092. * If packet_type_enable_flags is '1' for MGMT type,
  6093. * monitor will ignore this bit and allow this TLV.
  6094. * If packet_type_enable_flags is '0' for MGMT type,
  6095. * monitor will use this bit to enable/disable logging
  6096. * of this TLV.
  6097. * If filter_in_TX_MPDU_START = 1 it is recommended
  6098. * to set this bit.
  6099. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6100. * If packet_type_enable_flags is '1' for CTRL type,
  6101. * monitor will ignore this bit and allow this TLV.
  6102. * If packet_type_enable_flags is '0' for CTRL type,
  6103. * monitor will use this bit to enable/disable logging
  6104. * of this TLV.
  6105. * If filter_in_TX_MPDU_START = 1 it is recommended
  6106. * to set this bit.
  6107. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6108. * If packet_type_enable_flags is '1' for DATA type,
  6109. * monitor will ignore this bit and allow this TLV.
  6110. * If packet_type_enable_flags is '0' for DATA type,
  6111. * monitor will use this bit to enable/disable logging
  6112. * of this TLV.
  6113. * If filter_in_TX_MPDU_START = 1 it is recommended
  6114. * to set this bit.
  6115. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6116. * If packet_type_enable_flags is '1' for MGMT type,
  6117. * monitor will ignore this bit and allow this TLV.
  6118. * If packet_type_enable_flags is '0' for MGMT type,
  6119. * monitor will use this bit to enable/disable logging
  6120. * of this TLV.
  6121. * If filter_in_TX_MSDU_START = 1 it is recommended
  6122. * to set this bit.
  6123. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6124. * If packet_type_enable_flags is '1' for CTRL type,
  6125. * monitor will ignore this bit and allow this TLV.
  6126. * If packet_type_enable_flags is '0' for CTRL type,
  6127. * monitor will use this bit to enable/disable logging
  6128. * of this TLV.
  6129. * If filter_in_TX_MSDU_START = 1 it is recommended
  6130. * to set this bit.
  6131. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6132. * If packet_type_enable_flags is '1' for DATA type,
  6133. * monitor will ignore this bit and allow this TLV.
  6134. * If packet_type_enable_flags is '0' for DATA type,
  6135. * monitor will use this bit to enable/disable logging
  6136. * of this TLV.
  6137. * If filter_in_TX_MSDU_START = 1 it is recommended
  6138. * to set this bit.
  6139. * b'15:31 - rsvd3: Reserved for future use
  6140. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6141. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6142. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6143. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6144. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6145. * - b'8:15 - tx_peer_entry_word_mask:
  6146. * - b'16:23 - tx_queue_ext_word_mask:
  6147. * - b'24:31 - tx_msdu_start_word_mask:
  6148. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6149. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6150. * - b'8:15 - rxpcu_user_setup_word_mask:
  6151. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6152. * MGMT, CTRL, DATA
  6153. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6154. * 0 -> MSDU level logging is enabled
  6155. * (valid only if bit is set in
  6156. * pkt_type_enable_msdu_or_mpdu_logging)
  6157. * 1 -> MPDU level logging is enabled
  6158. * (valid only if bit is set in
  6159. * pkt_type_enable_msdu_or_mpdu_logging)
  6160. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6161. * 0 -> MSDU level logging is enabled
  6162. * (valid only if bit is set in
  6163. * pkt_type_enable_msdu_or_mpdu_logging)
  6164. * 1 -> MPDU level logging is enabled
  6165. * (valid only if bit is set in
  6166. * pkt_type_enable_msdu_or_mpdu_logging)
  6167. * - b'21 - dma_mpdu_data(D) : For DATA
  6168. * 0 -> MSDU level logging is enabled
  6169. * (valid only if bit is set in
  6170. * pkt_type_enable_msdu_or_mpdu_logging)
  6171. * 1 -> MPDU level logging is enabled
  6172. * (valid only if bit is set in
  6173. * pkt_type_enable_msdu_or_mpdu_logging)
  6174. * - b'22:31 - rsvd4 for future use
  6175. */
  6176. PREPACK struct htt_tx_monitor_cfg_t {
  6177. A_UINT32 msg_type: 8,
  6178. pdev_id: 8,
  6179. ring_id: 8,
  6180. status_swap: 1,
  6181. pkt_swap: 1,
  6182. rsvd1: 6;
  6183. A_UINT32 ring_buffer_size: 16,
  6184. config_length_mgmt: 3,
  6185. config_length_ctrl: 3,
  6186. config_length_data: 3,
  6187. rsvd2: 7;
  6188. A_UINT32 pkt_type_enable_flags: 3,
  6189. filter_in_tx_mpdu_start_mgmt: 1,
  6190. filter_in_tx_mpdu_start_ctrl: 1,
  6191. filter_in_tx_mpdu_start_data: 1,
  6192. filter_in_tx_msdu_start_mgmt: 1,
  6193. filter_in_tx_msdu_start_ctrl: 1,
  6194. filter_in_tx_msdu_start_data: 1,
  6195. filter_in_tx_mpdu_end_mgmt: 1,
  6196. filter_in_tx_mpdu_end_ctrl: 1,
  6197. filter_in_tx_mpdu_end_data: 1,
  6198. filter_in_tx_msdu_end_mgmt: 1,
  6199. filter_in_tx_msdu_end_ctrl: 1,
  6200. filter_in_tx_msdu_end_data: 1,
  6201. rsvd3: 17;
  6202. A_UINT32 tlv_filter_mask_in0;
  6203. A_UINT32 tlv_filter_mask_in1;
  6204. A_UINT32 tlv_filter_mask_in2;
  6205. A_UINT32 tlv_filter_mask_in3;
  6206. A_UINT32 tx_fes_setup_word_mask: 8,
  6207. tx_peer_entry_word_mask: 8,
  6208. tx_queue_ext_word_mask: 8,
  6209. tx_msdu_start_word_mask: 8;
  6210. A_UINT32 pcu_ppdu_setup_word_mask;
  6211. A_UINT32 tx_mpdu_start_word_mask: 8,
  6212. rxpcu_user_setup_word_mask: 8,
  6213. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6214. dma_mpdu_mgmt: 1,
  6215. dma_mpdu_ctrl: 1,
  6216. dma_mpdu_data: 1,
  6217. rsvd4: 10;
  6218. } POSTPACK;
  6219. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6220. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6221. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6222. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6223. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6224. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6225. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6226. do { \
  6227. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6228. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6229. } while (0)
  6230. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6231. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6232. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6233. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6234. HTT_TX_MONITOR_CFG_RING_ID_S)
  6235. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6236. do { \
  6237. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6238. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6239. } while (0)
  6240. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6241. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6242. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6243. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6244. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6245. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6246. do { \
  6247. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6248. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6249. } while (0)
  6250. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6251. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6252. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6253. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6254. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6255. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6256. do { \
  6257. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6258. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6259. } while (0)
  6260. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6261. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6262. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6263. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6264. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6265. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6266. do { \
  6267. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6268. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6269. } while (0)
  6270. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6271. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6272. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6273. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6274. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6275. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6276. do { \
  6277. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6278. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6279. } while (0)
  6280. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6281. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6282. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6283. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6284. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6285. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6286. do { \
  6287. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6288. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6289. } while (0)
  6290. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6291. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6292. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6293. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6294. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6295. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6296. do { \
  6297. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6298. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6299. } while (0)
  6300. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6301. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6302. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6303. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6304. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6305. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6306. do { \
  6307. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6308. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6309. } while (0)
  6310. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6311. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6312. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6313. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6314. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6315. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6316. do { \
  6317. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6318. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6319. } while (0)
  6320. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6321. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6322. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6323. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6324. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6325. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6326. do { \
  6327. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6328. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6329. } while (0
  6330. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6331. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6332. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6333. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6334. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6335. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6336. do { \
  6337. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6338. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6339. } while (0)
  6340. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6341. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6342. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6343. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6344. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6345. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6346. do { \
  6347. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6348. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6349. } while (0)
  6350. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6351. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6352. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6353. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6354. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6355. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6356. do { \
  6357. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6358. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6359. } while (0
  6360. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6361. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6362. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6363. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6364. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6365. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6366. do { \
  6367. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6368. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6369. } while (0)
  6370. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6371. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6372. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6373. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6374. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6375. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6376. do { \
  6377. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6378. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6379. } while (0)
  6380. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6381. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6382. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6383. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6384. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6385. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6386. do { \
  6387. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6388. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6389. } while (0
  6390. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6391. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6392. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6393. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6394. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6395. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6396. do { \
  6397. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6398. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6399. } while (0)
  6400. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6401. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6402. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6403. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6404. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6405. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6406. do { \
  6407. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6408. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6409. } while (0)
  6410. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6411. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6412. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6413. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6414. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6415. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6416. do { \
  6417. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6418. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6419. } while (0
  6420. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6421. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6422. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6423. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6424. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6425. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6426. do { \
  6427. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6428. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6429. } while (0)
  6430. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6431. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6432. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6433. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6434. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6435. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6436. do { \
  6437. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6438. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6439. } while (0)
  6440. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6441. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6442. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6443. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6444. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6445. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6446. do { \
  6447. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6448. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6449. } while (0)
  6450. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6451. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6452. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6453. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6454. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6455. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6456. do { \
  6457. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6458. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6459. } while (0)
  6460. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6461. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6462. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6463. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6464. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6465. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6466. do { \
  6467. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6468. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6469. } while (0)
  6470. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6471. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6472. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6473. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6474. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6475. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6476. do { \
  6477. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6478. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6479. } while (0)
  6480. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6481. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6482. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6483. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6484. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6485. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6486. do { \
  6487. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6488. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6489. } while (0)
  6490. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6491. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6492. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6493. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6494. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6495. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6496. do { \
  6497. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6498. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6499. } while (0)
  6500. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6501. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6502. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6503. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6504. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6505. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6506. do { \
  6507. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6508. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6509. } while (0)
  6510. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6511. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6512. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6513. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6514. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6515. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6516. do { \
  6517. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6518. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6519. } while (0)
  6520. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6521. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6522. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6523. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6524. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6525. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6526. do { \
  6527. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6528. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6529. } while (0)
  6530. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6531. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6532. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6533. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6534. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6535. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6536. do { \
  6537. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6538. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6539. } while (0)
  6540. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6541. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6542. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6543. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6544. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6545. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6546. do { \
  6547. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6548. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6549. } while (0)
  6550. /*
  6551. * pkt_type_enable_flags
  6552. */
  6553. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6554. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6555. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6556. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6557. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6558. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6559. /*
  6560. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6561. */
  6562. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6563. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6564. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6565. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6566. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6567. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6568. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6569. do { \
  6570. HTT_CHECK_SET_VAL(httsym, value); \
  6571. (word) |= (value) << httsym##_S; \
  6572. } while (0)
  6573. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6574. (((word) & httsym##_M) >> httsym##_S)
  6575. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6576. * type -> MGMT, CTRL, DATA*/
  6577. #define htt_tx_ring_pkt_type_set( \
  6578. word, mode, type, val) \
  6579. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6580. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6581. #define htt_tx_ring_pkt_type_get( \
  6582. word, mode, type) \
  6583. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6584. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6585. /* Definition to filter in TLVs */
  6586. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6587. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6588. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6589. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6590. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6591. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6592. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6593. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6594. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6595. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6596. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6597. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6598. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6599. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6600. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6601. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6602. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6603. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6604. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6605. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6606. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6607. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6608. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6609. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6610. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6611. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6612. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6613. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6614. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6615. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6616. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6617. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6618. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6619. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6620. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6621. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6622. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6623. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6624. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6625. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6626. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6627. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6628. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6629. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6630. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6631. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6632. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6633. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6634. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6635. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6636. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6637. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6638. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6639. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6640. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6641. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6642. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6643. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6644. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6645. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6646. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6647. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6648. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6649. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6650. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6651. do { \
  6652. HTT_CHECK_SET_VAL(httsym, enable); \
  6653. (word) |= (enable) << httsym##_S; \
  6654. } while (0)
  6655. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6656. (((word) & httsym##_M) >> httsym##_S)
  6657. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6658. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6659. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6660. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6661. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6662. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6718. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6719. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6720. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6721. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6722. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6723. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6724. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6725. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6726. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6727. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6728. do { \
  6729. HTT_CHECK_SET_VAL(httsym, enable); \
  6730. (word) |= (enable) << httsym##_S; \
  6731. } while (0)
  6732. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6733. (((word) & httsym##_M) >> httsym##_S)
  6734. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6735. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6736. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6737. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6738. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6739. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6797. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6798. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6799. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6800. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6801. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6802. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6803. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6804. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6805. do { \
  6806. HTT_CHECK_SET_VAL(httsym, enable); \
  6807. (word) |= (enable) << httsym##_S; \
  6808. } while (0)
  6809. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6810. (((word) & httsym##_M) >> httsym##_S)
  6811. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6812. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6813. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6814. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6815. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6816. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6861. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6862. do { \
  6863. HTT_CHECK_SET_VAL(httsym, enable); \
  6864. (word) |= (enable) << httsym##_S; \
  6865. } while (0)
  6866. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6867. (((word) & httsym##_M) >> httsym##_S)
  6868. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6869. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6870. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6871. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6872. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6873. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6874. /**
  6875. * @brief host --> target Receive Flow Steering configuration message definition
  6876. *
  6877. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6878. *
  6879. * host --> target Receive Flow Steering configuration message definition.
  6880. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6881. * The reason for this is we want RFS to be configured and ready before MAC
  6882. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6883. *
  6884. * |31 24|23 16|15 9|8|7 0|
  6885. * |----------------+----------------+----------------+----------------|
  6886. * | reserved |E| msg type |
  6887. * |-------------------------------------------------------------------|
  6888. * Where E = RFS enable flag
  6889. *
  6890. * The RFS_CONFIG message consists of a single 4-byte word.
  6891. *
  6892. * Header fields:
  6893. * - MSG_TYPE
  6894. * Bits 7:0
  6895. * Purpose: identifies this as a RFS config msg
  6896. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6897. * - RFS_CONFIG
  6898. * Bit 8
  6899. * Purpose: Tells target whether to enable (1) or disable (0)
  6900. * flow steering feature when sending rx indication messages to host
  6901. */
  6902. #define HTT_H2T_RFS_CONFIG_M 0x100
  6903. #define HTT_H2T_RFS_CONFIG_S 8
  6904. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6905. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6906. HTT_H2T_RFS_CONFIG_S)
  6907. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6908. do { \
  6909. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6910. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6911. } while (0)
  6912. #define HTT_RFS_CFG_REQ_BYTES 4
  6913. /**
  6914. * @brief host -> target FW extended statistics retrieve
  6915. *
  6916. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6917. *
  6918. * @details
  6919. * The following field definitions describe the format of the HTT host
  6920. * to target FW extended stats retrieve message.
  6921. * The message specifies the type of stats the host wants to retrieve.
  6922. *
  6923. * |31 24|23 16|15 8|7 0|
  6924. * |-----------------------------------------------------------|
  6925. * | reserved | stats type | pdev_mask | msg type |
  6926. * |-----------------------------------------------------------|
  6927. * | config param [0] |
  6928. * |-----------------------------------------------------------|
  6929. * | config param [1] |
  6930. * |-----------------------------------------------------------|
  6931. * | config param [2] |
  6932. * |-----------------------------------------------------------|
  6933. * | config param [3] |
  6934. * |-----------------------------------------------------------|
  6935. * | reserved |
  6936. * |-----------------------------------------------------------|
  6937. * | cookie LSBs |
  6938. * |-----------------------------------------------------------|
  6939. * | cookie MSBs |
  6940. * |-----------------------------------------------------------|
  6941. * Header fields:
  6942. * - MSG_TYPE
  6943. * Bits 7:0
  6944. * Purpose: identifies this is a extended stats upload request message
  6945. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6946. * - PDEV_MASK
  6947. * Bits 8:15
  6948. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6949. * Value: This is a overloaded field, refer to usage and interpretation of
  6950. * PDEV in interface document.
  6951. * Bit 8 : Reserved for SOC stats
  6952. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6953. * Indicates MACID_MASK in DBS
  6954. * - STATS_TYPE
  6955. * Bits 23:16
  6956. * Purpose: identifies which FW statistics to upload
  6957. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6958. * - Reserved
  6959. * Bits 31:24
  6960. * - CONFIG_PARAM [0]
  6961. * Bits 31:0
  6962. * Purpose: give an opaque configuration value to the specified stats type
  6963. * Value: stats-type specific configuration value
  6964. * Refer to htt_stats.h for interpretation for each stats sub_type
  6965. * - CONFIG_PARAM [1]
  6966. * Bits 31:0
  6967. * Purpose: give an opaque configuration value to the specified stats type
  6968. * Value: stats-type specific configuration value
  6969. * Refer to htt_stats.h for interpretation for each stats sub_type
  6970. * - CONFIG_PARAM [2]
  6971. * Bits 31:0
  6972. * Purpose: give an opaque configuration value to the specified stats type
  6973. * Value: stats-type specific configuration value
  6974. * Refer to htt_stats.h for interpretation for each stats sub_type
  6975. * - CONFIG_PARAM [3]
  6976. * Bits 31:0
  6977. * Purpose: give an opaque configuration value to the specified stats type
  6978. * Value: stats-type specific configuration value
  6979. * Refer to htt_stats.h for interpretation for each stats sub_type
  6980. * - Reserved [31:0] for future use.
  6981. * - COOKIE_LSBS
  6982. * Bits 31:0
  6983. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6984. * message with its preceding host->target stats request message.
  6985. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6986. * - COOKIE_MSBS
  6987. * Bits 31:0
  6988. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6989. * message with its preceding host->target stats request message.
  6990. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6991. */
  6992. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6993. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6994. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6995. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6996. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6997. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6998. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6999. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7000. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7001. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7002. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7003. do { \
  7004. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7005. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7006. } while (0)
  7007. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7008. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7009. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7010. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7011. do { \
  7012. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7013. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7014. } while (0)
  7015. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7016. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7017. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7018. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7019. do { \
  7020. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7021. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7022. } while (0)
  7023. /**
  7024. * @brief host -> target FW PPDU_STATS request message
  7025. *
  7026. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7027. *
  7028. * @details
  7029. * The following field definitions describe the format of the HTT host
  7030. * to target FW for PPDU_STATS_CFG msg.
  7031. * The message allows the host to configure the PPDU_STATS_IND messages
  7032. * produced by the target.
  7033. *
  7034. * |31 24|23 16|15 8|7 0|
  7035. * |-----------------------------------------------------------|
  7036. * | REQ bit mask | pdev_mask | msg type |
  7037. * |-----------------------------------------------------------|
  7038. * Header fields:
  7039. * - MSG_TYPE
  7040. * Bits 7:0
  7041. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7042. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7043. * - PDEV_MASK
  7044. * Bits 8:15
  7045. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7046. * Value: This is a overloaded field, refer to usage and interpretation of
  7047. * PDEV in interface document.
  7048. * Bit 8 : Reserved for SOC stats
  7049. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7050. * Indicates MACID_MASK in DBS
  7051. * - REQ_TLV_BIT_MASK
  7052. * Bits 16:31
  7053. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7054. * needs to be included in the target's PPDU_STATS_IND messages.
  7055. * Value: refer htt_ppdu_stats_tlv_tag_t
  7056. *
  7057. */
  7058. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7059. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7060. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7061. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7062. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7063. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7064. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7065. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7066. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7067. do { \
  7068. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7069. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7070. } while (0)
  7071. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7072. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7073. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7074. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7075. do { \
  7076. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7077. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7078. } while (0)
  7079. /**
  7080. * @brief Host-->target HTT RX FSE setup message
  7081. *
  7082. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7083. *
  7084. * @details
  7085. * Through this message, the host will provide details of the flow tables
  7086. * in host DDR along with hash keys.
  7087. * This message can be sent per SOC or per PDEV, which is differentiated
  7088. * by pdev id values.
  7089. * The host will allocate flow search table and sends table size,
  7090. * physical DMA address of flow table, and hash keys to firmware to
  7091. * program into the RXOLE FSE HW block.
  7092. *
  7093. * The following field definitions describe the format of the RX FSE setup
  7094. * message sent from the host to target
  7095. *
  7096. * Header fields:
  7097. * dword0 - b'7:0 - msg_type: This will be set to
  7098. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7099. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7100. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7101. * pdev's LMAC ring.
  7102. * b'31:16 - reserved : Reserved for future use
  7103. * dword1 - b'19:0 - number of records: This field indicates the number of
  7104. * entries in the flow table. For example: 8k number of
  7105. * records is equivalent to
  7106. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7107. * b'27:20 - max search: This field specifies the skid length to FSE
  7108. * parser HW module whenever match is not found at the
  7109. * exact index pointed by hash.
  7110. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7111. * Refer htt_ip_da_sa_prefix below for more details.
  7112. * b'31:30 - reserved: Reserved for future use
  7113. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7114. * table allocated by host in DDR
  7115. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7116. * table allocated by host in DDR
  7117. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7118. * entry hashing
  7119. *
  7120. *
  7121. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7122. * |---------------------------------------------------------------|
  7123. * | reserved | pdev_id | MSG_TYPE |
  7124. * |---------------------------------------------------------------|
  7125. * |resvd|IPDSA| max_search | Number of records |
  7126. * |---------------------------------------------------------------|
  7127. * | base address lo |
  7128. * |---------------------------------------------------------------|
  7129. * | base address high |
  7130. * |---------------------------------------------------------------|
  7131. * | toeplitz key 31_0 |
  7132. * |---------------------------------------------------------------|
  7133. * | toeplitz key 63_32 |
  7134. * |---------------------------------------------------------------|
  7135. * | toeplitz key 95_64 |
  7136. * |---------------------------------------------------------------|
  7137. * | toeplitz key 127_96 |
  7138. * |---------------------------------------------------------------|
  7139. * | toeplitz key 159_128 |
  7140. * |---------------------------------------------------------------|
  7141. * | toeplitz key 191_160 |
  7142. * |---------------------------------------------------------------|
  7143. * | toeplitz key 223_192 |
  7144. * |---------------------------------------------------------------|
  7145. * | toeplitz key 255_224 |
  7146. * |---------------------------------------------------------------|
  7147. * | toeplitz key 287_256 |
  7148. * |---------------------------------------------------------------|
  7149. * | reserved | toeplitz key 314_288(26:0 bits) |
  7150. * |---------------------------------------------------------------|
  7151. * where:
  7152. * IPDSA = ip_da_sa
  7153. */
  7154. /**
  7155. * @brief: htt_ip_da_sa_prefix
  7156. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7157. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7158. * documentation per RFC3849
  7159. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7160. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7161. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7162. */
  7163. enum htt_ip_da_sa_prefix {
  7164. HTT_RX_IPV6_20010db8,
  7165. HTT_RX_IPV4_MAPPED_IPV6,
  7166. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7167. HTT_RX_IPV6_64FF9B,
  7168. };
  7169. /**
  7170. * @brief Host-->target HTT RX FISA configure and enable
  7171. *
  7172. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7173. *
  7174. * @details
  7175. * The host will send this command down to configure and enable the FISA
  7176. * operational params.
  7177. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7178. * register.
  7179. * Should configure both the MACs.
  7180. *
  7181. * dword0 - b'7:0 - msg_type:
  7182. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7183. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7184. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7185. * pdev's LMAC ring.
  7186. * b'31:16 - reserved : Reserved for future use
  7187. *
  7188. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7189. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7190. * packets. 1 flow search will be skipped
  7191. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7192. * tcp,udp packets
  7193. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7194. * calculation
  7195. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7196. * calculation
  7197. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7198. * calculation
  7199. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7200. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7201. * length
  7202. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7203. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7204. * length
  7205. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7206. * num jump
  7207. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7208. * num jump
  7209. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7210. * data type switch has happend for MPDU Sequence num jump
  7211. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7212. * for MPDU Sequence num jump
  7213. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7214. * for decrypt errors
  7215. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7216. * while aggregating a msdu
  7217. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7218. * The aggregation is done until (number of MSDUs aggregated
  7219. * < LIMIT + 1)
  7220. * b'31:18 - Reserved
  7221. *
  7222. * fisa_control_value - 32bit value FW can write to register
  7223. *
  7224. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7225. * Threshold value for FISA timeout (units are microseconds).
  7226. * When the global timestamp exceeds this threshold, FISA
  7227. * aggregation will be restarted.
  7228. * A value of 0 means timeout is disabled.
  7229. * Compare the threshold register with timestamp field in
  7230. * flow entry to generate timeout for the flow.
  7231. *
  7232. * |31 18 |17 16|15 8|7 0|
  7233. * |-------------------------------------------------------------|
  7234. * | reserved | pdev_mask | msg type |
  7235. * |-------------------------------------------------------------|
  7236. * | reserved | FISA_CTRL |
  7237. * |-------------------------------------------------------------|
  7238. * | FISA_TIMEOUT_THRESH |
  7239. * |-------------------------------------------------------------|
  7240. */
  7241. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7242. A_UINT32 msg_type:8,
  7243. pdev_id:8,
  7244. reserved0:16;
  7245. /**
  7246. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7247. * [17:0]
  7248. */
  7249. union {
  7250. /*
  7251. * fisa_control_bits structure is deprecated.
  7252. * Please use fisa_control_bits_v2 going forward.
  7253. */
  7254. struct {
  7255. A_UINT32 fisa_enable: 1,
  7256. ipsec_skip_search: 1,
  7257. nontcp_skip_search: 1,
  7258. add_ipv4_fixed_hdr_len: 1,
  7259. add_ipv6_fixed_hdr_len: 1,
  7260. add_tcp_fixed_hdr_len: 1,
  7261. add_udp_hdr_len: 1,
  7262. chksum_cum_ip_len_en: 1,
  7263. disable_tid_check: 1,
  7264. disable_ta_check: 1,
  7265. disable_qos_check: 1,
  7266. disable_raw_check: 1,
  7267. disable_decrypt_err_check: 1,
  7268. disable_msdu_drop_check: 1,
  7269. fisa_aggr_limit: 4,
  7270. reserved: 14;
  7271. } fisa_control_bits;
  7272. struct {
  7273. A_UINT32 fisa_enable: 1,
  7274. fisa_aggr_limit: 4,
  7275. reserved: 27;
  7276. } fisa_control_bits_v2;
  7277. A_UINT32 fisa_control_value;
  7278. } u_fisa_control;
  7279. /**
  7280. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7281. * timeout threshold for aggregation. Unit in usec.
  7282. * [31:0]
  7283. */
  7284. A_UINT32 fisa_timeout_threshold;
  7285. } POSTPACK;
  7286. /* DWord 0: pdev-ID */
  7287. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7288. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7289. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7290. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7291. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7292. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7293. do { \
  7294. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7295. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7296. } while (0)
  7297. /* Dword 1: fisa_control_value fisa config */
  7298. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7299. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7300. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7301. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7302. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7303. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7304. do { \
  7305. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7306. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7307. } while (0)
  7308. /* Dword 1: fisa_control_value ipsec_skip_search */
  7309. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7310. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7311. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7312. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7313. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7314. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7315. do { \
  7316. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7317. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7318. } while (0)
  7319. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7320. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7321. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7322. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7323. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7324. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7325. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7326. do { \
  7327. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7328. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7329. } while (0)
  7330. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7331. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7332. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7333. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7334. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7335. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7336. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7337. do { \
  7338. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7339. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7340. } while (0)
  7341. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7342. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7343. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7344. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7345. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7346. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7347. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7348. do { \
  7349. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7350. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7351. } while (0)
  7352. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7353. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7354. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7355. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7356. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7357. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7358. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7359. do { \
  7360. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7361. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7362. } while (0)
  7363. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7364. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7365. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7366. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7367. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7368. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7369. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7370. do { \
  7371. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7372. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7373. } while (0)
  7374. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7375. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7376. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7377. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7378. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7379. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7380. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7381. do { \
  7382. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7383. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7384. } while (0)
  7385. /* Dword 1: fisa_control_value disable_tid_check */
  7386. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7387. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7388. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7389. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7390. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7391. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7392. do { \
  7393. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7394. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7395. } while (0)
  7396. /* Dword 1: fisa_control_value disable_ta_check */
  7397. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7398. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7399. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7400. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7401. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7402. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7403. do { \
  7404. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7405. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7406. } while (0)
  7407. /* Dword 1: fisa_control_value disable_qos_check */
  7408. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7409. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7410. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7411. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7412. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7413. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7414. do { \
  7415. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7416. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7417. } while (0)
  7418. /* Dword 1: fisa_control_value disable_raw_check */
  7419. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7420. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7421. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7422. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7423. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7424. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7425. do { \
  7426. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7427. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7428. } while (0)
  7429. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7430. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7431. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7432. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7433. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7434. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7435. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7436. do { \
  7437. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7438. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7439. } while (0)
  7440. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7441. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7442. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7443. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7444. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7445. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7446. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7447. do { \
  7448. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7449. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7450. } while (0)
  7451. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7452. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7453. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7454. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7455. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7456. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7457. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7458. do { \
  7459. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7460. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7461. } while (0)
  7462. /* Dword 1: fisa_control_value fisa config */
  7463. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7464. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7465. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7466. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7467. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7468. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7469. do { \
  7470. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7471. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7472. } while (0)
  7473. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7474. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7475. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7476. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7477. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7478. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7479. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7480. do { \
  7481. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7482. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7483. } while (0)
  7484. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7485. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7486. pdev_id:8,
  7487. reserved0:16;
  7488. A_UINT32 num_records:20,
  7489. max_search:8,
  7490. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7491. reserved1:2;
  7492. A_UINT32 base_addr_lo;
  7493. A_UINT32 base_addr_hi;
  7494. A_UINT32 toeplitz31_0;
  7495. A_UINT32 toeplitz63_32;
  7496. A_UINT32 toeplitz95_64;
  7497. A_UINT32 toeplitz127_96;
  7498. A_UINT32 toeplitz159_128;
  7499. A_UINT32 toeplitz191_160;
  7500. A_UINT32 toeplitz223_192;
  7501. A_UINT32 toeplitz255_224;
  7502. A_UINT32 toeplitz287_256;
  7503. A_UINT32 toeplitz314_288:27,
  7504. reserved2:5;
  7505. } POSTPACK;
  7506. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7507. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7508. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7509. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7510. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7511. /* DWORD 0: Pdev ID */
  7512. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7513. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7514. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7515. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7516. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7517. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7518. do { \
  7519. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7520. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7521. } while (0)
  7522. /* DWORD 1:num of records */
  7523. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7524. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7525. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7526. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7527. HTT_RX_FSE_SETUP_NUM_REC_S)
  7528. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7529. do { \
  7530. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7531. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7532. } while (0)
  7533. /* DWORD 1:max_search */
  7534. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7535. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7536. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7537. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7538. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7539. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7540. do { \
  7541. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7542. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7543. } while (0)
  7544. /* DWORD 1:ip_da_sa prefix */
  7545. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7546. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7547. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7548. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7549. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7550. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7551. do { \
  7552. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7553. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7554. } while (0)
  7555. /* DWORD 2: Base Address LO */
  7556. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7557. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7558. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7559. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7560. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7561. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7562. do { \
  7563. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7564. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7565. } while (0)
  7566. /* DWORD 3: Base Address High */
  7567. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7568. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7569. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7570. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7571. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7572. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7573. do { \
  7574. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7575. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7576. } while (0)
  7577. /* DWORD 4-12: Hash Value */
  7578. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7579. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7580. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7581. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7582. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7583. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7584. do { \
  7585. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7586. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7587. } while (0)
  7588. /* DWORD 13: Hash Value 314:288 bits */
  7589. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7590. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7591. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7592. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7593. do { \
  7594. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7595. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7596. } while (0)
  7597. /**
  7598. * @brief Host-->target HTT RX FSE operation message
  7599. *
  7600. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7601. *
  7602. * @details
  7603. * The host will send this Flow Search Engine (FSE) operation message for
  7604. * every flow add/delete operation.
  7605. * The FSE operation includes FSE full cache invalidation or individual entry
  7606. * invalidation.
  7607. * This message can be sent per SOC or per PDEV which is differentiated
  7608. * by pdev id values.
  7609. *
  7610. * |31 16|15 8|7 1|0|
  7611. * |-------------------------------------------------------------|
  7612. * | reserved | pdev_id | MSG_TYPE |
  7613. * |-------------------------------------------------------------|
  7614. * | reserved | operation |I|
  7615. * |-------------------------------------------------------------|
  7616. * | ip_src_addr_31_0 |
  7617. * |-------------------------------------------------------------|
  7618. * | ip_src_addr_63_32 |
  7619. * |-------------------------------------------------------------|
  7620. * | ip_src_addr_95_64 |
  7621. * |-------------------------------------------------------------|
  7622. * | ip_src_addr_127_96 |
  7623. * |-------------------------------------------------------------|
  7624. * | ip_dst_addr_31_0 |
  7625. * |-------------------------------------------------------------|
  7626. * | ip_dst_addr_63_32 |
  7627. * |-------------------------------------------------------------|
  7628. * | ip_dst_addr_95_64 |
  7629. * |-------------------------------------------------------------|
  7630. * | ip_dst_addr_127_96 |
  7631. * |-------------------------------------------------------------|
  7632. * | l4_dst_port | l4_src_port |
  7633. * | (32-bit SPI incase of IPsec) |
  7634. * |-------------------------------------------------------------|
  7635. * | reserved | l4_proto |
  7636. * |-------------------------------------------------------------|
  7637. *
  7638. * where I is 1-bit ipsec_valid.
  7639. *
  7640. * The following field definitions describe the format of the RX FSE operation
  7641. * message sent from the host to target for every add/delete flow entry to flow
  7642. * table.
  7643. *
  7644. * Header fields:
  7645. * dword0 - b'7:0 - msg_type: This will be set to
  7646. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7647. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7648. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7649. * specified pdev's LMAC ring.
  7650. * b'31:16 - reserved : Reserved for future use
  7651. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7652. * (Internet Protocol Security).
  7653. * IPsec describes the framework for providing security at
  7654. * IP layer. IPsec is defined for both versions of IP:
  7655. * IPV4 and IPV6.
  7656. * Please refer to htt_rx_flow_proto enumeration below for
  7657. * more info.
  7658. * ipsec_valid = 1 for IPSEC packets
  7659. * ipsec_valid = 0 for IP Packets
  7660. * b'7:1 - operation: This indicates types of FSE operation.
  7661. * Refer to htt_rx_fse_operation enumeration:
  7662. * 0 - No Cache Invalidation required
  7663. * 1 - Cache invalidate only one entry given by IP
  7664. * src/dest address at DWORD[2:9]
  7665. * 2 - Complete FSE Cache Invalidation
  7666. * 3 - FSE Disable
  7667. * 4 - FSE Enable
  7668. * b'31:8 - reserved: Reserved for future use
  7669. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7670. * for per flow addition/deletion
  7671. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7672. * and the subsequent 3 A_UINT32 will be padding bytes.
  7673. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7674. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7675. * from 0 to 65535 but only 0 to 1023 are designated as
  7676. * well-known ports. Refer to [RFC1700] for more details.
  7677. * This field is valid only if
  7678. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7679. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7680. * range from 0 to 65535 but only 0 to 1023 are designated
  7681. * as well-known ports. Refer to [RFC1700] for more details.
  7682. * This field is valid only if
  7683. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7684. * - SPI (31:0): Security Parameters Index is an
  7685. * identification tag added to the header while using IPsec
  7686. * for tunneling the IP traffici.
  7687. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7688. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7689. * Assigned Internet Protocol Numbers.
  7690. * l4_proto numbers for standard protocol like UDP/TCP
  7691. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7692. * l4_proto = 17 for UDP etc.
  7693. * b'31:8 - reserved: Reserved for future use.
  7694. *
  7695. */
  7696. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7697. A_UINT32 msg_type:8,
  7698. pdev_id:8,
  7699. reserved0:16;
  7700. A_UINT32 ipsec_valid:1,
  7701. operation:7,
  7702. reserved1:24;
  7703. A_UINT32 ip_src_addr_31_0;
  7704. A_UINT32 ip_src_addr_63_32;
  7705. A_UINT32 ip_src_addr_95_64;
  7706. A_UINT32 ip_src_addr_127_96;
  7707. A_UINT32 ip_dest_addr_31_0;
  7708. A_UINT32 ip_dest_addr_63_32;
  7709. A_UINT32 ip_dest_addr_95_64;
  7710. A_UINT32 ip_dest_addr_127_96;
  7711. union {
  7712. A_UINT32 spi;
  7713. struct {
  7714. A_UINT32 l4_src_port:16,
  7715. l4_dest_port:16;
  7716. } ip;
  7717. } u;
  7718. A_UINT32 l4_proto:8,
  7719. reserved:24;
  7720. } POSTPACK;
  7721. /**
  7722. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7723. *
  7724. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7725. *
  7726. * @details
  7727. * The host will send this Full monitor mode register configuration message.
  7728. * This message can be sent per SOC or per PDEV which is differentiated
  7729. * by pdev id values.
  7730. *
  7731. * |31 16|15 11|10 8|7 3|2|1|0|
  7732. * |-------------------------------------------------------------|
  7733. * | reserved | pdev_id | MSG_TYPE |
  7734. * |-------------------------------------------------------------|
  7735. * | reserved |Release Ring |N|Z|E|
  7736. * |-------------------------------------------------------------|
  7737. *
  7738. * where E is 1-bit full monitor mode enable/disable.
  7739. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7740. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7741. *
  7742. * The following field definitions describe the format of the full monitor
  7743. * mode configuration message sent from the host to target for each pdev.
  7744. *
  7745. * Header fields:
  7746. * dword0 - b'7:0 - msg_type: This will be set to
  7747. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7748. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7749. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7750. * specified pdev's LMAC ring.
  7751. * b'31:16 - reserved : Reserved for future use.
  7752. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7753. * monitor mode rxdma register is to be enabled or disabled.
  7754. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7755. * additional descriptors at ppdu end for zero mpdus
  7756. * enabled or disabled.
  7757. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7758. * additional descriptors at ppdu end for non zero mpdus
  7759. * enabled or disabled.
  7760. * b'10:3 - release_ring: This indicates the destination ring
  7761. * selection for the descriptor at the end of PPDU
  7762. * 0 - REO ring select
  7763. * 1 - FW ring select
  7764. * 2 - SW ring select
  7765. * 3 - Release ring select
  7766. * Refer to htt_rx_full_mon_release_ring.
  7767. * b'31:11 - reserved for future use
  7768. */
  7769. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7770. A_UINT32 msg_type:8,
  7771. pdev_id:8,
  7772. reserved0:16;
  7773. A_UINT32 full_monitor_mode_enable:1,
  7774. addnl_descs_zero_mpdus_end:1,
  7775. addnl_descs_non_zero_mpdus_end:1,
  7776. release_ring:8,
  7777. reserved1:21;
  7778. } POSTPACK;
  7779. /**
  7780. * Enumeration for full monitor mode destination ring select
  7781. * 0 - REO destination ring select
  7782. * 1 - FW destination ring select
  7783. * 2 - SW destination ring select
  7784. * 3 - Release destination ring select
  7785. */
  7786. enum htt_rx_full_mon_release_ring {
  7787. HTT_RX_MON_RING_REO,
  7788. HTT_RX_MON_RING_FW,
  7789. HTT_RX_MON_RING_SW,
  7790. HTT_RX_MON_RING_RELEASE,
  7791. };
  7792. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7793. /* DWORD 0: Pdev ID */
  7794. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7795. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7796. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7797. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7798. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7799. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7800. do { \
  7801. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7802. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7803. } while (0)
  7804. /* DWORD 1:ENABLE */
  7805. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7806. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7807. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7808. do { \
  7809. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7810. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7811. } while (0)
  7812. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7813. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7814. /* DWORD 1:ZERO_MPDU */
  7815. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7816. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7817. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7818. do { \
  7819. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7820. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7821. } while (0)
  7822. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7823. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7824. /* DWORD 1:NON_ZERO_MPDU */
  7825. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7826. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7827. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7828. do { \
  7829. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7830. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7831. } while (0)
  7832. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7833. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7834. /* DWORD 1:RELEASE_RINGS */
  7835. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7836. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7837. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7838. do { \
  7839. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7840. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7841. } while (0)
  7842. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7843. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7844. /**
  7845. * Enumeration for IP Protocol or IPSEC Protocol
  7846. * IPsec describes the framework for providing security at IP layer.
  7847. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7848. */
  7849. enum htt_rx_flow_proto {
  7850. HTT_RX_FLOW_IP_PROTO,
  7851. HTT_RX_FLOW_IPSEC_PROTO,
  7852. };
  7853. /**
  7854. * Enumeration for FSE Cache Invalidation
  7855. * 0 - No Cache Invalidation required
  7856. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  7857. * 2 - Complete FSE Cache Invalidation
  7858. * 3 - FSE Disable
  7859. * 4 - FSE Enable
  7860. */
  7861. enum htt_rx_fse_operation {
  7862. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  7863. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  7864. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  7865. HTT_RX_FSE_DISABLE,
  7866. HTT_RX_FSE_ENABLE,
  7867. };
  7868. /* DWORD 0: Pdev ID */
  7869. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  7870. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  7871. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  7872. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  7873. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  7874. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  7875. do { \
  7876. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  7877. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  7878. } while (0)
  7879. /* DWORD 1:IP PROTO or IPSEC */
  7880. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  7881. #define HTT_RX_FSE_IPSEC_VALID_S 0
  7882. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  7883. do { \
  7884. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  7885. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  7886. } while (0)
  7887. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  7888. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  7889. /* DWORD 1:FSE Operation */
  7890. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  7891. #define HTT_RX_FSE_OPERATION_S 1
  7892. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  7893. do { \
  7894. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  7895. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  7896. } while (0)
  7897. #define HTT_RX_FSE_OPERATION_GET(word) \
  7898. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  7899. /* DWORD 2-9:IP Address */
  7900. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  7901. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  7902. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  7903. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  7904. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  7905. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  7906. do { \
  7907. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  7908. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  7909. } while (0)
  7910. /* DWORD 10:Source Port Number */
  7911. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  7912. #define HTT_RX_FSE_SOURCEPORT_S 0
  7913. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  7914. do { \
  7915. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  7916. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  7917. } while (0)
  7918. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  7919. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  7920. /* DWORD 11:Destination Port Number */
  7921. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  7922. #define HTT_RX_FSE_DESTPORT_S 16
  7923. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  7924. do { \
  7925. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  7926. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  7927. } while (0)
  7928. #define HTT_RX_FSE_DESTPORT_GET(word) \
  7929. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  7930. /* DWORD 10-11:SPI (In case of IPSEC) */
  7931. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7932. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7933. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7934. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7935. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7936. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7937. do { \
  7938. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7939. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7940. } while (0)
  7941. /* DWORD 12:L4 PROTO */
  7942. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7943. #define HTT_RX_FSE_L4_PROTO_S 0
  7944. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7945. do { \
  7946. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7947. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7948. } while (0)
  7949. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7950. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7951. /**
  7952. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7953. *
  7954. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7955. *
  7956. * |31 24|23 |15 8|7 2|1|0|
  7957. * |----------------+----------------+----------------+----------------|
  7958. * | reserved | pdev_id | msg_type |
  7959. * |---------------------------------+----------------+----------------|
  7960. * | reserved |E|F|
  7961. * |---------------------------------+----------------+----------------|
  7962. * Where E = Configure the target to provide the 3-tuple hash value in
  7963. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7964. * F = Configure the target to provide the 3-tuple hash value in
  7965. * flow_id_toeplitz field of rx_msdu_start tlv
  7966. *
  7967. * The following field definitions describe the format of the 3 tuple hash value
  7968. * message sent from the host to target as part of initialization sequence.
  7969. *
  7970. * Header fields:
  7971. * dword0 - b'7:0 - msg_type: This will be set to
  7972. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7973. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7974. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7975. * specified pdev's LMAC ring.
  7976. * b'31:16 - reserved : Reserved for future use
  7977. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7978. * b'1 - toeplitz_hash_2_or_4_field_enable
  7979. * b'31:2 - reserved : Reserved for future use
  7980. * ---------+------+----------------------------------------------------------
  7981. * bit1 | bit0 | Functionality
  7982. * ---------+------+----------------------------------------------------------
  7983. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7984. * | | in flow_id_toeplitz field
  7985. * ---------+------+----------------------------------------------------------
  7986. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7987. * | | in toeplitz_hash_2_or_4 field
  7988. * ---------+------+----------------------------------------------------------
  7989. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7990. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7991. * ---------+------+----------------------------------------------------------
  7992. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7993. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7994. * | | toeplitz_hash_2_or_4 field
  7995. *----------------------------------------------------------------------------
  7996. */
  7997. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7998. A_UINT32 msg_type :8,
  7999. pdev_id :8,
  8000. reserved0 :16;
  8001. A_UINT32 flow_id_toeplitz_field_enable :1,
  8002. toeplitz_hash_2_or_4_field_enable :1,
  8003. reserved1 :30;
  8004. } POSTPACK;
  8005. /* DWORD0 : pdev_id configuration Macros */
  8006. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8007. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8008. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8009. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8010. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8011. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8012. do { \
  8013. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8014. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8015. } while (0)
  8016. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8017. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8018. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8019. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8020. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8021. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8022. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8023. do { \
  8024. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8025. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8026. } while (0)
  8027. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8028. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8029. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8030. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8031. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8032. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8033. do { \
  8034. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8035. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8036. } while (0)
  8037. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8038. /**
  8039. * @brief host --> target Host PA Address Size
  8040. *
  8041. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8042. *
  8043. * @details
  8044. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8045. * provide the physical start address and size of each of the memory
  8046. * areas within host DDR that the target FW may need to access.
  8047. *
  8048. * For example, the host can use this message to allow the target FW
  8049. * to set up access to the host's pools of TQM link descriptors.
  8050. * The message would appear as follows:
  8051. *
  8052. * |31 24|23 16|15 8|7 0|
  8053. * |----------------+----------------+----------------+----------------|
  8054. * | reserved | num_entries | msg_type |
  8055. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8056. * | mem area 0 size |
  8057. * |----------------+----------------+----------------+----------------|
  8058. * | mem area 0 physical_address_lo |
  8059. * |----------------+----------------+----------------+----------------|
  8060. * | mem area 0 physical_address_hi |
  8061. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8062. * | mem area 1 size |
  8063. * |----------------+----------------+----------------+----------------|
  8064. * | mem area 1 physical_address_lo |
  8065. * |----------------+----------------+----------------+----------------|
  8066. * | mem area 1 physical_address_hi |
  8067. * |----------------+----------------+----------------+----------------|
  8068. * ...
  8069. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8070. * | mem area N size |
  8071. * |----------------+----------------+----------------+----------------|
  8072. * | mem area N physical_address_lo |
  8073. * |----------------+----------------+----------------+----------------|
  8074. * | mem area N physical_address_hi |
  8075. * |----------------+----------------+----------------+----------------|
  8076. *
  8077. * The message is interpreted as follows:
  8078. * dword0 - b'0:7 - msg_type: This will be set to
  8079. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8080. * b'8:15 - number_entries: Indicated the number of host memory
  8081. * areas specified within the remainder of the message
  8082. * b'16:31 - reserved.
  8083. * dword1 - b'0:31 - memory area 0 size in bytes
  8084. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8085. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8086. * and similar for memory area 1 through memory area N.
  8087. */
  8088. PREPACK struct htt_h2t_host_paddr_size {
  8089. A_UINT32 msg_type: 8,
  8090. num_entries: 8,
  8091. reserved: 16;
  8092. } POSTPACK;
  8093. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8094. A_UINT32 size;
  8095. A_UINT32 physical_address_lo;
  8096. A_UINT32 physical_address_hi;
  8097. } POSTPACK;
  8098. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8099. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8100. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8101. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8102. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8103. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8104. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8105. do { \
  8106. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8107. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8108. } while (0)
  8109. /**
  8110. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8111. *
  8112. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8113. *
  8114. * @details
  8115. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8116. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8117. *
  8118. * The message would appear as follows:
  8119. *
  8120. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8121. * |---------------------------------+---+---+----------+-+-----------|
  8122. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8123. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8124. *
  8125. *
  8126. * The message is interpreted as follows:
  8127. * dword0 - b'0:7 - msg_type: This will be set to
  8128. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8129. * b'8 - override bit to drive MSDUs to PPE ring
  8130. * b'9:13 - REO destination ring indication
  8131. * b'14 - Multi buffer msdu override enable bit
  8132. * b'15 - Intra BSS override
  8133. * b'16 - Decap raw override
  8134. * b'17 - Decap Native wifi override
  8135. * b'18 - IP frag override
  8136. * b'19:31 - reserved
  8137. */
  8138. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8139. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8140. override: 1,
  8141. reo_destination_indication: 5,
  8142. multi_buffer_msdu_override_en: 1,
  8143. intra_bss_override: 1,
  8144. decap_raw_override: 1,
  8145. decap_nwifi_override: 1,
  8146. ip_frag_override: 1,
  8147. reserved: 13;
  8148. } POSTPACK;
  8149. /* DWORD 0: Override */
  8150. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8151. #define HTT_PPE_CFG_OVERRIDE_S 8
  8152. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8153. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8154. HTT_PPE_CFG_OVERRIDE_S)
  8155. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8156. do { \
  8157. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8158. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8159. } while (0)
  8160. /* DWORD 0: REO Destination Indication*/
  8161. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8162. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8163. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8164. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8165. HTT_PPE_CFG_REO_DEST_IND_S)
  8166. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8167. do { \
  8168. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8169. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8170. } while (0)
  8171. /* DWORD 0: Multi buffer MSDU override */
  8172. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8173. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8174. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8175. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8176. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8177. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8178. do { \
  8179. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8180. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8181. } while (0)
  8182. /* DWORD 0: Intra BSS override */
  8183. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8184. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8185. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8186. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8187. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8188. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8189. do { \
  8190. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8191. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8192. } while (0)
  8193. /* DWORD 0: Decap RAW override */
  8194. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8195. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8196. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8197. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8198. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8199. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8200. do { \
  8201. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8202. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8203. } while (0)
  8204. /* DWORD 0: Decap NWIFI override */
  8205. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8206. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8207. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8208. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8209. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8210. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8211. do { \
  8212. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8213. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8214. } while (0)
  8215. /* DWORD 0: IP frag override */
  8216. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8217. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8218. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8219. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8220. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8221. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8222. do { \
  8223. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8224. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8225. } while (0)
  8226. /*
  8227. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8228. *
  8229. * @details
  8230. * The following field definitions describe the format of the HTT host
  8231. * to target FW VDEV TX RX stats retrieve message.
  8232. * The message specifies the type of stats the host wants to retrieve.
  8233. *
  8234. * |31 27|26 25|24 17|16|15 8|7 0|
  8235. * |-----------------------------------------------------------|
  8236. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8237. * |-----------------------------------------------------------|
  8238. * | vdev_id lower bitmask |
  8239. * |-----------------------------------------------------------|
  8240. * | vdev_id upper bitmask |
  8241. * |-----------------------------------------------------------|
  8242. * Header fields:
  8243. * Where:
  8244. * dword0 - b'7:0 - msg_type: This will be set to
  8245. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8246. * b'15:8 - pdev id
  8247. * b'16(E) - Enable/Disable the vdev HW stats
  8248. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8249. * b'25:26(R) - Reset stats bits
  8250. * 0: don't reset stats
  8251. * 1: reset stats once
  8252. * 2: reset stats at the start of each periodic interval
  8253. * b'27:31 - reserved for future use
  8254. * dword1 - b'0:31 - vdev_id lower bitmask
  8255. * dword2 - b'0:31 - vdev_id upper bitmask
  8256. */
  8257. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8258. A_UINT32 msg_type :8,
  8259. pdev_id :8,
  8260. enable :1,
  8261. periodic_interval :8,
  8262. reset_stats_bits :2,
  8263. reserved0 :5;
  8264. A_UINT32 vdev_id_lower_bitmask;
  8265. A_UINT32 vdev_id_upper_bitmask;
  8266. } POSTPACK;
  8267. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8268. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8269. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8270. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8271. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8272. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8273. do { \
  8274. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8275. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8276. } while (0)
  8277. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8278. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8279. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8280. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8281. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8282. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8283. do { \
  8284. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8285. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8286. } while (0)
  8287. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8288. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8289. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8290. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8291. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8292. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8293. do { \
  8294. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8295. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8296. } while (0)
  8297. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8298. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8299. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8300. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8301. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8302. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8303. do { \
  8304. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8305. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8306. } while (0)
  8307. /*
  8308. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8309. *
  8310. * @details
  8311. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8312. * the default MSDU queues for one of the TIDs within the specified peer
  8313. * to the specified service class.
  8314. * The TID is indirectly specified - each service class is associated
  8315. * with a TID. All default MSDU queues for this peer-TID will be
  8316. * linked to the service class in question.
  8317. *
  8318. * |31 16|15 8|7 0|
  8319. * |------------------------------+--------------+--------------|
  8320. * | peer ID | svc class ID | msg type |
  8321. * |------------------------------------------------------------|
  8322. * Header fields:
  8323. * dword0 - b'7:0 - msg_type: This will be set to
  8324. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8325. * b'15:8 - service class ID
  8326. * b'31:16 - peer ID
  8327. */
  8328. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8329. A_UINT32 msg_type :8,
  8330. svc_class_id :8,
  8331. peer_id :16;
  8332. } POSTPACK;
  8333. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8334. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8335. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8336. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8337. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8338. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8339. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8340. do { \
  8341. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8342. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8343. } while (0)
  8344. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8345. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8346. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8347. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8348. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8349. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8350. do { \
  8351. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8352. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8353. } while (0)
  8354. /*
  8355. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8356. *
  8357. * @details
  8358. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8359. * remove the linkage of the specified peer-TID's MSDU queues to
  8360. * service classes.
  8361. *
  8362. * |31 16|15 8|7 0|
  8363. * |------------------------------+--------------+--------------|
  8364. * | peer ID | svc class ID | msg type |
  8365. * |------------------------------------------------------------|
  8366. * Header fields:
  8367. * dword0 - b'7:0 - msg_type: This will be set to
  8368. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8369. * b'15:8 - service class ID
  8370. * dword1 - b'31:16 - peer ID
  8371. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8372. * value for peer ID indicates that the target should
  8373. * apply the UNMAP_REQ to all peers.
  8374. */
  8375. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8376. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8377. A_UINT32 msg_type :8,
  8378. svc_class_id :8,
  8379. peer_id :16;
  8380. } POSTPACK;
  8381. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8382. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8383. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8384. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(_var) \
  8385. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8386. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8387. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8388. do { \
  8389. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8390. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8391. } while (0)
  8392. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8393. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8394. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(_var) \
  8395. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8396. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8397. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(_var, _val) \
  8398. do { \
  8399. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8400. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8401. } while (0)
  8402. /*
  8403. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8404. *
  8405. * @details
  8406. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8407. * request the target to report what service class the default MSDU queues
  8408. * of the specified TIDs within the peer are linked to.
  8409. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8410. * to report what service class (if any) the default MSDU queues for
  8411. * each of the specified TIDs are linked to.
  8412. *
  8413. * |31 16|15 8|7 0|
  8414. * |------------------------------+--------------+--------------|
  8415. * | peer ID | TID mask | msg type |
  8416. * |------------------------------------------------------------|
  8417. * Header fields:
  8418. * dword0 - b'7:0 - msg_type: This will be set to
  8419. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8420. * b'15:8 - TID mask
  8421. * dword1 - b'31:16 - peer ID
  8422. */
  8423. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8424. A_UINT32 msg_type :8,
  8425. tid_mask :8,
  8426. peer_id :16;
  8427. } POSTPACK;
  8428. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 4
  8429. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8430. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8431. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(_var) \
  8432. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8433. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8434. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(_var, _val) \
  8435. do { \
  8436. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8437. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8438. } while (0)
  8439. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8440. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8441. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(_var) \
  8442. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8443. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8444. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(_var, _val) \
  8445. do { \
  8446. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8447. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8448. } while (0)
  8449. /*=== target -> host messages ===============================================*/
  8450. enum htt_t2h_msg_type {
  8451. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8452. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8453. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8454. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8455. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8456. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8457. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8458. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8459. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8460. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8461. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8462. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8463. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8464. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8465. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8466. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8467. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8468. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8469. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8470. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8471. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8472. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8473. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8474. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8475. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8476. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8477. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8478. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8479. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8480. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8481. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8482. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8483. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8484. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8485. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8486. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8487. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8488. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8489. /* TX_OFFLOAD_DELIVER_IND:
  8490. * Forward the target's locally-generated packets to the host,
  8491. * to provide to the monitor mode interface.
  8492. */
  8493. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8494. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8495. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8496. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8497. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8498. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8499. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8500. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8501. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8502. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e,
  8503. HTT_T2H_MSG_TYPE_TEST,
  8504. /* keep this last */
  8505. HTT_T2H_NUM_MSGS
  8506. };
  8507. /*
  8508. * HTT target to host message type -
  8509. * stored in bits 7:0 of the first word of the message
  8510. */
  8511. #define HTT_T2H_MSG_TYPE_M 0xff
  8512. #define HTT_T2H_MSG_TYPE_S 0
  8513. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8514. do { \
  8515. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8516. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8517. } while (0)
  8518. #define HTT_T2H_MSG_TYPE_GET(word) \
  8519. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8520. /**
  8521. * @brief target -> host version number confirmation message definition
  8522. *
  8523. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8524. *
  8525. * |31 24|23 16|15 8|7 0|
  8526. * |----------------+----------------+----------------+----------------|
  8527. * | reserved | major number | minor number | msg type |
  8528. * |-------------------------------------------------------------------|
  8529. * : option request TLV (optional) |
  8530. * :...................................................................:
  8531. *
  8532. * The VER_CONF message may consist of a single 4-byte word, or may be
  8533. * extended with TLVs that specify HTT options selected by the target.
  8534. * The following option TLVs may be appended to the VER_CONF message:
  8535. * - LL_BUS_ADDR_SIZE
  8536. * - HL_SUPPRESS_TX_COMPL_IND
  8537. * - MAX_TX_QUEUE_GROUPS
  8538. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8539. * may be appended to the VER_CONF message (but only one TLV of each type).
  8540. *
  8541. * Header fields:
  8542. * - MSG_TYPE
  8543. * Bits 7:0
  8544. * Purpose: identifies this as a version number confirmation message
  8545. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8546. * - VER_MINOR
  8547. * Bits 15:8
  8548. * Purpose: Specify the minor number of the HTT message library version
  8549. * in use by the target firmware.
  8550. * The minor number specifies the specific revision within a range
  8551. * of fundamentally compatible HTT message definition revisions.
  8552. * Compatible revisions involve adding new messages or perhaps
  8553. * adding new fields to existing messages, in a backwards-compatible
  8554. * manner.
  8555. * Incompatible revisions involve changing the message type values,
  8556. * or redefining existing messages.
  8557. * Value: minor number
  8558. * - VER_MAJOR
  8559. * Bits 15:8
  8560. * Purpose: Specify the major number of the HTT message library version
  8561. * in use by the target firmware.
  8562. * The major number specifies the family of minor revisions that are
  8563. * fundamentally compatible with each other, but not with prior or
  8564. * later families.
  8565. * Value: major number
  8566. */
  8567. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8568. #define HTT_VER_CONF_MINOR_S 8
  8569. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8570. #define HTT_VER_CONF_MAJOR_S 16
  8571. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8572. do { \
  8573. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8574. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8575. } while (0)
  8576. #define HTT_VER_CONF_MINOR_GET(word) \
  8577. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8578. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8579. do { \
  8580. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8581. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8582. } while (0)
  8583. #define HTT_VER_CONF_MAJOR_GET(word) \
  8584. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  8585. #define HTT_VER_CONF_BYTES 4
  8586. /**
  8587. * @brief - target -> host HTT Rx In order indication message
  8588. *
  8589. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  8590. *
  8591. * @details
  8592. *
  8593. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  8594. * |----------------+-------------------+---------------------+---------------|
  8595. * | peer ID | P| F| O| ext TID | msg type |
  8596. * |--------------------------------------------------------------------------|
  8597. * | MSDU count | Reserved | vdev id |
  8598. * |--------------------------------------------------------------------------|
  8599. * | MSDU 0 bus address (bits 31:0) |
  8600. #if HTT_PADDR64
  8601. * | MSDU 0 bus address (bits 63:32) |
  8602. #endif
  8603. * |--------------------------------------------------------------------------|
  8604. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  8605. * |--------------------------------------------------------------------------|
  8606. * | MSDU 1 bus address (bits 31:0) |
  8607. #if HTT_PADDR64
  8608. * | MSDU 1 bus address (bits 63:32) |
  8609. #endif
  8610. * |--------------------------------------------------------------------------|
  8611. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  8612. * |--------------------------------------------------------------------------|
  8613. */
  8614. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  8615. *
  8616. * @details
  8617. * bits
  8618. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  8619. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8620. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  8621. * | | frag | | | | fail |chksum fail|
  8622. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8623. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  8624. */
  8625. struct htt_rx_in_ord_paddr_ind_hdr_t
  8626. {
  8627. A_UINT32 /* word 0 */
  8628. msg_type: 8,
  8629. ext_tid: 5,
  8630. offload: 1,
  8631. frag: 1,
  8632. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  8633. peer_id: 16;
  8634. A_UINT32 /* word 1 */
  8635. vap_id: 8,
  8636. /* NOTE:
  8637. * This reserved_1 field is not truly reserved - certain targets use
  8638. * this field internally to store debug information, and do not zero
  8639. * out the contents of the field before uploading the message to the
  8640. * host. Thus, any host-target communication supported by this field
  8641. * is limited to using values that are never used by the debug
  8642. * information stored by certain targets in the reserved_1 field.
  8643. * In particular, the targets in question don't use the value 0x3
  8644. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  8645. * so this previously-unused value within these bits is available to
  8646. * use as the host / target PKT_CAPTURE_MODE flag.
  8647. */
  8648. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  8649. /* if pkt_capture_mode == 0x3, host should
  8650. * send rx frames to monitor mode interface
  8651. */
  8652. msdu_cnt: 16;
  8653. };
  8654. struct htt_rx_in_ord_paddr_ind_msdu32_t
  8655. {
  8656. A_UINT32 dma_addr;
  8657. A_UINT32
  8658. length: 16,
  8659. fw_desc: 8,
  8660. msdu_info:8;
  8661. };
  8662. struct htt_rx_in_ord_paddr_ind_msdu64_t
  8663. {
  8664. A_UINT32 dma_addr_lo;
  8665. A_UINT32 dma_addr_hi;
  8666. A_UINT32
  8667. length: 16,
  8668. fw_desc: 8,
  8669. msdu_info:8;
  8670. };
  8671. #if HTT_PADDR64
  8672. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  8673. #else
  8674. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  8675. #endif
  8676. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  8677. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  8678. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  8679. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  8680. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  8681. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  8682. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  8683. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  8684. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  8685. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  8686. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  8687. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  8688. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  8689. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  8690. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  8691. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  8692. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  8693. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  8694. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  8695. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  8696. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  8697. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  8698. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  8699. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  8700. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  8701. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  8702. /* for systems using 64-bit format for bus addresses */
  8703. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  8704. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  8705. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  8706. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  8707. /* for systems using 32-bit format for bus addresses */
  8708. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  8709. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  8710. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  8711. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  8712. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  8713. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  8714. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  8715. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  8716. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  8717. do { \
  8718. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  8719. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  8720. } while (0)
  8721. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  8722. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  8723. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  8724. do { \
  8725. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  8726. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  8727. } while (0)
  8728. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  8729. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  8730. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  8731. do { \
  8732. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  8733. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  8734. } while (0)
  8735. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  8736. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  8737. /*
  8738. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  8739. * deliver the rx frames to the monitor mode interface.
  8740. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  8741. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  8742. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  8743. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  8744. */
  8745. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  8746. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  8747. do { \
  8748. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  8749. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  8750. } while (0)
  8751. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  8752. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  8753. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  8754. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  8755. do { \
  8756. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  8757. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  8758. } while (0)
  8759. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  8760. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  8761. /* for systems using 64-bit format for bus addresses */
  8762. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  8763. do { \
  8764. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  8765. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  8766. } while (0)
  8767. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  8768. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  8769. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  8770. do { \
  8771. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  8772. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  8773. } while (0)
  8774. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  8775. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  8776. /* for systems using 32-bit format for bus addresses */
  8777. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  8778. do { \
  8779. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  8780. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  8781. } while (0)
  8782. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  8783. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  8784. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  8785. do { \
  8786. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  8787. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  8788. } while (0)
  8789. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  8790. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  8791. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  8792. do { \
  8793. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  8794. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  8795. } while (0)
  8796. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  8797. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  8798. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  8799. do { \
  8800. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  8801. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  8802. } while (0)
  8803. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  8804. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  8805. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  8806. do { \
  8807. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  8808. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  8809. } while (0)
  8810. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  8811. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  8812. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  8813. do { \
  8814. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  8815. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  8816. } while (0)
  8817. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  8818. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  8819. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  8820. do { \
  8821. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  8822. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  8823. } while (0)
  8824. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  8825. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  8826. /* definitions used within target -> host rx indication message */
  8827. PREPACK struct htt_rx_ind_hdr_prefix_t
  8828. {
  8829. A_UINT32 /* word 0 */
  8830. msg_type: 8,
  8831. ext_tid: 5,
  8832. release_valid: 1,
  8833. flush_valid: 1,
  8834. reserved0: 1,
  8835. peer_id: 16;
  8836. A_UINT32 /* word 1 */
  8837. flush_start_seq_num: 6,
  8838. flush_end_seq_num: 6,
  8839. release_start_seq_num: 6,
  8840. release_end_seq_num: 6,
  8841. num_mpdu_ranges: 8;
  8842. } POSTPACK;
  8843. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  8844. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  8845. #define HTT_TGT_RSSI_INVALID 0x80
  8846. PREPACK struct htt_rx_ppdu_desc_t
  8847. {
  8848. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  8849. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  8850. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  8851. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  8852. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  8853. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  8854. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  8855. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  8856. A_UINT32 /* word 0 */
  8857. rssi_cmb: 8,
  8858. timestamp_submicrosec: 8,
  8859. phy_err_code: 8,
  8860. phy_err: 1,
  8861. legacy_rate: 4,
  8862. legacy_rate_sel: 1,
  8863. end_valid: 1,
  8864. start_valid: 1;
  8865. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  8866. union {
  8867. A_UINT32 /* word 1 */
  8868. rssi0_pri20: 8,
  8869. rssi0_ext20: 8,
  8870. rssi0_ext40: 8,
  8871. rssi0_ext80: 8;
  8872. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  8873. } u0;
  8874. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  8875. union {
  8876. A_UINT32 /* word 2 */
  8877. rssi1_pri20: 8,
  8878. rssi1_ext20: 8,
  8879. rssi1_ext40: 8,
  8880. rssi1_ext80: 8;
  8881. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  8882. } u1;
  8883. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  8884. union {
  8885. A_UINT32 /* word 3 */
  8886. rssi2_pri20: 8,
  8887. rssi2_ext20: 8,
  8888. rssi2_ext40: 8,
  8889. rssi2_ext80: 8;
  8890. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  8891. } u2;
  8892. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  8893. union {
  8894. A_UINT32 /* word 4 */
  8895. rssi3_pri20: 8,
  8896. rssi3_ext20: 8,
  8897. rssi3_ext40: 8,
  8898. rssi3_ext80: 8;
  8899. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  8900. } u3;
  8901. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  8902. A_UINT32 tsf32; /* word 5 */
  8903. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  8904. A_UINT32 timestamp_microsec; /* word 6 */
  8905. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  8906. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  8907. A_UINT32 /* word 7 */
  8908. vht_sig_a1: 24,
  8909. preamble_type: 8;
  8910. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  8911. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  8912. A_UINT32 /* word 8 */
  8913. vht_sig_a2: 24,
  8914. /* sa_ant_matrix
  8915. * For cases where a single rx chain has options to be connected to
  8916. * different rx antennas, show which rx antennas were in use during
  8917. * receipt of a given PPDU.
  8918. * This sa_ant_matrix provides a bitmask of the antennas used while
  8919. * receiving this frame.
  8920. */
  8921. sa_ant_matrix: 8;
  8922. } POSTPACK;
  8923. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  8924. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  8925. PREPACK struct htt_rx_ind_hdr_suffix_t
  8926. {
  8927. A_UINT32 /* word 0 */
  8928. fw_rx_desc_bytes: 16,
  8929. reserved0: 16;
  8930. } POSTPACK;
  8931. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  8932. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  8933. PREPACK struct htt_rx_ind_hdr_t
  8934. {
  8935. struct htt_rx_ind_hdr_prefix_t prefix;
  8936. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  8937. struct htt_rx_ind_hdr_suffix_t suffix;
  8938. } POSTPACK;
  8939. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  8940. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  8941. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  8942. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  8943. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  8944. /*
  8945. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  8946. * the offset into the HTT rx indication message at which the
  8947. * FW rx PPDU descriptor resides
  8948. */
  8949. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  8950. /*
  8951. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  8952. * the offset into the HTT rx indication message at which the
  8953. * header suffix (FW rx MSDU byte count) resides
  8954. */
  8955. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  8956. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  8957. /*
  8958. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  8959. * the offset into the HTT rx indication message at which the per-MSDU
  8960. * information starts
  8961. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  8962. * per-MSDU information portion of the message. The per-MSDU info itself
  8963. * starts at byte 12.
  8964. */
  8965. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  8966. /**
  8967. * @brief target -> host rx indication message definition
  8968. *
  8969. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  8970. *
  8971. * @details
  8972. * The following field definitions describe the format of the rx indication
  8973. * message sent from the target to the host.
  8974. * The message consists of three major sections:
  8975. * 1. a fixed-length header
  8976. * 2. a variable-length list of firmware rx MSDU descriptors
  8977. * 3. one or more 4-octet MPDU range information elements
  8978. * The fixed length header itself has two sub-sections
  8979. * 1. the message meta-information, including identification of the
  8980. * sender and type of the received data, and a 4-octet flush/release IE
  8981. * 2. the firmware rx PPDU descriptor
  8982. *
  8983. * The format of the message is depicted below.
  8984. * in this depiction, the following abbreviations are used for information
  8985. * elements within the message:
  8986. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  8987. * elements associated with the PPDU start are valid.
  8988. * Specifically, the following fields are valid only if SV is set:
  8989. * RSSI (all variants), L, legacy rate, preamble type, service,
  8990. * VHT-SIG-A
  8991. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  8992. * elements associated with the PPDU end are valid.
  8993. * Specifically, the following fields are valid only if EV is set:
  8994. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  8995. * - L - Legacy rate selector - if legacy rates are used, this flag
  8996. * indicates whether the rate is from a CCK (L == 1) or OFDM
  8997. * (L == 0) PHY.
  8998. * - P - PHY error flag - boolean indication of whether the rx frame had
  8999. * a PHY error
  9000. *
  9001. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9002. * |----------------+-------------------+---------------------+---------------|
  9003. * | peer ID | |RV|FV| ext TID | msg type |
  9004. * |--------------------------------------------------------------------------|
  9005. * | num | release | release | flush | flush |
  9006. * | MPDU | end | start | end | start |
  9007. * | ranges | seq num | seq num | seq num | seq num |
  9008. * |==========================================================================|
  9009. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9010. * |V|V| | rate | | | timestamp | RSSI |
  9011. * |--------------------------------------------------------------------------|
  9012. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9013. * |--------------------------------------------------------------------------|
  9014. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9015. * |--------------------------------------------------------------------------|
  9016. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9017. * |--------------------------------------------------------------------------|
  9018. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9019. * |--------------------------------------------------------------------------|
  9020. * | TSF LSBs |
  9021. * |--------------------------------------------------------------------------|
  9022. * | microsec timestamp |
  9023. * |--------------------------------------------------------------------------|
  9024. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9025. * |--------------------------------------------------------------------------|
  9026. * | service | HT-SIG / VHT-SIG-A2 |
  9027. * |==========================================================================|
  9028. * | reserved | FW rx desc bytes |
  9029. * |--------------------------------------------------------------------------|
  9030. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9031. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9032. * |--------------------------------------------------------------------------|
  9033. * : : :
  9034. * |--------------------------------------------------------------------------|
  9035. * | alignment | MSDU Rx |
  9036. * | padding | desc Bn |
  9037. * |--------------------------------------------------------------------------|
  9038. * | reserved | MPDU range status | MPDU count |
  9039. * |--------------------------------------------------------------------------|
  9040. * : reserved : MPDU range status : MPDU count :
  9041. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9042. *
  9043. * Header fields:
  9044. * - MSG_TYPE
  9045. * Bits 7:0
  9046. * Purpose: identifies this as an rx indication message
  9047. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9048. * - EXT_TID
  9049. * Bits 12:8
  9050. * Purpose: identify the traffic ID of the rx data, including
  9051. * special "extended" TID values for multicast, broadcast, and
  9052. * non-QoS data frames
  9053. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9054. * - FLUSH_VALID (FV)
  9055. * Bit 13
  9056. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9057. * is valid
  9058. * Value:
  9059. * 1 -> flush IE is valid and needs to be processed
  9060. * 0 -> flush IE is not valid and should be ignored
  9061. * - REL_VALID (RV)
  9062. * Bit 13
  9063. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9064. * is valid
  9065. * Value:
  9066. * 1 -> release IE is valid and needs to be processed
  9067. * 0 -> release IE is not valid and should be ignored
  9068. * - PEER_ID
  9069. * Bits 31:16
  9070. * Purpose: Identify, by ID, which peer sent the rx data
  9071. * Value: ID of the peer who sent the rx data
  9072. * - FLUSH_SEQ_NUM_START
  9073. * Bits 5:0
  9074. * Purpose: Indicate the start of a series of MPDUs to flush
  9075. * Not all MPDUs within this series are necessarily valid - the host
  9076. * must check each sequence number within this range to see if the
  9077. * corresponding MPDU is actually present.
  9078. * This field is only valid if the FV bit is set.
  9079. * Value:
  9080. * The sequence number for the first MPDUs to check to flush.
  9081. * The sequence number is masked by 0x3f.
  9082. * - FLUSH_SEQ_NUM_END
  9083. * Bits 11:6
  9084. * Purpose: Indicate the end of a series of MPDUs to flush
  9085. * Value:
  9086. * The sequence number one larger than the sequence number of the
  9087. * last MPDU to check to flush.
  9088. * The sequence number is masked by 0x3f.
  9089. * Not all MPDUs within this series are necessarily valid - the host
  9090. * must check each sequence number within this range to see if the
  9091. * corresponding MPDU is actually present.
  9092. * This field is only valid if the FV bit is set.
  9093. * - REL_SEQ_NUM_START
  9094. * Bits 17:12
  9095. * Purpose: Indicate the start of a series of MPDUs to release.
  9096. * All MPDUs within this series are present and valid - the host
  9097. * need not check each sequence number within this range to see if
  9098. * the corresponding MPDU is actually present.
  9099. * This field is only valid if the RV bit is set.
  9100. * Value:
  9101. * The sequence number for the first MPDUs to check to release.
  9102. * The sequence number is masked by 0x3f.
  9103. * - REL_SEQ_NUM_END
  9104. * Bits 23:18
  9105. * Purpose: Indicate the end of a series of MPDUs to release.
  9106. * Value:
  9107. * The sequence number one larger than the sequence number of the
  9108. * last MPDU to check to release.
  9109. * The sequence number is masked by 0x3f.
  9110. * All MPDUs within this series are present and valid - the host
  9111. * need not check each sequence number within this range to see if
  9112. * the corresponding MPDU is actually present.
  9113. * This field is only valid if the RV bit is set.
  9114. * - NUM_MPDU_RANGES
  9115. * Bits 31:24
  9116. * Purpose: Indicate how many ranges of MPDUs are present.
  9117. * Each MPDU range consists of a series of contiguous MPDUs within the
  9118. * rx frame sequence which all have the same MPDU status.
  9119. * Value: 1-63 (typically a small number, like 1-3)
  9120. *
  9121. * Rx PPDU descriptor fields:
  9122. * - RSSI_CMB
  9123. * Bits 7:0
  9124. * Purpose: Combined RSSI from all active rx chains, across the active
  9125. * bandwidth.
  9126. * Value: RSSI dB units w.r.t. noise floor
  9127. * - TIMESTAMP_SUBMICROSEC
  9128. * Bits 15:8
  9129. * Purpose: high-resolution timestamp
  9130. * Value:
  9131. * Sub-microsecond time of PPDU reception.
  9132. * This timestamp ranges from [0,MAC clock MHz).
  9133. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9134. * to form a high-resolution, large range rx timestamp.
  9135. * - PHY_ERR_CODE
  9136. * Bits 23:16
  9137. * Purpose:
  9138. * If the rx frame processing resulted in a PHY error, indicate what
  9139. * type of rx PHY error occurred.
  9140. * Value:
  9141. * This field is valid if the "P" (PHY_ERR) flag is set.
  9142. * TBD: document/specify the values for this field
  9143. * - PHY_ERR
  9144. * Bit 24
  9145. * Purpose: indicate whether the rx PPDU had a PHY error
  9146. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9147. * - LEGACY_RATE
  9148. * Bits 28:25
  9149. * Purpose:
  9150. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9151. * specify which rate was used.
  9152. * Value:
  9153. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9154. * flag.
  9155. * If LEGACY_RATE_SEL is 0:
  9156. * 0x8: OFDM 48 Mbps
  9157. * 0x9: OFDM 24 Mbps
  9158. * 0xA: OFDM 12 Mbps
  9159. * 0xB: OFDM 6 Mbps
  9160. * 0xC: OFDM 54 Mbps
  9161. * 0xD: OFDM 36 Mbps
  9162. * 0xE: OFDM 18 Mbps
  9163. * 0xF: OFDM 9 Mbps
  9164. * If LEGACY_RATE_SEL is 1:
  9165. * 0x8: CCK 11 Mbps long preamble
  9166. * 0x9: CCK 5.5 Mbps long preamble
  9167. * 0xA: CCK 2 Mbps long preamble
  9168. * 0xB: CCK 1 Mbps long preamble
  9169. * 0xC: CCK 11 Mbps short preamble
  9170. * 0xD: CCK 5.5 Mbps short preamble
  9171. * 0xE: CCK 2 Mbps short preamble
  9172. * - LEGACY_RATE_SEL
  9173. * Bit 29
  9174. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9175. * Value:
  9176. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9177. * used a legacy rate.
  9178. * 0 -> OFDM, 1 -> CCK
  9179. * - END_VALID
  9180. * Bit 30
  9181. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9182. * the start of the PPDU are valid. Specifically, the following
  9183. * fields are only valid if END_VALID is set:
  9184. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9185. * TIMESTAMP_SUBMICROSEC
  9186. * Value:
  9187. * 0 -> rx PPDU desc end fields are not valid
  9188. * 1 -> rx PPDU desc end fields are valid
  9189. * - START_VALID
  9190. * Bit 31
  9191. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9192. * the end of the PPDU are valid. Specifically, the following
  9193. * fields are only valid if START_VALID is set:
  9194. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9195. * VHT-SIG-A
  9196. * Value:
  9197. * 0 -> rx PPDU desc start fields are not valid
  9198. * 1 -> rx PPDU desc start fields are valid
  9199. * - RSSI0_PRI20
  9200. * Bits 7:0
  9201. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9202. * Value: RSSI dB units w.r.t. noise floor
  9203. *
  9204. * - RSSI0_EXT20
  9205. * Bits 7:0
  9206. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9207. * (if the rx bandwidth was >= 40 MHz)
  9208. * Value: RSSI dB units w.r.t. noise floor
  9209. * - RSSI0_EXT40
  9210. * Bits 7:0
  9211. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9212. * (if the rx bandwidth was >= 80 MHz)
  9213. * Value: RSSI dB units w.r.t. noise floor
  9214. * - RSSI0_EXT80
  9215. * Bits 7:0
  9216. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9217. * (if the rx bandwidth was >= 160 MHz)
  9218. * Value: RSSI dB units w.r.t. noise floor
  9219. *
  9220. * - RSSI1_PRI20
  9221. * Bits 7:0
  9222. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9223. * Value: RSSI dB units w.r.t. noise floor
  9224. * - RSSI1_EXT20
  9225. * Bits 7:0
  9226. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9227. * (if the rx bandwidth was >= 40 MHz)
  9228. * Value: RSSI dB units w.r.t. noise floor
  9229. * - RSSI1_EXT40
  9230. * Bits 7:0
  9231. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9232. * (if the rx bandwidth was >= 80 MHz)
  9233. * Value: RSSI dB units w.r.t. noise floor
  9234. * - RSSI1_EXT80
  9235. * Bits 7:0
  9236. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9237. * (if the rx bandwidth was >= 160 MHz)
  9238. * Value: RSSI dB units w.r.t. noise floor
  9239. *
  9240. * - RSSI2_PRI20
  9241. * Bits 7:0
  9242. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9243. * Value: RSSI dB units w.r.t. noise floor
  9244. * - RSSI2_EXT20
  9245. * Bits 7:0
  9246. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9247. * (if the rx bandwidth was >= 40 MHz)
  9248. * Value: RSSI dB units w.r.t. noise floor
  9249. * - RSSI2_EXT40
  9250. * Bits 7:0
  9251. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9252. * (if the rx bandwidth was >= 80 MHz)
  9253. * Value: RSSI dB units w.r.t. noise floor
  9254. * - RSSI2_EXT80
  9255. * Bits 7:0
  9256. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9257. * (if the rx bandwidth was >= 160 MHz)
  9258. * Value: RSSI dB units w.r.t. noise floor
  9259. *
  9260. * - RSSI3_PRI20
  9261. * Bits 7:0
  9262. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9263. * Value: RSSI dB units w.r.t. noise floor
  9264. * - RSSI3_EXT20
  9265. * Bits 7:0
  9266. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9267. * (if the rx bandwidth was >= 40 MHz)
  9268. * Value: RSSI dB units w.r.t. noise floor
  9269. * - RSSI3_EXT40
  9270. * Bits 7:0
  9271. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9272. * (if the rx bandwidth was >= 80 MHz)
  9273. * Value: RSSI dB units w.r.t. noise floor
  9274. * - RSSI3_EXT80
  9275. * Bits 7:0
  9276. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9277. * (if the rx bandwidth was >= 160 MHz)
  9278. * Value: RSSI dB units w.r.t. noise floor
  9279. *
  9280. * - TSF32
  9281. * Bits 31:0
  9282. * Purpose: specify the time the rx PPDU was received, in TSF units
  9283. * Value: 32 LSBs of the TSF
  9284. * - TIMESTAMP_MICROSEC
  9285. * Bits 31:0
  9286. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9287. * Value: PPDU rx time, in microseconds
  9288. * - VHT_SIG_A1
  9289. * Bits 23:0
  9290. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9291. * from the rx PPDU
  9292. * Value:
  9293. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9294. * VHT-SIG-A1 data.
  9295. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9296. * first 24 bits of the HT-SIG data.
  9297. * Otherwise, this field is invalid.
  9298. * Refer to the the 802.11 protocol for the definition of the
  9299. * HT-SIG and VHT-SIG-A1 fields
  9300. * - VHT_SIG_A2
  9301. * Bits 23:0
  9302. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9303. * from the rx PPDU
  9304. * Value:
  9305. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9306. * VHT-SIG-A2 data.
  9307. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9308. * last 24 bits of the HT-SIG data.
  9309. * Otherwise, this field is invalid.
  9310. * Refer to the the 802.11 protocol for the definition of the
  9311. * HT-SIG and VHT-SIG-A2 fields
  9312. * - PREAMBLE_TYPE
  9313. * Bits 31:24
  9314. * Purpose: indicate the PHY format of the received burst
  9315. * Value:
  9316. * 0x4: Legacy (OFDM/CCK)
  9317. * 0x8: HT
  9318. * 0x9: HT with TxBF
  9319. * 0xC: VHT
  9320. * 0xD: VHT with TxBF
  9321. * - SERVICE
  9322. * Bits 31:24
  9323. * Purpose: TBD
  9324. * Value: TBD
  9325. *
  9326. * Rx MSDU descriptor fields:
  9327. * - FW_RX_DESC_BYTES
  9328. * Bits 15:0
  9329. * Purpose: Indicate how many bytes in the Rx indication are used for
  9330. * FW Rx descriptors
  9331. *
  9332. * Payload fields:
  9333. * - MPDU_COUNT
  9334. * Bits 7:0
  9335. * Purpose: Indicate how many sequential MPDUs share the same status.
  9336. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9337. * - MPDU_STATUS
  9338. * Bits 15:8
  9339. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9340. * received successfully.
  9341. * Value:
  9342. * 0x1: success
  9343. * 0x2: FCS error
  9344. * 0x3: duplicate error
  9345. * 0x4: replay error
  9346. * 0x5: invalid peer
  9347. */
  9348. /* header fields */
  9349. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9350. #define HTT_RX_IND_EXT_TID_S 8
  9351. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9352. #define HTT_RX_IND_FLUSH_VALID_S 13
  9353. #define HTT_RX_IND_REL_VALID_M 0x4000
  9354. #define HTT_RX_IND_REL_VALID_S 14
  9355. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9356. #define HTT_RX_IND_PEER_ID_S 16
  9357. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9358. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9359. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9360. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9361. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9362. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9363. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9364. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9365. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9366. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9367. /* rx PPDU descriptor fields */
  9368. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9369. #define HTT_RX_IND_RSSI_CMB_S 0
  9370. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9371. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9372. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9373. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9374. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9375. #define HTT_RX_IND_PHY_ERR_S 24
  9376. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9377. #define HTT_RX_IND_LEGACY_RATE_S 25
  9378. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9379. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9380. #define HTT_RX_IND_END_VALID_M 0x40000000
  9381. #define HTT_RX_IND_END_VALID_S 30
  9382. #define HTT_RX_IND_START_VALID_M 0x80000000
  9383. #define HTT_RX_IND_START_VALID_S 31
  9384. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9385. #define HTT_RX_IND_RSSI_PRI20_S 0
  9386. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9387. #define HTT_RX_IND_RSSI_EXT20_S 8
  9388. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9389. #define HTT_RX_IND_RSSI_EXT40_S 16
  9390. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9391. #define HTT_RX_IND_RSSI_EXT80_S 24
  9392. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9393. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9394. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9395. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9396. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9397. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9398. #define HTT_RX_IND_SERVICE_M 0xff000000
  9399. #define HTT_RX_IND_SERVICE_S 24
  9400. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9401. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9402. /* rx MSDU descriptor fields */
  9403. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9404. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9405. /* payload fields */
  9406. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9407. #define HTT_RX_IND_MPDU_COUNT_S 0
  9408. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9409. #define HTT_RX_IND_MPDU_STATUS_S 8
  9410. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9411. do { \
  9412. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9413. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9414. } while (0)
  9415. #define HTT_RX_IND_EXT_TID_GET(word) \
  9416. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9417. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9418. do { \
  9419. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9420. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9421. } while (0)
  9422. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9423. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9424. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9425. do { \
  9426. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9427. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9428. } while (0)
  9429. #define HTT_RX_IND_REL_VALID_GET(word) \
  9430. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9431. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9432. do { \
  9433. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9434. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9435. } while (0)
  9436. #define HTT_RX_IND_PEER_ID_GET(word) \
  9437. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9438. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9439. do { \
  9440. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9441. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9442. } while (0)
  9443. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9444. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9445. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9446. do { \
  9447. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9448. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9449. } while (0)
  9450. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9451. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9452. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9453. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9454. do { \
  9455. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9456. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9457. } while (0)
  9458. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9459. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9460. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9461. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9462. do { \
  9463. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9464. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9465. } while (0)
  9466. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9467. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9468. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9469. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9470. do { \
  9471. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9472. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9473. } while (0)
  9474. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9475. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9476. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9477. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9478. do { \
  9479. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9480. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9481. } while (0)
  9482. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9483. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9484. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9485. /* FW rx PPDU descriptor fields */
  9486. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9487. do { \
  9488. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9489. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9490. } while (0)
  9491. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9492. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9493. HTT_RX_IND_RSSI_CMB_S)
  9494. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9495. do { \
  9496. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9497. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9498. } while (0)
  9499. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9500. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9501. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9502. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9503. do { \
  9504. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9505. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9506. } while (0)
  9507. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9508. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9509. HTT_RX_IND_PHY_ERR_CODE_S)
  9510. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9511. do { \
  9512. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9513. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9514. } while (0)
  9515. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9516. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9517. HTT_RX_IND_PHY_ERR_S)
  9518. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9519. do { \
  9520. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9521. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9522. } while (0)
  9523. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9524. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9525. HTT_RX_IND_LEGACY_RATE_S)
  9526. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9527. do { \
  9528. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9529. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9530. } while (0)
  9531. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9532. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9533. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9534. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9535. do { \
  9536. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9537. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9538. } while (0)
  9539. #define HTT_RX_IND_END_VALID_GET(word) \
  9540. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9541. HTT_RX_IND_END_VALID_S)
  9542. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9543. do { \
  9544. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9545. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9546. } while (0)
  9547. #define HTT_RX_IND_START_VALID_GET(word) \
  9548. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9549. HTT_RX_IND_START_VALID_S)
  9550. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9551. do { \
  9552. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9553. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9554. } while (0)
  9555. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9556. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9557. HTT_RX_IND_RSSI_PRI20_S)
  9558. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9559. do { \
  9560. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9561. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9562. } while (0)
  9563. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9564. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9565. HTT_RX_IND_RSSI_EXT20_S)
  9566. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9567. do { \
  9568. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9569. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9570. } while (0)
  9571. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9572. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9573. HTT_RX_IND_RSSI_EXT40_S)
  9574. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9575. do { \
  9576. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9577. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9578. } while (0)
  9579. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9580. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9581. HTT_RX_IND_RSSI_EXT80_S)
  9582. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9583. do { \
  9584. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  9585. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  9586. } while (0)
  9587. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  9588. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  9589. HTT_RX_IND_VHT_SIG_A1_S)
  9590. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  9591. do { \
  9592. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  9593. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  9594. } while (0)
  9595. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  9596. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  9597. HTT_RX_IND_VHT_SIG_A2_S)
  9598. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  9599. do { \
  9600. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  9601. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  9602. } while (0)
  9603. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  9604. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  9605. HTT_RX_IND_PREAMBLE_TYPE_S)
  9606. #define HTT_RX_IND_SERVICE_SET(word, value) \
  9607. do { \
  9608. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  9609. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  9610. } while (0)
  9611. #define HTT_RX_IND_SERVICE_GET(word) \
  9612. (((word) & HTT_RX_IND_SERVICE_M) >> \
  9613. HTT_RX_IND_SERVICE_S)
  9614. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  9615. do { \
  9616. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  9617. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  9618. } while (0)
  9619. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  9620. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  9621. HTT_RX_IND_SA_ANT_MATRIX_S)
  9622. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  9623. do { \
  9624. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  9625. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  9626. } while (0)
  9627. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  9628. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  9629. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  9630. do { \
  9631. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  9632. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  9633. } while (0)
  9634. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  9635. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  9636. #define HTT_RX_IND_HL_BYTES \
  9637. (HTT_RX_IND_HDR_BYTES + \
  9638. 4 /* single FW rx MSDU descriptor */ + \
  9639. 4 /* single MPDU range information element */)
  9640. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  9641. /* Could we use one macro entry? */
  9642. #define HTT_WORD_SET(word, field, value) \
  9643. do { \
  9644. HTT_CHECK_SET_VAL(field, value); \
  9645. (word) |= ((value) << field ## _S); \
  9646. } while (0)
  9647. #define HTT_WORD_GET(word, field) \
  9648. (((word) & field ## _M) >> field ## _S)
  9649. PREPACK struct hl_htt_rx_ind_base {
  9650. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  9651. } POSTPACK;
  9652. /*
  9653. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  9654. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  9655. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  9656. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  9657. * htt_rx_ind_hl_rx_desc_t.
  9658. */
  9659. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  9660. struct htt_rx_ind_hl_rx_desc_t {
  9661. A_UINT8 ver;
  9662. A_UINT8 len;
  9663. struct {
  9664. A_UINT8
  9665. first_msdu: 1,
  9666. last_msdu: 1,
  9667. c3_failed: 1,
  9668. c4_failed: 1,
  9669. ipv6: 1,
  9670. tcp: 1,
  9671. udp: 1,
  9672. reserved: 1;
  9673. } flags;
  9674. /* NOTE: no reserved space - don't append any new fields here */
  9675. };
  9676. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  9677. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9678. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  9679. #define HTT_RX_IND_HL_RX_DESC_VER 0
  9680. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  9681. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9682. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  9683. #define HTT_RX_IND_HL_FLAG_OFFSET \
  9684. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9685. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  9686. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  9687. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  9688. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  9689. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  9690. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  9691. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  9692. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  9693. /* This structure is used in HL, the basic descriptor information
  9694. * used by host. the structure is translated by FW from HW desc
  9695. * or generated by FW. But in HL monitor mode, the host would use
  9696. * the same structure with LL.
  9697. */
  9698. PREPACK struct hl_htt_rx_desc_base {
  9699. A_UINT32
  9700. seq_num:12,
  9701. encrypted:1,
  9702. chan_info_present:1,
  9703. resv0:2,
  9704. mcast_bcast:1,
  9705. fragment:1,
  9706. key_id_oct:8,
  9707. resv1:6;
  9708. A_UINT32
  9709. pn_31_0;
  9710. union {
  9711. struct {
  9712. A_UINT16 pn_47_32;
  9713. A_UINT16 pn_63_48;
  9714. } pn16;
  9715. A_UINT32 pn_63_32;
  9716. } u0;
  9717. A_UINT32
  9718. pn_95_64;
  9719. A_UINT32
  9720. pn_127_96;
  9721. } POSTPACK;
  9722. /*
  9723. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  9724. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  9725. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  9726. * Please see htt_chan_change_t for description of the fields.
  9727. */
  9728. PREPACK struct htt_chan_info_t
  9729. {
  9730. A_UINT32 primary_chan_center_freq_mhz: 16,
  9731. contig_chan1_center_freq_mhz: 16;
  9732. A_UINT32 contig_chan2_center_freq_mhz: 16,
  9733. phy_mode: 8,
  9734. reserved: 8;
  9735. } POSTPACK;
  9736. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  9737. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  9738. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  9739. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  9740. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  9741. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  9742. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  9743. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  9744. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  9745. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  9746. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  9747. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  9748. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  9749. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  9750. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  9751. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  9752. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  9753. /* Channel information */
  9754. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  9755. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  9756. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  9757. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  9758. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  9759. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  9760. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  9761. #define HTT_CHAN_INFO_PHY_MODE_S 16
  9762. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  9763. do { \
  9764. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  9765. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  9766. } while (0)
  9767. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  9768. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  9769. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  9770. do { \
  9771. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  9772. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  9773. } while (0)
  9774. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  9775. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  9776. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  9777. do { \
  9778. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  9779. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  9780. } while (0)
  9781. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  9782. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  9783. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  9784. do { \
  9785. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  9786. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  9787. } while (0)
  9788. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  9789. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  9790. /*
  9791. * @brief target -> host message definition for FW offloaded pkts
  9792. *
  9793. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  9794. *
  9795. * @details
  9796. * The following field definitions describe the format of the firmware
  9797. * offload deliver message sent from the target to the host.
  9798. *
  9799. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  9800. *
  9801. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  9802. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  9803. * | reserved_1 | msg type |
  9804. * |--------------------------------------------------------------------------|
  9805. * | phy_timestamp_l32 |
  9806. * |--------------------------------------------------------------------------|
  9807. * | WORD2 (see below) |
  9808. * |--------------------------------------------------------------------------|
  9809. * | seqno | framectrl |
  9810. * |--------------------------------------------------------------------------|
  9811. * | reserved_3 | vdev_id | tid_num|
  9812. * |--------------------------------------------------------------------------|
  9813. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  9814. * |--------------------------------------------------------------------------|
  9815. *
  9816. * where:
  9817. * STAT = status
  9818. * F = format (802.3 vs. 802.11)
  9819. *
  9820. * definition for word 2
  9821. *
  9822. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  9823. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  9824. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  9825. * |--------------------------------------------------------------------------|
  9826. *
  9827. * where:
  9828. * PR = preamble
  9829. * BF = beamformed
  9830. */
  9831. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  9832. {
  9833. A_UINT32 /* word 0 */
  9834. msg_type:8, /* [ 7: 0] */
  9835. reserved_1:24; /* [31: 8] */
  9836. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  9837. A_UINT32 /* word 2 */
  9838. /* preamble:
  9839. * 0-OFDM,
  9840. * 1-CCk,
  9841. * 2-HT,
  9842. * 3-VHT
  9843. */
  9844. preamble: 2, /* [1:0] */
  9845. /* mcs:
  9846. * In case of HT preamble interpret
  9847. * MCS along with NSS.
  9848. * Valid values for HT are 0 to 7.
  9849. * HT mcs 0 with NSS 2 is mcs 8.
  9850. * Valid values for VHT are 0 to 9.
  9851. */
  9852. mcs: 4, /* [5:2] */
  9853. /* rate:
  9854. * This is applicable only for
  9855. * CCK and OFDM preamble type
  9856. * rate 0: OFDM 48 Mbps,
  9857. * 1: OFDM 24 Mbps,
  9858. * 2: OFDM 12 Mbps
  9859. * 3: OFDM 6 Mbps
  9860. * 4: OFDM 54 Mbps
  9861. * 5: OFDM 36 Mbps
  9862. * 6: OFDM 18 Mbps
  9863. * 7: OFDM 9 Mbps
  9864. * rate 0: CCK 11 Mbps Long
  9865. * 1: CCK 5.5 Mbps Long
  9866. * 2: CCK 2 Mbps Long
  9867. * 3: CCK 1 Mbps Long
  9868. * 4: CCK 11 Mbps Short
  9869. * 5: CCK 5.5 Mbps Short
  9870. * 6: CCK 2 Mbps Short
  9871. */
  9872. rate : 3, /* [ 8: 6] */
  9873. rssi : 8, /* [16: 9] units=dBm */
  9874. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9875. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9876. stbc : 1, /* [22] */
  9877. sgi : 1, /* [23] */
  9878. ldpc : 1, /* [24] */
  9879. beamformed: 1, /* [25] */
  9880. reserved_2: 6; /* [31:26] */
  9881. A_UINT32 /* word 3 */
  9882. framectrl:16, /* [15: 0] */
  9883. seqno:16; /* [31:16] */
  9884. A_UINT32 /* word 4 */
  9885. tid_num:5, /* [ 4: 0] actual TID number */
  9886. vdev_id:8, /* [12: 5] */
  9887. reserved_3:19; /* [31:13] */
  9888. A_UINT32 /* word 5 */
  9889. /* status:
  9890. * 0: tx_ok
  9891. * 1: retry
  9892. * 2: drop
  9893. * 3: filtered
  9894. * 4: abort
  9895. * 5: tid delete
  9896. * 6: sw abort
  9897. * 7: dropped by peer migration
  9898. */
  9899. status:3, /* [2:0] */
  9900. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  9901. tx_mpdu_bytes:16, /* [19:4] */
  9902. /* Indicates retry count of offloaded/local generated Data tx frames */
  9903. tx_retry_cnt:6, /* [25:20] */
  9904. reserved_4:6; /* [31:26] */
  9905. } POSTPACK;
  9906. /* FW offload deliver ind message header fields */
  9907. /* DWORD one */
  9908. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  9909. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  9910. /* DWORD two */
  9911. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  9912. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  9913. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  9914. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  9915. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  9916. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  9917. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  9918. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  9919. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  9920. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  9921. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  9922. #define HTT_FW_OFFLOAD_IND_BW_S 19
  9923. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  9924. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  9925. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  9926. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  9927. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  9928. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  9929. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  9930. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  9931. /* DWORD three*/
  9932. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  9933. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  9934. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  9935. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  9936. /* DWORD four */
  9937. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  9938. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  9939. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  9940. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  9941. /* DWORD five */
  9942. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  9943. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  9944. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  9945. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  9946. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  9947. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  9948. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  9949. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  9950. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  9951. do { \
  9952. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  9953. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  9954. } while (0)
  9955. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  9956. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  9957. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  9958. do { \
  9959. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  9960. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  9961. } while (0)
  9962. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  9963. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  9964. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  9965. do { \
  9966. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  9967. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  9968. } while (0)
  9969. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  9970. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  9971. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  9972. do { \
  9973. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  9974. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  9975. } while (0)
  9976. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  9977. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  9978. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  9979. do { \
  9980. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  9981. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  9982. } while (0)
  9983. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  9984. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  9985. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  9986. do { \
  9987. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  9988. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  9989. } while (0)
  9990. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  9991. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  9992. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  9993. do { \
  9994. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  9995. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  9996. } while (0)
  9997. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  9998. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  9999. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10000. do { \
  10001. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10002. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10003. } while (0)
  10004. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10005. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10006. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10007. do { \
  10008. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10009. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10010. } while (0)
  10011. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10012. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10013. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10014. do { \
  10015. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10016. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10017. } while (0)
  10018. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10019. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10020. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10021. do { \
  10022. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10023. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10024. } while (0)
  10025. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10026. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10027. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10028. do { \
  10029. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10030. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10031. } while (0)
  10032. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10033. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10034. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10035. do { \
  10036. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10037. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10038. } while (0)
  10039. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10040. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10041. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10042. do { \
  10043. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10044. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10045. } while (0)
  10046. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10047. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10048. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10049. do { \
  10050. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10051. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10052. } while (0)
  10053. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10054. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10055. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10056. do { \
  10057. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10058. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10059. } while (0)
  10060. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10061. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10062. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10063. do { \
  10064. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10065. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10066. } while (0)
  10067. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10068. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10069. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10070. do { \
  10071. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10072. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10073. } while (0)
  10074. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10075. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10076. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10077. do { \
  10078. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10079. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10080. } while (0)
  10081. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10082. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10083. /*
  10084. * @brief target -> host rx reorder flush message definition
  10085. *
  10086. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10087. *
  10088. * @details
  10089. * The following field definitions describe the format of the rx flush
  10090. * message sent from the target to the host.
  10091. * The message consists of a 4-octet header, followed by one or more
  10092. * 4-octet payload information elements.
  10093. *
  10094. * |31 24|23 8|7 0|
  10095. * |--------------------------------------------------------------|
  10096. * | TID | peer ID | msg type |
  10097. * |--------------------------------------------------------------|
  10098. * | seq num end | seq num start | MPDU status | reserved |
  10099. * |--------------------------------------------------------------|
  10100. * First DWORD:
  10101. * - MSG_TYPE
  10102. * Bits 7:0
  10103. * Purpose: identifies this as an rx flush message
  10104. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10105. * - PEER_ID
  10106. * Bits 23:8 (only bits 18:8 actually used)
  10107. * Purpose: identify which peer's rx data is being flushed
  10108. * Value: (rx) peer ID
  10109. * - TID
  10110. * Bits 31:24 (only bits 27:24 actually used)
  10111. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10112. * Value: traffic identifier
  10113. * Second DWORD:
  10114. * - MPDU_STATUS
  10115. * Bits 15:8
  10116. * Purpose:
  10117. * Indicate whether the flushed MPDUs should be discarded or processed.
  10118. * Value:
  10119. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10120. * stages of rx processing
  10121. * other: discard the MPDUs
  10122. * It is anticipated that flush messages will always have
  10123. * MPDU status == 1, but the status flag is included for
  10124. * flexibility.
  10125. * - SEQ_NUM_START
  10126. * Bits 23:16
  10127. * Purpose:
  10128. * Indicate the start of a series of consecutive MPDUs being flushed.
  10129. * Not all MPDUs within this range are necessarily valid - the host
  10130. * must check each sequence number within this range to see if the
  10131. * corresponding MPDU is actually present.
  10132. * Value:
  10133. * The sequence number for the first MPDU in the sequence.
  10134. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10135. * - SEQ_NUM_END
  10136. * Bits 30:24
  10137. * Purpose:
  10138. * Indicate the end of a series of consecutive MPDUs being flushed.
  10139. * Value:
  10140. * The sequence number one larger than the sequence number of the
  10141. * last MPDU being flushed.
  10142. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10143. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10144. * are to be released for further rx processing.
  10145. * Not all MPDUs within this range are necessarily valid - the host
  10146. * must check each sequence number within this range to see if the
  10147. * corresponding MPDU is actually present.
  10148. */
  10149. /* first DWORD */
  10150. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10151. #define HTT_RX_FLUSH_PEER_ID_S 8
  10152. #define HTT_RX_FLUSH_TID_M 0xff000000
  10153. #define HTT_RX_FLUSH_TID_S 24
  10154. /* second DWORD */
  10155. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10156. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10157. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10158. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10159. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10160. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10161. #define HTT_RX_FLUSH_BYTES 8
  10162. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10163. do { \
  10164. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10165. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10166. } while (0)
  10167. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10168. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10169. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10170. do { \
  10171. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10172. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10173. } while (0)
  10174. #define HTT_RX_FLUSH_TID_GET(word) \
  10175. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10176. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10177. do { \
  10178. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10179. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10180. } while (0)
  10181. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10182. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10183. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10184. do { \
  10185. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10186. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10187. } while (0)
  10188. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10189. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10190. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10191. do { \
  10192. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10193. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10194. } while (0)
  10195. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10196. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10197. /*
  10198. * @brief target -> host rx pn check indication message
  10199. *
  10200. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10201. *
  10202. * @details
  10203. * The following field definitions describe the format of the Rx PN check
  10204. * indication message sent from the target to the host.
  10205. * The message consists of a 4-octet header, followed by the start and
  10206. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10207. * IE is one octet containing the sequence number that failed the PN
  10208. * check.
  10209. *
  10210. * |31 24|23 8|7 0|
  10211. * |--------------------------------------------------------------|
  10212. * | TID | peer ID | msg type |
  10213. * |--------------------------------------------------------------|
  10214. * | Reserved | PN IE count | seq num end | seq num start|
  10215. * |--------------------------------------------------------------|
  10216. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10217. * |--------------------------------------------------------------|
  10218. * First DWORD:
  10219. * - MSG_TYPE
  10220. * Bits 7:0
  10221. * Purpose: Identifies this as an rx pn check indication message
  10222. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10223. * - PEER_ID
  10224. * Bits 23:8 (only bits 18:8 actually used)
  10225. * Purpose: identify which peer
  10226. * Value: (rx) peer ID
  10227. * - TID
  10228. * Bits 31:24 (only bits 27:24 actually used)
  10229. * Purpose: identify traffic identifier
  10230. * Value: traffic identifier
  10231. * Second DWORD:
  10232. * - SEQ_NUM_START
  10233. * Bits 7:0
  10234. * Purpose:
  10235. * Indicates the starting sequence number of the MPDU in this
  10236. * series of MPDUs that went though PN check.
  10237. * Value:
  10238. * The sequence number for the first MPDU in the sequence.
  10239. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10240. * - SEQ_NUM_END
  10241. * Bits 15:8
  10242. * Purpose:
  10243. * Indicates the ending sequence number of the MPDU in this
  10244. * series of MPDUs that went though PN check.
  10245. * Value:
  10246. * The sequence number one larger then the sequence number of the last
  10247. * MPDU being flushed.
  10248. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10249. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10250. * for invalid PN numbers and are ready to be released for further processing.
  10251. * Not all MPDUs within this range are necessarily valid - the host
  10252. * must check each sequence number within this range to see if the
  10253. * corresponding MPDU is actually present.
  10254. * - PN_IE_COUNT
  10255. * Bits 23:16
  10256. * Purpose:
  10257. * Used to determine the variable number of PN information elements in this
  10258. * message
  10259. *
  10260. * PN information elements:
  10261. * - PN_IE_x-
  10262. * Purpose:
  10263. * Each PN information element contains the sequence number of the MPDU that
  10264. * has failed the target PN check.
  10265. * Value:
  10266. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10267. * that failed the PN check.
  10268. */
  10269. /* first DWORD */
  10270. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10271. #define HTT_RX_PN_IND_PEER_ID_S 8
  10272. #define HTT_RX_PN_IND_TID_M 0xff000000
  10273. #define HTT_RX_PN_IND_TID_S 24
  10274. /* second DWORD */
  10275. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10276. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10277. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10278. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10279. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10280. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10281. #define HTT_RX_PN_IND_BYTES 8
  10282. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10283. do { \
  10284. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10285. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10286. } while (0)
  10287. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10288. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10289. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10290. do { \
  10291. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10292. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10293. } while (0)
  10294. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10295. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10296. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10297. do { \
  10298. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10299. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10300. } while (0)
  10301. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10302. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10303. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10304. do { \
  10305. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10306. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10307. } while (0)
  10308. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10309. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10310. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10311. do { \
  10312. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10313. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10314. } while (0)
  10315. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10316. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10317. /*
  10318. * @brief target -> host rx offload deliver message for LL system
  10319. *
  10320. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10321. *
  10322. * @details
  10323. * In a low latency system this message is sent whenever the offload
  10324. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10325. * The DMA of the actual packets into host memory is done before sending out
  10326. * this message. This message indicates only how many MSDUs to reap. The
  10327. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10328. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10329. * DMA'd by the MAC directly into host memory these packets do not contain
  10330. * the MAC descriptors in the header portion of the packet. Instead they contain
  10331. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10332. * message, the packets are delivered directly to the NW stack without going
  10333. * through the regular reorder buffering and PN checking path since it has
  10334. * already been done in target.
  10335. *
  10336. * |31 24|23 16|15 8|7 0|
  10337. * |-----------------------------------------------------------------------|
  10338. * | Total MSDU count | reserved | msg type |
  10339. * |-----------------------------------------------------------------------|
  10340. *
  10341. * @brief target -> host rx offload deliver message for HL system
  10342. *
  10343. * @details
  10344. * In a high latency system this message is sent whenever the offload manager
  10345. * flushes out the packets it has coalesced in its coalescing buffer. The
  10346. * actual packets are also carried along with this message. When the host
  10347. * receives this message, it is expected to deliver these packets to the NW
  10348. * stack directly instead of routing them through the reorder buffering and
  10349. * PN checking path since it has already been done in target.
  10350. *
  10351. * |31 24|23 16|15 8|7 0|
  10352. * |-----------------------------------------------------------------------|
  10353. * | Total MSDU count | reserved | msg type |
  10354. * |-----------------------------------------------------------------------|
  10355. * | peer ID | MSDU length |
  10356. * |-----------------------------------------------------------------------|
  10357. * | MSDU payload | FW Desc | tid | vdev ID |
  10358. * |-----------------------------------------------------------------------|
  10359. * | MSDU payload contd. |
  10360. * |-----------------------------------------------------------------------|
  10361. * | peer ID | MSDU length |
  10362. * |-----------------------------------------------------------------------|
  10363. * | MSDU payload | FW Desc | tid | vdev ID |
  10364. * |-----------------------------------------------------------------------|
  10365. * | MSDU payload contd. |
  10366. * |-----------------------------------------------------------------------|
  10367. *
  10368. */
  10369. /* first DWORD */
  10370. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10371. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10372. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10373. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10374. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10375. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10376. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10377. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10378. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10379. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10380. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10381. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10382. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10383. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10384. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10385. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10386. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10387. do { \
  10388. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10389. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10390. } while (0)
  10391. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10392. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10393. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10394. do { \
  10395. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10396. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10397. } while (0)
  10398. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10399. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10400. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10401. do { \
  10402. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10403. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10404. } while (0)
  10405. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10406. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10407. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10408. do { \
  10409. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10410. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10411. } while (0)
  10412. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10413. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10414. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10415. do { \
  10416. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10417. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10418. } while (0)
  10419. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10420. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10421. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10422. do { \
  10423. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10424. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10425. } while (0)
  10426. /**
  10427. * @brief target -> host rx peer map/unmap message definition
  10428. *
  10429. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10430. *
  10431. * @details
  10432. * The following diagram shows the format of the rx peer map message sent
  10433. * from the target to the host. This layout assumes the target operates
  10434. * as little-endian.
  10435. *
  10436. * This message always contains a SW peer ID. The main purpose of the
  10437. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10438. * with, so that the host can use that peer ID to determine which peer
  10439. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10440. * other purposes, such as identifying during tx completions which peer
  10441. * the tx frames in question were transmitted to.
  10442. *
  10443. * In certain generations of chips, the peer map message also contains
  10444. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10445. * to identify which peer the frame needs to be forwarded to (i.e. the
  10446. * peer assocated with the Destination MAC Address within the packet),
  10447. * and particularly which vdev needs to transmit the frame (for cases
  10448. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10449. * meaning as AST_INDEX_0.
  10450. * This DA-based peer ID that is provided for certain rx frames
  10451. * (the rx frames that need to be re-transmitted as tx frames)
  10452. * is the ID that the HW uses for referring to the peer in question,
  10453. * rather than the peer ID that the SW+FW use to refer to the peer.
  10454. *
  10455. *
  10456. * |31 24|23 16|15 8|7 0|
  10457. * |-----------------------------------------------------------------------|
  10458. * | SW peer ID | VDEV ID | msg type |
  10459. * |-----------------------------------------------------------------------|
  10460. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10461. * |-----------------------------------------------------------------------|
  10462. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10463. * |-----------------------------------------------------------------------|
  10464. *
  10465. *
  10466. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10467. *
  10468. * The following diagram shows the format of the rx peer unmap message sent
  10469. * from the target to the host.
  10470. *
  10471. * |31 24|23 16|15 8|7 0|
  10472. * |-----------------------------------------------------------------------|
  10473. * | SW peer ID | VDEV ID | msg type |
  10474. * |-----------------------------------------------------------------------|
  10475. *
  10476. * The following field definitions describe the format of the rx peer map
  10477. * and peer unmap messages sent from the target to the host.
  10478. * - MSG_TYPE
  10479. * Bits 7:0
  10480. * Purpose: identifies this as an rx peer map or peer unmap message
  10481. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10482. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10483. * - VDEV_ID
  10484. * Bits 15:8
  10485. * Purpose: Indicates which virtual device the peer is associated
  10486. * with.
  10487. * Value: vdev ID (used in the host to look up the vdev object)
  10488. * - PEER_ID (a.k.a. SW_PEER_ID)
  10489. * Bits 31:16
  10490. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10491. * freeing (unmap)
  10492. * Value: (rx) peer ID
  10493. * - MAC_ADDR_L32 (peer map only)
  10494. * Bits 31:0
  10495. * Purpose: Identifies which peer node the peer ID is for.
  10496. * Value: lower 4 bytes of peer node's MAC address
  10497. * - MAC_ADDR_U16 (peer map only)
  10498. * Bits 15:0
  10499. * Purpose: Identifies which peer node the peer ID is for.
  10500. * Value: upper 2 bytes of peer node's MAC address
  10501. * - HW_PEER_ID
  10502. * Bits 31:16
  10503. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10504. * address, so for rx frames marked for rx --> tx forwarding, the
  10505. * host can determine from the HW peer ID provided as meta-data with
  10506. * the rx frame which peer the frame is supposed to be forwarded to.
  10507. * Value: ID used by the MAC HW to identify the peer
  10508. */
  10509. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10510. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10511. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10512. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10513. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10514. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10515. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10516. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10517. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10518. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10519. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10520. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10521. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10522. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10523. do { \
  10524. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10525. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10526. } while (0)
  10527. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10528. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10529. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10530. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10531. do { \
  10532. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10533. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10534. } while (0)
  10535. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10536. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10537. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10538. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10539. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10540. do { \
  10541. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10542. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10543. } while (0)
  10544. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10545. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10546. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10547. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10548. #define HTT_RX_PEER_MAP_BYTES 12
  10549. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10550. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10551. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10552. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10553. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10554. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10555. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10556. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10557. #define HTT_RX_PEER_UNMAP_BYTES 4
  10558. /**
  10559. * @brief target -> host rx peer map V2 message definition
  10560. *
  10561. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10562. *
  10563. * @details
  10564. * The following diagram shows the format of the rx peer map v2 message sent
  10565. * from the target to the host. This layout assumes the target operates
  10566. * as little-endian.
  10567. *
  10568. * This message always contains a SW peer ID. The main purpose of the
  10569. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10570. * with, so that the host can use that peer ID to determine which peer
  10571. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10572. * other purposes, such as identifying during tx completions which peer
  10573. * the tx frames in question were transmitted to.
  10574. *
  10575. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10576. * is used during rx --> tx frame forwarding to identify which peer the
  10577. * frame needs to be forwarded to (i.e. the peer assocated with the
  10578. * Destination MAC Address within the packet), and particularly which vdev
  10579. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10580. * This DA-based peer ID that is provided for certain rx frames
  10581. * (the rx frames that need to be re-transmitted as tx frames)
  10582. * is the ID that the HW uses for referring to the peer in question,
  10583. * rather than the peer ID that the SW+FW use to refer to the peer.
  10584. *
  10585. * The HW peer id here is the same meaning as AST_INDEX_0.
  10586. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  10587. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  10588. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  10589. * AST is valid.
  10590. *
  10591. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  10592. * |-------------------------------------------------------------------------|
  10593. * | SW peer ID | VDEV ID | msg type |
  10594. * |-------------------------------------------------------------------------|
  10595. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10596. * |-------------------------------------------------------------------------|
  10597. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10598. * |-------------------------------------------------------------------------|
  10599. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  10600. * |-------------------------------------------------------------------------|
  10601. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  10602. * |-------------------------------------------------------------------------|
  10603. * |TID valid low pri| TID valid hi pri | AST index 2 |
  10604. * |-------------------------------------------------------------------------|
  10605. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  10606. * |-------------------------------------------------------------------------|
  10607. * | Reserved_2 |
  10608. * |-------------------------------------------------------------------------|
  10609. * Where:
  10610. * NH = Next Hop
  10611. * ASTVM = AST valid mask
  10612. * OA = on-chip AST valid bit
  10613. * ASTFM = AST flow mask
  10614. *
  10615. * The following field definitions describe the format of the rx peer map v2
  10616. * messages sent from the target to the host.
  10617. * - MSG_TYPE
  10618. * Bits 7:0
  10619. * Purpose: identifies this as an rx peer map v2 message
  10620. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  10621. * - VDEV_ID
  10622. * Bits 15:8
  10623. * Purpose: Indicates which virtual device the peer is associated with.
  10624. * Value: vdev ID (used in the host to look up the vdev object)
  10625. * - SW_PEER_ID
  10626. * Bits 31:16
  10627. * Purpose: The peer ID (index) that WAL is allocating
  10628. * Value: (rx) peer ID
  10629. * - MAC_ADDR_L32
  10630. * Bits 31:0
  10631. * Purpose: Identifies which peer node the peer ID is for.
  10632. * Value: lower 4 bytes of peer node's MAC address
  10633. * - MAC_ADDR_U16
  10634. * Bits 15:0
  10635. * Purpose: Identifies which peer node the peer ID is for.
  10636. * Value: upper 2 bytes of peer node's MAC address
  10637. * - HW_PEER_ID / AST_INDEX_0
  10638. * Bits 31:16
  10639. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10640. * address, so for rx frames marked for rx --> tx forwarding, the
  10641. * host can determine from the HW peer ID provided as meta-data with
  10642. * the rx frame which peer the frame is supposed to be forwarded to.
  10643. * Value: ID used by the MAC HW to identify the peer
  10644. * - AST_HASH_VALUE
  10645. * Bits 15:0
  10646. * Purpose: Indicates AST Hash value is required for the TCL AST index
  10647. * override feature.
  10648. * - NEXT_HOP
  10649. * Bit 16
  10650. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  10651. * (Wireless Distribution System).
  10652. * - AST_VALID_MASK
  10653. * Bits 19:17
  10654. * Purpose: Indicate if the AST 1 through AST 3 are valid
  10655. * - ONCHIP_AST_VALID_FLAG
  10656. * Bit 20
  10657. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  10658. * is valid.
  10659. * - AST_INDEX_1
  10660. * Bits 15:0
  10661. * Purpose: indicate the second AST index for this peer
  10662. * - AST_0_FLOW_MASK
  10663. * Bits 19:16
  10664. * Purpose: identify the which flow the AST 0 entry corresponds to.
  10665. * - AST_1_FLOW_MASK
  10666. * Bits 23:20
  10667. * Purpose: identify the which flow the AST 1 entry corresponds to.
  10668. * - AST_2_FLOW_MASK
  10669. * Bits 27:24
  10670. * Purpose: identify the which flow the AST 2 entry corresponds to.
  10671. * - AST_3_FLOW_MASK
  10672. * Bits 31:28
  10673. * Purpose: identify the which flow the AST 3 entry corresponds to.
  10674. * - AST_INDEX_2
  10675. * Bits 15:0
  10676. * Purpose: indicate the third AST index for this peer
  10677. * - TID_VALID_HI_PRI
  10678. * Bits 23:16
  10679. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  10680. * - TID_VALID_LOW_PRI
  10681. * Bits 31:24
  10682. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  10683. * - AST_INDEX_3
  10684. * Bits 15:0
  10685. * Purpose: indicate the fourth AST index for this peer
  10686. * - ONCHIP_AST_IDX / RESERVED
  10687. * Bits 31:16
  10688. * Purpose: This field is valid only when split AST feature is enabled.
  10689. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  10690. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10691. * address, this ast_idx is used for LMAC modules for RXPCU.
  10692. * Value: ID used by the LMAC HW to identify the peer
  10693. */
  10694. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  10695. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  10696. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  10697. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  10698. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  10699. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  10700. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  10701. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  10702. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  10703. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  10704. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  10705. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  10706. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  10707. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  10708. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  10709. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  10710. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  10711. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  10712. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  10713. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  10714. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  10715. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  10716. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  10717. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  10718. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  10719. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  10720. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  10721. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  10722. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  10723. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  10724. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  10725. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  10726. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  10727. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  10728. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  10729. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  10730. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  10731. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  10732. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  10733. do { \
  10734. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  10735. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  10736. } while (0)
  10737. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  10738. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  10739. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  10740. do { \
  10741. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  10742. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  10743. } while (0)
  10744. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  10745. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  10746. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  10747. do { \
  10748. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  10749. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  10750. } while (0)
  10751. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  10752. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  10753. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  10754. do { \
  10755. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  10756. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  10757. } while (0)
  10758. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  10759. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  10760. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  10761. do { \
  10762. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  10763. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  10764. } while (0)
  10765. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  10766. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  10767. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  10768. do { \
  10769. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  10770. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  10771. } while (0)
  10772. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  10773. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  10774. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  10775. do { \
  10776. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  10777. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  10778. } while (0)
  10779. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  10780. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  10781. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10782. do { \
  10783. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  10784. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  10785. } while (0)
  10786. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  10787. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  10788. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  10789. do { \
  10790. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  10791. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  10792. } while (0)
  10793. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  10794. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  10795. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  10796. do { \
  10797. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  10798. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  10799. } while (0)
  10800. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  10801. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  10802. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  10803. do { \
  10804. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  10805. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  10806. } while (0)
  10807. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  10808. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  10809. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  10810. do { \
  10811. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  10812. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  10813. } while (0)
  10814. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  10815. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  10816. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  10817. do { \
  10818. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  10819. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  10820. } while (0)
  10821. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  10822. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  10823. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  10824. do { \
  10825. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  10826. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  10827. } while (0)
  10828. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  10829. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  10830. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  10831. do { \
  10832. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  10833. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  10834. } while (0)
  10835. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  10836. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  10837. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  10838. do { \
  10839. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  10840. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  10841. } while (0)
  10842. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  10843. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  10844. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  10845. do { \
  10846. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  10847. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  10848. } while (0)
  10849. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  10850. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  10851. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10852. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  10853. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  10854. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  10855. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  10856. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  10857. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  10858. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  10859. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  10860. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  10861. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  10862. #define HTT_RX_PEER_MAP_V2_BYTES 32
  10863. /**
  10864. * @brief target -> host rx peer map V3 message definition
  10865. *
  10866. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  10867. *
  10868. * @details
  10869. * The following diagram shows the format of the rx peer map v3 message sent
  10870. * from the target to the host.
  10871. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  10872. * This layout assumes the target operates as little-endian.
  10873. *
  10874. * |31 24|23 20|19|18|17|16|15 8|7 0|
  10875. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  10876. * | SW peer ID | VDEV ID | msg type |
  10877. * |-----------------+--------------------+-----------------+-----------------|
  10878. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10879. * |-----------------+--------------------+-----------------+-----------------|
  10880. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  10881. * |-----------------+--------+-----------+-----------------+-----------------|
  10882. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  10883. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  10884. * | (8bits) | | (4bits) | |
  10885. * |-----------------+--------+--+--+--+--------------------------------------|
  10886. * | RESERVED |E |O | | |
  10887. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  10888. * | |V |V | | |
  10889. * |-----------------+--------------------+-----------------------------------|
  10890. * | HTT_MSDU_IDX_ | RESERVED | |
  10891. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  10892. * | (8bits) | | |
  10893. * |-----------------+--------------------+-----------------------------------|
  10894. * | Reserved_2 |
  10895. * |--------------------------------------------------------------------------|
  10896. * | Reserved_3 |
  10897. * |--------------------------------------------------------------------------|
  10898. *
  10899. * Where:
  10900. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  10901. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  10902. * NH = Next Hop
  10903. * The following field definitions describe the format of the rx peer map v3
  10904. * messages sent from the target to the host.
  10905. * - MSG_TYPE
  10906. * Bits 7:0
  10907. * Purpose: identifies this as a peer map v3 message
  10908. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  10909. * - VDEV_ID
  10910. * Bits 15:8
  10911. * Purpose: Indicates which virtual device the peer is associated with.
  10912. * - SW_PEER_ID
  10913. * Bits 31:16
  10914. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  10915. * - MAC_ADDR_L32
  10916. * Bits 31:0
  10917. * Purpose: Identifies which peer node the peer ID is for.
  10918. * Value: lower 4 bytes of peer node's MAC address
  10919. * - MAC_ADDR_U16
  10920. * Bits 15:0
  10921. * Purpose: Identifies which peer node the peer ID is for.
  10922. * Value: upper 2 bytes of peer node's MAC address
  10923. * - MULTICAST_SW_PEER_ID
  10924. * Bits 31:16
  10925. * Purpose: The multicast peer ID (index)
  10926. * Value: set to HTT_INVALID_PEER if not valid
  10927. * - HW_PEER_ID / AST_INDEX
  10928. * Bits 15:0
  10929. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10930. * address, so for rx frames marked for rx --> tx forwarding, the
  10931. * host can determine from the HW peer ID provided as meta-data with
  10932. * the rx frame which peer the frame is supposed to be forwarded to.
  10933. * - CACHE_SET_NUM
  10934. * Bits 19:16
  10935. * Purpose: Cache Set Number for AST_INDEX
  10936. * Cache set number that should be used to cache the index based
  10937. * search results, for address and flow search.
  10938. * This value should be equal to LSB 4 bits of the hash value
  10939. * of match data, in case of search index points to an entry which
  10940. * may be used in content based search also. The value can be
  10941. * anything when the entry pointed by search index will not be
  10942. * used for content based search.
  10943. * - HTT_MSDU_IDX_VALID_MASK
  10944. * Bits 31:24
  10945. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  10946. * - ONCHIP_AST_IDX / RESERVED
  10947. * Bits 15:0
  10948. * Purpose: This field is valid only when split AST feature is enabled.
  10949. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  10950. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10951. * address, this ast_idx is used for LMAC modules for RXPCU.
  10952. * - NEXT_HOP
  10953. * Bits 16
  10954. * Purpose: Flag indicates next_hop AST entry used for WDS
  10955. * (Wireless Distribution System).
  10956. * - ONCHIP_AST_VALID
  10957. * Bits 17
  10958. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  10959. * - EXT_AST_VALID
  10960. * Bits 18
  10961. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  10962. * - EXT_AST_INDEX
  10963. * Bits 15:0
  10964. * Purpose: This field describes Extended AST index
  10965. * Valid if EXT_AST_VALID flag set
  10966. * - HTT_MSDU_IDX_VALID_MASK_EXT
  10967. * Bits 31:24
  10968. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  10969. */
  10970. /* dword 0 */
  10971. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  10972. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  10973. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  10974. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  10975. /* dword 1 */
  10976. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  10977. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  10978. /* dword 2 */
  10979. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  10980. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  10981. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  10982. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  10983. /* dword 3 */
  10984. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  10985. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  10986. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  10987. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  10988. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  10989. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  10990. /* dword 4 */
  10991. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  10992. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  10993. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  10994. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  10995. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  10996. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  10997. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  10998. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  10999. /* dword 5 */
  11000. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11001. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11002. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11003. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11004. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11005. do { \
  11006. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11007. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11008. } while (0)
  11009. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11010. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11011. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11012. do { \
  11013. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11014. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11015. } while (0)
  11016. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11017. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11018. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11019. do { \
  11020. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11021. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11022. } while (0)
  11023. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11024. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11025. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11026. do { \
  11027. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11028. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11029. } while (0)
  11030. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11031. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11032. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11033. do { \
  11034. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11035. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11036. } while (0)
  11037. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11038. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11039. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11040. do { \
  11041. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11042. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11043. } while (0)
  11044. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11045. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11046. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11047. do { \
  11048. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11049. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11050. } while (0)
  11051. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11052. (((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)
  11053. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11054. do { \
  11055. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11056. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11057. } while (0)
  11058. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11059. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11060. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11061. do { \
  11062. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11063. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11064. } while (0)
  11065. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11066. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11067. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11068. do { \
  11069. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11070. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11071. } while (0)
  11072. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11073. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11074. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11075. do { \
  11076. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11077. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11078. } while (0)
  11079. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11080. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11081. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11082. do { \
  11083. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11084. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11085. } while (0)
  11086. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11087. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11088. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11089. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11090. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11091. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11092. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11093. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11094. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11095. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11096. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11097. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11098. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11099. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11100. /**
  11101. * @brief target -> host rx peer unmap V2 message definition
  11102. *
  11103. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11104. *
  11105. * The following diagram shows the format of the rx peer unmap message sent
  11106. * from the target to the host.
  11107. *
  11108. * |31 24|23 16|15 8|7 0|
  11109. * |-----------------------------------------------------------------------|
  11110. * | SW peer ID | VDEV ID | msg type |
  11111. * |-----------------------------------------------------------------------|
  11112. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11113. * |-----------------------------------------------------------------------|
  11114. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11115. * |-----------------------------------------------------------------------|
  11116. * | Peer Delete Duration |
  11117. * |-----------------------------------------------------------------------|
  11118. * | Reserved_0 | WDS Free Count |
  11119. * |-----------------------------------------------------------------------|
  11120. * | Reserved_1 |
  11121. * |-----------------------------------------------------------------------|
  11122. * | Reserved_2 |
  11123. * |-----------------------------------------------------------------------|
  11124. *
  11125. *
  11126. * The following field definitions describe the format of the rx peer unmap
  11127. * messages sent from the target to the host.
  11128. * - MSG_TYPE
  11129. * Bits 7:0
  11130. * Purpose: identifies this as an rx peer unmap v2 message
  11131. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11132. * - VDEV_ID
  11133. * Bits 15:8
  11134. * Purpose: Indicates which virtual device the peer is associated
  11135. * with.
  11136. * Value: vdev ID (used in the host to look up the vdev object)
  11137. * - SW_PEER_ID
  11138. * Bits 31:16
  11139. * Purpose: The peer ID (index) that WAL is freeing
  11140. * Value: (rx) peer ID
  11141. * - MAC_ADDR_L32
  11142. * Bits 31:0
  11143. * Purpose: Identifies which peer node the peer ID is for.
  11144. * Value: lower 4 bytes of peer node's MAC address
  11145. * - MAC_ADDR_U16
  11146. * Bits 15:0
  11147. * Purpose: Identifies which peer node the peer ID is for.
  11148. * Value: upper 2 bytes of peer node's MAC address
  11149. * - NEXT_HOP
  11150. * Bits 16
  11151. * Purpose: Bit indicates next_hop AST entry used for WDS
  11152. * (Wireless Distribution System).
  11153. * - PEER_DELETE_DURATION
  11154. * Bits 31:0
  11155. * Purpose: Time taken to delete peer, in msec,
  11156. * Used for monitoring / debugging PEER delete response delay
  11157. * - PEER_WDS_FREE_COUNT
  11158. * Bits 15:0
  11159. * Purpose: Count of WDS entries deleted associated to peer deleted
  11160. */
  11161. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11162. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11163. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11164. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11165. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11166. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11167. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11168. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11169. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11170. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11171. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11172. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11173. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11174. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11175. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11176. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11177. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11178. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11179. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11180. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11181. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11182. do { \
  11183. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11184. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11185. } while (0)
  11186. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11187. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11188. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11189. do { \
  11190. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11191. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11192. } while (0)
  11193. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11194. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11195. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11196. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11197. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11198. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11199. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11200. /**
  11201. * @brief target -> host rx peer mlo map message definition
  11202. *
  11203. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11204. *
  11205. * @details
  11206. * The following diagram shows the format of the rx mlo peer map message sent
  11207. * from the target to the host. This layout assumes the target operates
  11208. * as little-endian.
  11209. *
  11210. * MCC:
  11211. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11212. *
  11213. * WIN:
  11214. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11215. * It will be sent on the Assoc Link.
  11216. *
  11217. * This message always contains a MLO peer ID. The main purpose of the
  11218. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11219. * with, so that the host can use that MLO peer ID to determine which peer
  11220. * transmitted the rx frame.
  11221. *
  11222. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11223. * |-------------------------------------------------------------------------|
  11224. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11225. * |-------------------------------------------------------------------------|
  11226. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11227. * |-------------------------------------------------------------------------|
  11228. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11229. * |-------------------------------------------------------------------------|
  11230. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11231. * |-------------------------------------------------------------------------|
  11232. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11233. * |-------------------------------------------------------------------------|
  11234. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11235. * |-------------------------------------------------------------------------|
  11236. * |RSVD |
  11237. * |-------------------------------------------------------------------------|
  11238. * |RSVD |
  11239. * |-------------------------------------------------------------------------|
  11240. * | htt_tlv_hdr_t |
  11241. * |-------------------------------------------------------------------------|
  11242. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11243. * |-------------------------------------------------------------------------|
  11244. * | htt_tlv_hdr_t |
  11245. * |-------------------------------------------------------------------------|
  11246. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11247. * |-------------------------------------------------------------------------|
  11248. * | htt_tlv_hdr_t |
  11249. * |-------------------------------------------------------------------------|
  11250. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11251. * |-------------------------------------------------------------------------|
  11252. *
  11253. * Where:
  11254. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11255. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11256. * V (valid) - 1 Bit Bit17
  11257. * CHIPID - 3 Bits
  11258. * TIDMASK - 8 Bits
  11259. * CACHE_SET_NUM - 8 Bits
  11260. *
  11261. * The following field definitions describe the format of the rx MLO peer map
  11262. * messages sent from the target to the host.
  11263. * - MSG_TYPE
  11264. * Bits 7:0
  11265. * Purpose: identifies this as an rx mlo peer map message
  11266. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11267. *
  11268. * - MLO_PEER_ID
  11269. * Bits 23:8
  11270. * Purpose: The MLO peer ID (index).
  11271. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11272. * Value: MLO peer ID
  11273. *
  11274. * - NUMLINK
  11275. * Bits: 26:24 (3Bits)
  11276. * Purpose: Indicate the max number of logical links supported per client.
  11277. * Value: number of logical links
  11278. *
  11279. * - PRC
  11280. * Bits: 29:27 (3Bits)
  11281. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11282. * if there is migration of the primary chip.
  11283. * Value: Primary REO CHIPID
  11284. *
  11285. * - MAC_ADDR_L32
  11286. * Bits 31:0
  11287. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11288. * Value: lower 4 bytes of peer node's MAC address
  11289. *
  11290. * - MAC_ADDR_U16
  11291. * Bits 15:0
  11292. * Purpose: Identifies which peer node the peer ID is for.
  11293. * Value: upper 2 bytes of peer node's MAC address
  11294. *
  11295. * - PRIMARY_TCL_AST_IDX
  11296. * Bits 15:0
  11297. * Purpose: Primary TCL AST index for this peer.
  11298. *
  11299. * - V
  11300. * 1 Bit Position 16
  11301. * Purpose: If the ast idx is valid.
  11302. *
  11303. * - CHIPID
  11304. * Bits 19:17
  11305. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11306. *
  11307. * - TIDMASK
  11308. * Bits 27:20
  11309. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11310. *
  11311. * - CACHE_SET_NUM
  11312. * Bits 31:28
  11313. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11314. * Cache set number that should be used to cache the index based
  11315. * search results, for address and flow search.
  11316. * This value should be equal to LSB four bits of the hash value
  11317. * of match data, in case of search index points to an entry which
  11318. * may be used in content based search also. The value can be
  11319. * anything when the entry pointed by search index will not be
  11320. * used for content based search.
  11321. *
  11322. * - htt_tlv_hdr_t
  11323. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11324. *
  11325. * Bits 11:0
  11326. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11327. *
  11328. * Bits 23:12
  11329. * Purpose: Length, Length of the value that follows the header
  11330. *
  11331. * Bits 31:28
  11332. * Purpose: Reserved.
  11333. *
  11334. *
  11335. * - SW_PEER_ID
  11336. * Bits 15:0
  11337. * Purpose: The peer ID (index) that WAL is allocating
  11338. * Value: (rx) peer ID
  11339. *
  11340. * - VDEV_ID
  11341. * Bits 23:16
  11342. * Purpose: Indicates which virtual device the peer is associated with.
  11343. * Value: vdev ID (used in the host to look up the vdev object)
  11344. *
  11345. * - CHIPID
  11346. * Bits 26:24
  11347. * Purpose: Indicates which Chip id the peer is associated with.
  11348. * Value: chip ID (Provided by Host as part of QMI exchange)
  11349. */
  11350. typedef enum {
  11351. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11352. } MLO_PEER_MAP_TLV_TAG_ID;
  11353. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11354. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11355. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11356. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11357. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11358. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11359. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11360. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11361. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11362. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11363. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11364. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11365. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11366. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11367. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11368. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11369. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11370. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11371. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11372. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11373. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11374. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11375. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11376. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11377. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11378. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11379. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11380. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11381. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11382. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11383. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11384. do { \
  11385. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11386. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11387. } while (0)
  11388. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11389. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11390. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11391. do { \
  11392. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11393. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11394. } while (0)
  11395. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11396. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11397. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11398. do { \
  11399. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11400. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11401. } while (0)
  11402. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11403. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11404. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11405. do { \
  11406. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11407. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11408. } while (0)
  11409. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11410. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11411. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11412. do { \
  11413. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11414. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11415. } while (0)
  11416. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11417. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11418. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11419. do { \
  11420. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11421. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11422. } while (0)
  11423. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11424. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11425. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11426. do { \
  11427. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11428. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11429. } while (0)
  11430. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11431. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11432. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11433. do { \
  11434. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11435. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11436. } while (0)
  11437. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11438. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11439. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11440. do { \
  11441. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11442. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11443. } while (0)
  11444. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11445. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11446. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11447. do { \
  11448. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11449. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11450. } while (0)
  11451. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11452. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11453. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11454. do { \
  11455. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11456. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11457. } while (0)
  11458. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11459. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11460. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11461. do { \
  11462. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11463. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11464. } while (0)
  11465. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11466. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11467. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11468. do { \
  11469. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11470. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11471. } while (0)
  11472. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11473. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11474. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11475. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11476. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11477. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11478. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11479. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11480. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11481. *
  11482. * The following diagram shows the format of the rx mlo peer unmap message sent
  11483. * from the target to the host.
  11484. *
  11485. * |31 24|23 16|15 8|7 0|
  11486. * |-----------------------------------------------------------------------|
  11487. * | RSVD_24_31 | MLO peer ID | msg type |
  11488. * |-----------------------------------------------------------------------|
  11489. */
  11490. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11491. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11492. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11493. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11494. /**
  11495. * @brief target -> host message specifying security parameters
  11496. *
  11497. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11498. *
  11499. * @details
  11500. * The following diagram shows the format of the security specification
  11501. * message sent from the target to the host.
  11502. * This security specification message tells the host whether a PN check is
  11503. * necessary on rx data frames, and if so, how large the PN counter is.
  11504. * This message also tells the host about the security processing to apply
  11505. * to defragmented rx frames - specifically, whether a Message Integrity
  11506. * Check is required, and the Michael key to use.
  11507. *
  11508. * |31 24|23 16|15|14 8|7 0|
  11509. * |-----------------------------------------------------------------------|
  11510. * | peer ID | U| security type | msg type |
  11511. * |-----------------------------------------------------------------------|
  11512. * | Michael Key K0 |
  11513. * |-----------------------------------------------------------------------|
  11514. * | Michael Key K1 |
  11515. * |-----------------------------------------------------------------------|
  11516. * | WAPI RSC Low0 |
  11517. * |-----------------------------------------------------------------------|
  11518. * | WAPI RSC Low1 |
  11519. * |-----------------------------------------------------------------------|
  11520. * | WAPI RSC Hi0 |
  11521. * |-----------------------------------------------------------------------|
  11522. * | WAPI RSC Hi1 |
  11523. * |-----------------------------------------------------------------------|
  11524. *
  11525. * The following field definitions describe the format of the security
  11526. * indication message sent from the target to the host.
  11527. * - MSG_TYPE
  11528. * Bits 7:0
  11529. * Purpose: identifies this as a security specification message
  11530. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11531. * - SEC_TYPE
  11532. * Bits 14:8
  11533. * Purpose: specifies which type of security applies to the peer
  11534. * Value: htt_sec_type enum value
  11535. * - UNICAST
  11536. * Bit 15
  11537. * Purpose: whether this security is applied to unicast or multicast data
  11538. * Value: 1 -> unicast, 0 -> multicast
  11539. * - PEER_ID
  11540. * Bits 31:16
  11541. * Purpose: The ID number for the peer the security specification is for
  11542. * Value: peer ID
  11543. * - MICHAEL_KEY_K0
  11544. * Bits 31:0
  11545. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11546. * Value: Michael Key K0 (if security type is TKIP)
  11547. * - MICHAEL_KEY_K1
  11548. * Bits 31:0
  11549. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11550. * Value: Michael Key K1 (if security type is TKIP)
  11551. * - WAPI_RSC_LOW0
  11552. * Bits 31:0
  11553. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11554. * Value: WAPI RSC Low0 (if security type is WAPI)
  11555. * - WAPI_RSC_LOW1
  11556. * Bits 31:0
  11557. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11558. * Value: WAPI RSC Low1 (if security type is WAPI)
  11559. * - WAPI_RSC_HI0
  11560. * Bits 31:0
  11561. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11562. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11563. * - WAPI_RSC_HI1
  11564. * Bits 31:0
  11565. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11566. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11567. */
  11568. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11569. #define HTT_SEC_IND_SEC_TYPE_S 8
  11570. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11571. #define HTT_SEC_IND_UNICAST_S 15
  11572. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11573. #define HTT_SEC_IND_PEER_ID_S 16
  11574. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11575. do { \
  11576. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11577. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11578. } while (0)
  11579. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11580. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11581. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11582. do { \
  11583. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  11584. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  11585. } while (0)
  11586. #define HTT_SEC_IND_UNICAST_GET(word) \
  11587. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  11588. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  11589. do { \
  11590. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  11591. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  11592. } while (0)
  11593. #define HTT_SEC_IND_PEER_ID_GET(word) \
  11594. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  11595. #define HTT_SEC_IND_BYTES 28
  11596. /**
  11597. * @brief target -> host rx ADDBA / DELBA message definitions
  11598. *
  11599. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  11600. *
  11601. * @details
  11602. * The following diagram shows the format of the rx ADDBA message sent
  11603. * from the target to the host:
  11604. *
  11605. * |31 20|19 16|15 8|7 0|
  11606. * |---------------------------------------------------------------------|
  11607. * | peer ID | TID | window size | msg type |
  11608. * |---------------------------------------------------------------------|
  11609. *
  11610. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  11611. *
  11612. * The following diagram shows the format of the rx DELBA message sent
  11613. * from the target to the host:
  11614. *
  11615. * |31 20|19 16|15 10|9 8|7 0|
  11616. * |---------------------------------------------------------------------|
  11617. * | peer ID | TID | window size | IR| msg type |
  11618. * |---------------------------------------------------------------------|
  11619. *
  11620. * The following field definitions describe the format of the rx ADDBA
  11621. * and DELBA messages sent from the target to the host.
  11622. * - MSG_TYPE
  11623. * Bits 7:0
  11624. * Purpose: identifies this as an rx ADDBA or DELBA message
  11625. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  11626. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  11627. * - IR (initiator / recipient)
  11628. * Bits 9:8 (DELBA only)
  11629. * Purpose: specify whether the DELBA handshake was initiated by the
  11630. * local STA/AP, or by the peer STA/AP
  11631. * Value:
  11632. * 0 - unspecified
  11633. * 1 - initiator (a.k.a. originator)
  11634. * 2 - recipient (a.k.a. responder)
  11635. * 3 - unused / reserved
  11636. * - WIN_SIZE
  11637. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  11638. * Purpose: Specifies the length of the block ack window (max = 64).
  11639. * Value:
  11640. * block ack window length specified by the received ADDBA/DELBA
  11641. * management message.
  11642. * - TID
  11643. * Bits 19:16
  11644. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  11645. * Value:
  11646. * TID specified by the received ADDBA or DELBA management message.
  11647. * - PEER_ID
  11648. * Bits 31:20
  11649. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  11650. * Value:
  11651. * ID (hash value) used by the host for fast, direct lookup of
  11652. * host SW peer info, including rx reorder states.
  11653. */
  11654. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  11655. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  11656. #define HTT_RX_ADDBA_TID_M 0xf0000
  11657. #define HTT_RX_ADDBA_TID_S 16
  11658. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  11659. #define HTT_RX_ADDBA_PEER_ID_S 20
  11660. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  11661. do { \
  11662. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  11663. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  11664. } while (0)
  11665. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  11666. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  11667. #define HTT_RX_ADDBA_TID_SET(word, value) \
  11668. do { \
  11669. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  11670. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  11671. } while (0)
  11672. #define HTT_RX_ADDBA_TID_GET(word) \
  11673. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  11674. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  11675. do { \
  11676. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  11677. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  11678. } while (0)
  11679. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  11680. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  11681. #define HTT_RX_ADDBA_BYTES 4
  11682. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  11683. #define HTT_RX_DELBA_INITIATOR_S 8
  11684. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  11685. #define HTT_RX_DELBA_WIN_SIZE_S 10
  11686. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  11687. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  11688. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  11689. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  11690. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  11691. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  11692. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  11693. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  11694. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  11695. do { \
  11696. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  11697. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  11698. } while (0)
  11699. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  11700. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  11701. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  11702. do { \
  11703. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  11704. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  11705. } while (0)
  11706. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  11707. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  11708. #define HTT_RX_DELBA_BYTES 4
  11709. /**
  11710. * @brief tx queue group information element definition
  11711. *
  11712. * @details
  11713. * The following diagram shows the format of the tx queue group
  11714. * information element, which can be included in target --> host
  11715. * messages to specify the number of tx "credits" (tx descriptors
  11716. * for LL, or tx buffers for HL) available to a particular group
  11717. * of host-side tx queues, and which host-side tx queues belong to
  11718. * the group.
  11719. *
  11720. * |31|30 24|23 16|15|14|13 0|
  11721. * |------------------------------------------------------------------------|
  11722. * | X| reserved | tx queue grp ID | A| S| credit count |
  11723. * |------------------------------------------------------------------------|
  11724. * | vdev ID mask | AC mask |
  11725. * |------------------------------------------------------------------------|
  11726. *
  11727. * The following definitions describe the fields within the tx queue group
  11728. * information element:
  11729. * - credit_count
  11730. * Bits 13:1
  11731. * Purpose: specify how many tx credits are available to the tx queue group
  11732. * Value: An absolute or relative, positive or negative credit value
  11733. * The 'A' bit specifies whether the value is absolute or relative.
  11734. * The 'S' bit specifies whether the value is positive or negative.
  11735. * A negative value can only be relative, not absolute.
  11736. * An absolute value replaces any prior credit value the host has for
  11737. * the tx queue group in question.
  11738. * A relative value is added to the prior credit value the host has for
  11739. * the tx queue group in question.
  11740. * - sign
  11741. * Bit 14
  11742. * Purpose: specify whether the credit count is positive or negative
  11743. * Value: 0 -> positive, 1 -> negative
  11744. * - absolute
  11745. * Bit 15
  11746. * Purpose: specify whether the credit count is absolute or relative
  11747. * Value: 0 -> relative, 1 -> absolute
  11748. * - txq_group_id
  11749. * Bits 23:16
  11750. * Purpose: indicate which tx queue group's credit and/or membership are
  11751. * being specified
  11752. * Value: 0 to max_tx_queue_groups-1
  11753. * - reserved
  11754. * Bits 30:16
  11755. * Value: 0x0
  11756. * - eXtension
  11757. * Bit 31
  11758. * Purpose: specify whether another tx queue group info element follows
  11759. * Value: 0 -> no more tx queue group information elements
  11760. * 1 -> another tx queue group information element immediately follows
  11761. * - ac_mask
  11762. * Bits 15:0
  11763. * Purpose: specify which Access Categories belong to the tx queue group
  11764. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  11765. * the tx queue group.
  11766. * The AC bit-mask values are obtained by left-shifting by the
  11767. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  11768. * - vdev_id_mask
  11769. * Bits 31:16
  11770. * Purpose: specify which vdev's tx queues belong to the tx queue group
  11771. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  11772. * belong to the tx queue group.
  11773. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  11774. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  11775. */
  11776. PREPACK struct htt_txq_group {
  11777. A_UINT32
  11778. credit_count: 14,
  11779. sign: 1,
  11780. absolute: 1,
  11781. tx_queue_group_id: 8,
  11782. reserved0: 7,
  11783. extension: 1;
  11784. A_UINT32
  11785. ac_mask: 16,
  11786. vdev_id_mask: 16;
  11787. } POSTPACK;
  11788. /* first word */
  11789. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  11790. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  11791. #define HTT_TXQ_GROUP_SIGN_S 14
  11792. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  11793. #define HTT_TXQ_GROUP_ABS_S 15
  11794. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  11795. #define HTT_TXQ_GROUP_ID_S 16
  11796. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  11797. #define HTT_TXQ_GROUP_EXT_S 31
  11798. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  11799. /* second word */
  11800. #define HTT_TXQ_GROUP_AC_MASK_S 0
  11801. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  11802. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  11803. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  11804. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  11805. do { \
  11806. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  11807. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  11808. } while (0)
  11809. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  11810. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  11811. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  11812. do { \
  11813. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  11814. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  11815. } while (0)
  11816. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  11817. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  11818. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  11819. do { \
  11820. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  11821. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  11822. } while (0)
  11823. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  11824. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  11825. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  11826. do { \
  11827. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  11828. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  11829. } while (0)
  11830. #define HTT_TXQ_GROUP_ID_GET(_info) \
  11831. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  11832. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  11833. do { \
  11834. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  11835. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  11836. } while (0)
  11837. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  11838. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  11839. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  11840. do { \
  11841. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  11842. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  11843. } while (0)
  11844. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  11845. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  11846. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  11847. do { \
  11848. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  11849. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  11850. } while (0)
  11851. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  11852. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  11853. /**
  11854. * @brief target -> host TX completion indication message definition
  11855. *
  11856. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  11857. *
  11858. * @details
  11859. * The following diagram shows the format of the TX completion indication sent
  11860. * from the target to the host
  11861. *
  11862. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  11863. * |-------------------------------------------------------------------|
  11864. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  11865. * |-------------------------------------------------------------------|
  11866. * payload:| MSDU1 ID | MSDU0 ID |
  11867. * |-------------------------------------------------------------------|
  11868. * : MSDU3 ID | MSDU2 ID :
  11869. * |-------------------------------------------------------------------|
  11870. * | struct htt_tx_compl_ind_append_retries |
  11871. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11872. * | struct htt_tx_compl_ind_append_tx_tstamp |
  11873. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11874. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  11875. * |-------------------------------------------------------------------|
  11876. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  11877. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11878. * | MSDU0 tx_tsf64_low |
  11879. * |-------------------------------------------------------------------|
  11880. * | MSDU0 tx_tsf64_high |
  11881. * |-------------------------------------------------------------------|
  11882. * | MSDU1 tx_tsf64_low |
  11883. * |-------------------------------------------------------------------|
  11884. * | MSDU1 tx_tsf64_high |
  11885. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11886. * | phy_timestamp |
  11887. * |-------------------------------------------------------------------|
  11888. * | rate specs (see below) |
  11889. * |-------------------------------------------------------------------|
  11890. * | seqctrl | framectrl |
  11891. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11892. * Where:
  11893. * A0 = append (a.k.a. append0)
  11894. * A1 = append1
  11895. * TP = MSDU tx power presence
  11896. * A2 = append2
  11897. * A3 = append3
  11898. * A4 = append4
  11899. *
  11900. * The following field definitions describe the format of the TX completion
  11901. * indication sent from the target to the host
  11902. * Header fields:
  11903. * - msg_type
  11904. * Bits 7:0
  11905. * Purpose: identifies this as HTT TX completion indication
  11906. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  11907. * - status
  11908. * Bits 10:8
  11909. * Purpose: the TX completion status of payload fragmentations descriptors
  11910. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  11911. * - tid
  11912. * Bits 14:11
  11913. * Purpose: the tid associated with those fragmentation descriptors. It is
  11914. * valid or not, depending on the tid_invalid bit.
  11915. * Value: 0 to 15
  11916. * - tid_invalid
  11917. * Bits 15:15
  11918. * Purpose: this bit indicates whether the tid field is valid or not
  11919. * Value: 0 indicates valid; 1 indicates invalid
  11920. * - num
  11921. * Bits 23:16
  11922. * Purpose: the number of payload in this indication
  11923. * Value: 1 to 255
  11924. * - append (a.k.a. append0)
  11925. * Bits 24:24
  11926. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  11927. * the number of tx retries for one MSDU at the end of this message
  11928. * Value: 0 indicates no appending; 1 indicates appending
  11929. * - append1
  11930. * Bits 25:25
  11931. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  11932. * contains the timestamp info for each TX msdu id in payload.
  11933. * The order of the timestamps matches the order of the MSDU IDs.
  11934. * Note that a big-endian host needs to account for the reordering
  11935. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11936. * conversion) when determining which tx timestamp corresponds to
  11937. * which MSDU ID.
  11938. * Value: 0 indicates no appending; 1 indicates appending
  11939. * - msdu_tx_power_presence
  11940. * Bits 26:26
  11941. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  11942. * for each MSDU referenced by the TX_COMPL_IND message.
  11943. * The tx power is reported in 0.5 dBm units.
  11944. * The order of the per-MSDU tx power reports matches the order
  11945. * of the MSDU IDs.
  11946. * Note that a big-endian host needs to account for the reordering
  11947. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11948. * conversion) when determining which Tx Power corresponds to
  11949. * which MSDU ID.
  11950. * Value: 0 indicates MSDU tx power reports are not appended,
  11951. * 1 indicates MSDU tx power reports are appended
  11952. * - append2
  11953. * Bits 27:27
  11954. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  11955. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  11956. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  11957. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  11958. * for each MSDU, for convenience.
  11959. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  11960. * this append2 bit is set).
  11961. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  11962. * dB above the noise floor.
  11963. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  11964. * 1 indicates MSDU ACK RSSI values are appended.
  11965. * - append3
  11966. * Bits 28:28
  11967. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  11968. * contains the tx tsf info based on wlan global TSF for
  11969. * each TX msdu id in payload.
  11970. * The order of the tx tsf matches the order of the MSDU IDs.
  11971. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  11972. * values to indicate the the lower 32 bits and higher 32 bits of
  11973. * the tx tsf.
  11974. * The tx_tsf64 here represents the time MSDU was acked and the
  11975. * tx_tsf64 has microseconds units.
  11976. * Value: 0 indicates no appending; 1 indicates appending
  11977. * - append4
  11978. * Bits 29:29
  11979. * Purpose: Indicate whether data frame control fields and fields required
  11980. * for radio tap header are appended for each MSDU in TX_COMP_IND
  11981. * message. The order of the this message matches the order of
  11982. * the MSDU IDs.
  11983. * Value: 0 indicates frame control fields and fields required for
  11984. * radio tap header values are not appended,
  11985. * 1 indicates frame control fields and fields required for
  11986. * radio tap header values are appended.
  11987. * Payload fields:
  11988. * - hmsdu_id
  11989. * Bits 15:0
  11990. * Purpose: this ID is used to track the Tx buffer in host
  11991. * Value: 0 to "size of host MSDU descriptor pool - 1"
  11992. */
  11993. PREPACK struct htt_tx_data_hdr_information {
  11994. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  11995. A_UINT32 /* word 1 */
  11996. /* preamble:
  11997. * 0-OFDM,
  11998. * 1-CCk,
  11999. * 2-HT,
  12000. * 3-VHT
  12001. */
  12002. preamble: 2, /* [1:0] */
  12003. /* mcs:
  12004. * In case of HT preamble interpret
  12005. * MCS along with NSS.
  12006. * Valid values for HT are 0 to 7.
  12007. * HT mcs 0 with NSS 2 is mcs 8.
  12008. * Valid values for VHT are 0 to 9.
  12009. */
  12010. mcs: 4, /* [5:2] */
  12011. /* rate:
  12012. * This is applicable only for
  12013. * CCK and OFDM preamble type
  12014. * rate 0: OFDM 48 Mbps,
  12015. * 1: OFDM 24 Mbps,
  12016. * 2: OFDM 12 Mbps
  12017. * 3: OFDM 6 Mbps
  12018. * 4: OFDM 54 Mbps
  12019. * 5: OFDM 36 Mbps
  12020. * 6: OFDM 18 Mbps
  12021. * 7: OFDM 9 Mbps
  12022. * rate 0: CCK 11 Mbps Long
  12023. * 1: CCK 5.5 Mbps Long
  12024. * 2: CCK 2 Mbps Long
  12025. * 3: CCK 1 Mbps Long
  12026. * 4: CCK 11 Mbps Short
  12027. * 5: CCK 5.5 Mbps Short
  12028. * 6: CCK 2 Mbps Short
  12029. */
  12030. rate : 3, /* [ 8: 6] */
  12031. rssi : 8, /* [16: 9] units=dBm */
  12032. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12033. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12034. stbc : 1, /* [22] */
  12035. sgi : 1, /* [23] */
  12036. ldpc : 1, /* [24] */
  12037. beamformed: 1, /* [25] */
  12038. /* tx_retry_cnt:
  12039. * Indicates retry count of data tx frames provided by the host.
  12040. */
  12041. tx_retry_cnt: 6; /* [31:26] */
  12042. A_UINT32 /* word 2 */
  12043. framectrl:16, /* [15: 0] */
  12044. seqno:16; /* [31:16] */
  12045. } POSTPACK;
  12046. #define HTT_TX_COMPL_IND_STATUS_S 8
  12047. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12048. #define HTT_TX_COMPL_IND_TID_S 11
  12049. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12050. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12051. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12052. #define HTT_TX_COMPL_IND_NUM_S 16
  12053. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12054. #define HTT_TX_COMPL_IND_APPEND_S 24
  12055. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12056. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12057. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12058. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12059. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12060. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12061. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12062. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12063. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12064. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12065. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12066. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12067. do { \
  12068. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12069. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12070. } while (0)
  12071. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12072. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12073. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12074. do { \
  12075. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12076. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12077. } while (0)
  12078. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12079. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12080. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12081. do { \
  12082. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12083. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12084. } while (0)
  12085. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12086. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12087. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12088. do { \
  12089. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12090. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12091. } while (0)
  12092. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12093. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12094. HTT_TX_COMPL_IND_TID_INV_S)
  12095. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12096. do { \
  12097. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12098. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12099. } while (0)
  12100. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12101. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12102. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12103. do { \
  12104. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12105. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12106. } while (0)
  12107. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12108. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12109. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12110. do { \
  12111. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12112. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12113. } while (0)
  12114. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12115. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12116. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12117. do { \
  12118. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12119. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12120. } while (0)
  12121. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12122. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12123. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12124. do { \
  12125. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12126. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12127. } while (0)
  12128. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12129. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12130. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12131. do { \
  12132. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12133. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12134. } while (0)
  12135. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12136. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12137. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12138. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12139. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12140. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12141. #define HTT_TX_COMPL_IND_STAT_OK 0
  12142. /* DISCARD:
  12143. * current meaning:
  12144. * MSDUs were queued for transmission but filtered by HW or SW
  12145. * without any over the air attempts
  12146. * legacy meaning (HL Rome):
  12147. * MSDUs were discarded by the target FW without any over the air
  12148. * attempts due to lack of space
  12149. */
  12150. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12151. /* NO_ACK:
  12152. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12153. */
  12154. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12155. /* POSTPONE:
  12156. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12157. * be downloaded again later (in the appropriate order), when they are
  12158. * deliverable.
  12159. */
  12160. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12161. /*
  12162. * The PEER_DEL tx completion status is used for HL cases
  12163. * where the peer the frame is for has been deleted.
  12164. * The host has already discarded its copy of the frame, but
  12165. * it still needs the tx completion to restore its credit.
  12166. */
  12167. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12168. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12169. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12170. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12171. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12172. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12173. PREPACK struct htt_tx_compl_ind_base {
  12174. A_UINT32 hdr;
  12175. A_UINT16 payload[1/*or more*/];
  12176. } POSTPACK;
  12177. PREPACK struct htt_tx_compl_ind_append_retries {
  12178. A_UINT16 msdu_id;
  12179. A_UINT8 tx_retries;
  12180. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12181. 0: this is the last append_retries struct */
  12182. } POSTPACK;
  12183. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12184. A_UINT32 timestamp[1/*or more*/];
  12185. } POSTPACK;
  12186. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12187. A_UINT32 tx_tsf64_low;
  12188. A_UINT32 tx_tsf64_high;
  12189. } POSTPACK;
  12190. /* htt_tx_data_hdr_information payload extension fields: */
  12191. /* DWORD zero */
  12192. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12193. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12194. /* DWORD one */
  12195. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12196. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12197. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12198. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12199. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12200. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12201. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12202. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12203. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12204. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12205. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12206. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12207. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12208. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12209. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12210. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12211. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12212. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12213. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12214. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12215. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12216. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12217. /* DWORD two */
  12218. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12219. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12220. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12221. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12222. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12223. do { \
  12224. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12225. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12226. } while (0)
  12227. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12228. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12229. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12230. do { \
  12231. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12232. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12233. } while (0)
  12234. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12235. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12236. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12237. do { \
  12238. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12239. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12240. } while (0)
  12241. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12242. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12243. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12244. do { \
  12245. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12246. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12247. } while (0)
  12248. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12249. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12250. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12251. do { \
  12252. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12253. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12254. } while (0)
  12255. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12256. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12257. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12258. do { \
  12259. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12260. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12261. } while (0)
  12262. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12263. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12264. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12265. do { \
  12266. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12267. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12268. } while (0)
  12269. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12270. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12271. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12272. do { \
  12273. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12274. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12275. } while (0)
  12276. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12277. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12278. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12279. do { \
  12280. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12281. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12282. } while (0)
  12283. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12284. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12285. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12286. do { \
  12287. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12288. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12289. } while (0)
  12290. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12291. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12292. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12293. do { \
  12294. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12295. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12296. } while (0)
  12297. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12298. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12299. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12300. do { \
  12301. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12302. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12303. } while (0)
  12304. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12305. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12306. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12307. do { \
  12308. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12309. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12310. } while (0)
  12311. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12312. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12313. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12314. do { \
  12315. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12316. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12317. } while (0)
  12318. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12319. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12320. /**
  12321. * @brief target -> host rate-control update indication message
  12322. *
  12323. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12324. *
  12325. * @details
  12326. * The following diagram shows the format of the RC Update message
  12327. * sent from the target to the host, while processing the tx-completion
  12328. * of a transmitted PPDU.
  12329. *
  12330. * |31 24|23 16|15 8|7 0|
  12331. * |-------------------------------------------------------------|
  12332. * | peer ID | vdev ID | msg_type |
  12333. * |-------------------------------------------------------------|
  12334. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12335. * |-------------------------------------------------------------|
  12336. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12337. * |-------------------------------------------------------------|
  12338. * | : |
  12339. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12340. * | : |
  12341. * |-------------------------------------------------------------|
  12342. * | : |
  12343. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12344. * | : |
  12345. * |-------------------------------------------------------------|
  12346. * : :
  12347. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12348. *
  12349. */
  12350. typedef struct {
  12351. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12352. A_UINT32 rate_code_flags;
  12353. A_UINT32 flags; /* Encodes information such as excessive
  12354. retransmission, aggregate, some info
  12355. from .11 frame control,
  12356. STBC, LDPC, (SGI and Tx Chain Mask
  12357. are encoded in ptx_rc->flags field),
  12358. AMPDU truncation (BT/time based etc.),
  12359. RTS/CTS attempt */
  12360. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12361. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12362. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12363. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12364. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12365. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12366. } HTT_RC_TX_DONE_PARAMS;
  12367. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12368. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12369. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12370. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12371. #define HTT_RC_UPDATE_VDEVID_S 8
  12372. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12373. #define HTT_RC_UPDATE_PEERID_S 16
  12374. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12375. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12376. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12377. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12378. do { \
  12379. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12380. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12381. } while (0)
  12382. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12383. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12384. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12385. do { \
  12386. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12387. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12388. } while (0)
  12389. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12390. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12391. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12392. do { \
  12393. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12394. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12395. } while (0)
  12396. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12397. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12398. /**
  12399. * @brief target -> host rx fragment indication message definition
  12400. *
  12401. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12402. *
  12403. * @details
  12404. * The following field definitions describe the format of the rx fragment
  12405. * indication message sent from the target to the host.
  12406. * The rx fragment indication message shares the format of the
  12407. * rx indication message, but not all fields from the rx indication message
  12408. * are relevant to the rx fragment indication message.
  12409. *
  12410. *
  12411. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12412. * |-----------+-------------------+---------------------+-------------|
  12413. * | peer ID | |FV| ext TID | msg type |
  12414. * |-------------------------------------------------------------------|
  12415. * | | flush | flush |
  12416. * | | end | start |
  12417. * | | seq num | seq num |
  12418. * |-------------------------------------------------------------------|
  12419. * | reserved | FW rx desc bytes |
  12420. * |-------------------------------------------------------------------|
  12421. * | | FW MSDU Rx |
  12422. * | | desc B0 |
  12423. * |-------------------------------------------------------------------|
  12424. * Header fields:
  12425. * - MSG_TYPE
  12426. * Bits 7:0
  12427. * Purpose: identifies this as an rx fragment indication message
  12428. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12429. * - EXT_TID
  12430. * Bits 12:8
  12431. * Purpose: identify the traffic ID of the rx data, including
  12432. * special "extended" TID values for multicast, broadcast, and
  12433. * non-QoS data frames
  12434. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12435. * - FLUSH_VALID (FV)
  12436. * Bit 13
  12437. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12438. * is valid
  12439. * Value:
  12440. * 1 -> flush IE is valid and needs to be processed
  12441. * 0 -> flush IE is not valid and should be ignored
  12442. * - PEER_ID
  12443. * Bits 31:16
  12444. * Purpose: Identify, by ID, which peer sent the rx data
  12445. * Value: ID of the peer who sent the rx data
  12446. * - FLUSH_SEQ_NUM_START
  12447. * Bits 5:0
  12448. * Purpose: Indicate the start of a series of MPDUs to flush
  12449. * Not all MPDUs within this series are necessarily valid - the host
  12450. * must check each sequence number within this range to see if the
  12451. * corresponding MPDU is actually present.
  12452. * This field is only valid if the FV bit is set.
  12453. * Value:
  12454. * The sequence number for the first MPDUs to check to flush.
  12455. * The sequence number is masked by 0x3f.
  12456. * - FLUSH_SEQ_NUM_END
  12457. * Bits 11:6
  12458. * Purpose: Indicate the end of a series of MPDUs to flush
  12459. * Value:
  12460. * The sequence number one larger than the sequence number of the
  12461. * last MPDU to check to flush.
  12462. * The sequence number is masked by 0x3f.
  12463. * Not all MPDUs within this series are necessarily valid - the host
  12464. * must check each sequence number within this range to see if the
  12465. * corresponding MPDU is actually present.
  12466. * This field is only valid if the FV bit is set.
  12467. * Rx descriptor fields:
  12468. * - FW_RX_DESC_BYTES
  12469. * Bits 15:0
  12470. * Purpose: Indicate how many bytes in the Rx indication are used for
  12471. * FW Rx descriptors
  12472. * Value: 1
  12473. */
  12474. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  12475. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  12476. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  12477. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  12478. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  12479. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  12480. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  12481. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  12482. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  12483. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  12484. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  12485. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  12486. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  12487. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  12488. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  12489. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  12490. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  12491. #define HTT_RX_FRAG_IND_BYTES \
  12492. (4 /* msg hdr */ + \
  12493. 4 /* flush spec */ + \
  12494. 4 /* (unused) FW rx desc bytes spec */ + \
  12495. 4 /* FW rx desc */)
  12496. /**
  12497. * @brief target -> host test message definition
  12498. *
  12499. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  12500. *
  12501. * @details
  12502. * The following field definitions describe the format of the test
  12503. * message sent from the target to the host.
  12504. * The message consists of a 4-octet header, followed by a variable
  12505. * number of 32-bit integer values, followed by a variable number
  12506. * of 8-bit character values.
  12507. *
  12508. * |31 16|15 8|7 0|
  12509. * |-----------------------------------------------------------|
  12510. * | num chars | num ints | msg type |
  12511. * |-----------------------------------------------------------|
  12512. * | int 0 |
  12513. * |-----------------------------------------------------------|
  12514. * | int 1 |
  12515. * |-----------------------------------------------------------|
  12516. * | ... |
  12517. * |-----------------------------------------------------------|
  12518. * | char 3 | char 2 | char 1 | char 0 |
  12519. * |-----------------------------------------------------------|
  12520. * | | | ... | char 4 |
  12521. * |-----------------------------------------------------------|
  12522. * - MSG_TYPE
  12523. * Bits 7:0
  12524. * Purpose: identifies this as a test message
  12525. * Value: HTT_MSG_TYPE_TEST
  12526. * - NUM_INTS
  12527. * Bits 15:8
  12528. * Purpose: indicate how many 32-bit integers follow the message header
  12529. * - NUM_CHARS
  12530. * Bits 31:16
  12531. * Purpose: indicate how many 8-bit charaters follow the series of integers
  12532. */
  12533. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  12534. #define HTT_RX_TEST_NUM_INTS_S 8
  12535. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  12536. #define HTT_RX_TEST_NUM_CHARS_S 16
  12537. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  12538. do { \
  12539. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  12540. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  12541. } while (0)
  12542. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  12543. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  12544. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  12545. do { \
  12546. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  12547. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  12548. } while (0)
  12549. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  12550. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  12551. /**
  12552. * @brief target -> host packet log message
  12553. *
  12554. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  12555. *
  12556. * @details
  12557. * The following field definitions describe the format of the packet log
  12558. * message sent from the target to the host.
  12559. * The message consists of a 4-octet header,followed by a variable number
  12560. * of 32-bit character values.
  12561. *
  12562. * |31 16|15 12|11 10|9 8|7 0|
  12563. * |------------------------------------------------------------------|
  12564. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  12565. * |------------------------------------------------------------------|
  12566. * | payload |
  12567. * |------------------------------------------------------------------|
  12568. * - MSG_TYPE
  12569. * Bits 7:0
  12570. * Purpose: identifies this as a pktlog message
  12571. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  12572. * - mac_id
  12573. * Bits 9:8
  12574. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  12575. * Value: 0-3
  12576. * - pdev_id
  12577. * Bits 11:10
  12578. * Purpose: pdev_id
  12579. * Value: 0-3
  12580. * 0 (for rings at SOC level),
  12581. * 1/2/3 PDEV -> 0/1/2
  12582. * - payload_size
  12583. * Bits 31:16
  12584. * Purpose: explicitly specify the payload size
  12585. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  12586. */
  12587. PREPACK struct htt_pktlog_msg {
  12588. A_UINT32 header;
  12589. A_UINT32 payload[1/* or more */];
  12590. } POSTPACK;
  12591. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  12592. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  12593. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  12594. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  12595. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  12596. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  12597. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  12598. do { \
  12599. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  12600. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  12601. } while (0)
  12602. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  12603. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  12604. HTT_T2H_PKTLOG_MAC_ID_S)
  12605. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  12606. do { \
  12607. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  12608. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  12609. } while (0)
  12610. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  12611. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  12612. HTT_T2H_PKTLOG_PDEV_ID_S)
  12613. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  12614. do { \
  12615. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  12616. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  12617. } while (0)
  12618. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  12619. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  12620. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  12621. /*
  12622. * Rx reorder statistics
  12623. * NB: all the fields must be defined in 4 octets size.
  12624. */
  12625. struct rx_reorder_stats {
  12626. /* Non QoS MPDUs received */
  12627. A_UINT32 deliver_non_qos;
  12628. /* MPDUs received in-order */
  12629. A_UINT32 deliver_in_order;
  12630. /* Flush due to reorder timer expired */
  12631. A_UINT32 deliver_flush_timeout;
  12632. /* Flush due to move out of window */
  12633. A_UINT32 deliver_flush_oow;
  12634. /* Flush due to DELBA */
  12635. A_UINT32 deliver_flush_delba;
  12636. /* MPDUs dropped due to FCS error */
  12637. A_UINT32 fcs_error;
  12638. /* MPDUs dropped due to monitor mode non-data packet */
  12639. A_UINT32 mgmt_ctrl;
  12640. /* Unicast-data MPDUs dropped due to invalid peer */
  12641. A_UINT32 invalid_peer;
  12642. /* MPDUs dropped due to duplication (non aggregation) */
  12643. A_UINT32 dup_non_aggr;
  12644. /* MPDUs dropped due to processed before */
  12645. A_UINT32 dup_past;
  12646. /* MPDUs dropped due to duplicate in reorder queue */
  12647. A_UINT32 dup_in_reorder;
  12648. /* Reorder timeout happened */
  12649. A_UINT32 reorder_timeout;
  12650. /* invalid bar ssn */
  12651. A_UINT32 invalid_bar_ssn;
  12652. /* reorder reset due to bar ssn */
  12653. A_UINT32 ssn_reset;
  12654. /* Flush due to delete peer */
  12655. A_UINT32 deliver_flush_delpeer;
  12656. /* Flush due to offload*/
  12657. A_UINT32 deliver_flush_offload;
  12658. /* Flush due to out of buffer*/
  12659. A_UINT32 deliver_flush_oob;
  12660. /* MPDUs dropped due to PN check fail */
  12661. A_UINT32 pn_fail;
  12662. /* MPDUs dropped due to unable to allocate memory */
  12663. A_UINT32 store_fail;
  12664. /* Number of times the tid pool alloc succeeded */
  12665. A_UINT32 tid_pool_alloc_succ;
  12666. /* Number of times the MPDU pool alloc succeeded */
  12667. A_UINT32 mpdu_pool_alloc_succ;
  12668. /* Number of times the MSDU pool alloc succeeded */
  12669. A_UINT32 msdu_pool_alloc_succ;
  12670. /* Number of times the tid pool alloc failed */
  12671. A_UINT32 tid_pool_alloc_fail;
  12672. /* Number of times the MPDU pool alloc failed */
  12673. A_UINT32 mpdu_pool_alloc_fail;
  12674. /* Number of times the MSDU pool alloc failed */
  12675. A_UINT32 msdu_pool_alloc_fail;
  12676. /* Number of times the tid pool freed */
  12677. A_UINT32 tid_pool_free;
  12678. /* Number of times the MPDU pool freed */
  12679. A_UINT32 mpdu_pool_free;
  12680. /* Number of times the MSDU pool freed */
  12681. A_UINT32 msdu_pool_free;
  12682. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  12683. A_UINT32 msdu_queued;
  12684. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  12685. A_UINT32 msdu_recycled;
  12686. /* Number of MPDUs with invalid peer but A2 found in AST */
  12687. A_UINT32 invalid_peer_a2_in_ast;
  12688. /* Number of MPDUs with invalid peer but A3 found in AST */
  12689. A_UINT32 invalid_peer_a3_in_ast;
  12690. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  12691. A_UINT32 invalid_peer_bmc_mpdus;
  12692. /* Number of MSDUs with err attention word */
  12693. A_UINT32 rxdesc_err_att;
  12694. /* Number of MSDUs with flag of peer_idx_invalid */
  12695. A_UINT32 rxdesc_err_peer_idx_inv;
  12696. /* Number of MSDUs with flag of peer_idx_timeout */
  12697. A_UINT32 rxdesc_err_peer_idx_to;
  12698. /* Number of MSDUs with flag of overflow */
  12699. A_UINT32 rxdesc_err_ov;
  12700. /* Number of MSDUs with flag of msdu_length_err */
  12701. A_UINT32 rxdesc_err_msdu_len;
  12702. /* Number of MSDUs with flag of mpdu_length_err */
  12703. A_UINT32 rxdesc_err_mpdu_len;
  12704. /* Number of MSDUs with flag of tkip_mic_err */
  12705. A_UINT32 rxdesc_err_tkip_mic;
  12706. /* Number of MSDUs with flag of decrypt_err */
  12707. A_UINT32 rxdesc_err_decrypt;
  12708. /* Number of MSDUs with flag of fcs_err */
  12709. A_UINT32 rxdesc_err_fcs;
  12710. /* Number of Unicast (bc_mc bit is not set in attention word)
  12711. * frames with invalid peer handler
  12712. */
  12713. A_UINT32 rxdesc_uc_msdus_inv_peer;
  12714. /* Number of unicast frame directly (direct bit is set in attention word)
  12715. * to DUT with invalid peer handler
  12716. */
  12717. A_UINT32 rxdesc_direct_msdus_inv_peer;
  12718. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  12719. * frames with invalid peer handler
  12720. */
  12721. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  12722. /* Number of MSDUs dropped due to no first MSDU flag */
  12723. A_UINT32 rxdesc_no_1st_msdu;
  12724. /* Number of MSDUs droped due to ring overflow */
  12725. A_UINT32 msdu_drop_ring_ov;
  12726. /* Number of MSDUs dropped due to FC mismatch */
  12727. A_UINT32 msdu_drop_fc_mismatch;
  12728. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  12729. A_UINT32 msdu_drop_mgmt_remote_ring;
  12730. /* Number of MSDUs dropped due to errors not reported in attention word */
  12731. A_UINT32 msdu_drop_misc;
  12732. /* Number of MSDUs go to offload before reorder */
  12733. A_UINT32 offload_msdu_wal;
  12734. /* Number of data frame dropped by offload after reorder */
  12735. A_UINT32 offload_msdu_reorder;
  12736. /* Number of MPDUs with sequence number in the past and within the BA window */
  12737. A_UINT32 dup_past_within_window;
  12738. /* Number of MPDUs with sequence number in the past and outside the BA window */
  12739. A_UINT32 dup_past_outside_window;
  12740. /* Number of MSDUs with decrypt/MIC error */
  12741. A_UINT32 rxdesc_err_decrypt_mic;
  12742. /* Number of data MSDUs received on both local and remote rings */
  12743. A_UINT32 data_msdus_on_both_rings;
  12744. /* MPDUs never filled */
  12745. A_UINT32 holes_not_filled;
  12746. };
  12747. /*
  12748. * Rx Remote buffer statistics
  12749. * NB: all the fields must be defined in 4 octets size.
  12750. */
  12751. struct rx_remote_buffer_mgmt_stats {
  12752. /* Total number of MSDUs reaped for Rx processing */
  12753. A_UINT32 remote_reaped;
  12754. /* MSDUs recycled within firmware */
  12755. A_UINT32 remote_recycled;
  12756. /* MSDUs stored by Data Rx */
  12757. A_UINT32 data_rx_msdus_stored;
  12758. /* Number of HTT indications from WAL Rx MSDU */
  12759. A_UINT32 wal_rx_ind;
  12760. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  12761. A_UINT32 wal_rx_ind_unconsumed;
  12762. /* Number of HTT indications from Data Rx MSDU */
  12763. A_UINT32 data_rx_ind;
  12764. /* Number of unconsumed HTT indications from Data Rx MSDU */
  12765. A_UINT32 data_rx_ind_unconsumed;
  12766. /* Number of HTT indications from ATHBUF */
  12767. A_UINT32 athbuf_rx_ind;
  12768. /* Number of remote buffers requested for refill */
  12769. A_UINT32 refill_buf_req;
  12770. /* Number of remote buffers filled by the host */
  12771. A_UINT32 refill_buf_rsp;
  12772. /* Number of times MAC hw_index = f/w write_index */
  12773. A_INT32 mac_no_bufs;
  12774. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  12775. A_INT32 fw_indices_equal;
  12776. /* Number of times f/w finds no buffers to post */
  12777. A_INT32 host_no_bufs;
  12778. };
  12779. /*
  12780. * TXBF MU/SU packets and NDPA statistics
  12781. * NB: all the fields must be defined in 4 octets size.
  12782. */
  12783. struct rx_txbf_musu_ndpa_pkts_stats {
  12784. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  12785. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  12786. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  12787. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  12788. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  12789. A_UINT32 reserved[3]; /* must be set to 0x0 */
  12790. };
  12791. /*
  12792. * htt_dbg_stats_status -
  12793. * present - The requested stats have been delivered in full.
  12794. * This indicates that either the stats information was contained
  12795. * in its entirety within this message, or else this message
  12796. * completes the delivery of the requested stats info that was
  12797. * partially delivered through earlier STATS_CONF messages.
  12798. * partial - The requested stats have been delivered in part.
  12799. * One or more subsequent STATS_CONF messages with the same
  12800. * cookie value will be sent to deliver the remainder of the
  12801. * information.
  12802. * error - The requested stats could not be delivered, for example due
  12803. * to a shortage of memory to construct a message holding the
  12804. * requested stats.
  12805. * invalid - The requested stat type is either not recognized, or the
  12806. * target is configured to not gather the stats type in question.
  12807. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12808. * series_done - This special value indicates that no further stats info
  12809. * elements are present within a series of stats info elems
  12810. * (within a stats upload confirmation message).
  12811. */
  12812. enum htt_dbg_stats_status {
  12813. HTT_DBG_STATS_STATUS_PRESENT = 0,
  12814. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  12815. HTT_DBG_STATS_STATUS_ERROR = 2,
  12816. HTT_DBG_STATS_STATUS_INVALID = 3,
  12817. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  12818. };
  12819. /**
  12820. * @brief target -> host statistics upload
  12821. *
  12822. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  12823. *
  12824. * @details
  12825. * The following field definitions describe the format of the HTT target
  12826. * to host stats upload confirmation message.
  12827. * The message contains a cookie echoed from the HTT host->target stats
  12828. * upload request, which identifies which request the confirmation is
  12829. * for, and a series of tag-length-value stats information elements.
  12830. * The tag-length header for each stats info element also includes a
  12831. * status field, to indicate whether the request for the stat type in
  12832. * question was fully met, partially met, unable to be met, or invalid
  12833. * (if the stat type in question is disabled in the target).
  12834. * A special value of all 1's in this status field is used to indicate
  12835. * the end of the series of stats info elements.
  12836. *
  12837. *
  12838. * |31 16|15 8|7 5|4 0|
  12839. * |------------------------------------------------------------|
  12840. * | reserved | msg type |
  12841. * |------------------------------------------------------------|
  12842. * | cookie LSBs |
  12843. * |------------------------------------------------------------|
  12844. * | cookie MSBs |
  12845. * |------------------------------------------------------------|
  12846. * | stats entry length | reserved | S |stat type|
  12847. * |------------------------------------------------------------|
  12848. * | |
  12849. * | type-specific stats info |
  12850. * | |
  12851. * |------------------------------------------------------------|
  12852. * | stats entry length | reserved | S |stat type|
  12853. * |------------------------------------------------------------|
  12854. * | |
  12855. * | type-specific stats info |
  12856. * | |
  12857. * |------------------------------------------------------------|
  12858. * | n/a | reserved | 111 | n/a |
  12859. * |------------------------------------------------------------|
  12860. * Header fields:
  12861. * - MSG_TYPE
  12862. * Bits 7:0
  12863. * Purpose: identifies this is a statistics upload confirmation message
  12864. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  12865. * - COOKIE_LSBS
  12866. * Bits 31:0
  12867. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12868. * message with its preceding host->target stats request message.
  12869. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12870. * - COOKIE_MSBS
  12871. * Bits 31:0
  12872. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12873. * message with its preceding host->target stats request message.
  12874. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12875. *
  12876. * Stats Information Element tag-length header fields:
  12877. * - STAT_TYPE
  12878. * Bits 4:0
  12879. * Purpose: identifies the type of statistics info held in the
  12880. * following information element
  12881. * Value: htt_dbg_stats_type
  12882. * - STATUS
  12883. * Bits 7:5
  12884. * Purpose: indicate whether the requested stats are present
  12885. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  12886. * the completion of the stats entry series
  12887. * - LENGTH
  12888. * Bits 31:16
  12889. * Purpose: indicate the stats information size
  12890. * Value: This field specifies the number of bytes of stats information
  12891. * that follows the element tag-length header.
  12892. * It is expected but not required that this length is a multiple of
  12893. * 4 bytes. Even if the length is not an integer multiple of 4, the
  12894. * subsequent stats entry header will begin on a 4-byte aligned
  12895. * boundary.
  12896. */
  12897. #define HTT_T2H_STATS_COOKIE_SIZE 8
  12898. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  12899. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  12900. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  12901. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  12902. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  12903. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  12904. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  12905. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12906. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  12907. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  12908. do { \
  12909. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  12910. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  12911. } while (0)
  12912. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  12913. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  12914. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  12915. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  12916. do { \
  12917. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  12918. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  12919. } while (0)
  12920. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  12921. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  12922. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  12923. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12924. do { \
  12925. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  12926. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  12927. } while (0)
  12928. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  12929. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  12930. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  12931. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  12932. #define HTT_MAX_AGGR 64
  12933. #define HTT_HL_MAX_AGGR 18
  12934. /**
  12935. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  12936. *
  12937. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  12938. *
  12939. * @details
  12940. * The following field definitions describe the format of the HTT host
  12941. * to target frag_desc/msdu_ext bank configuration message.
  12942. * The message contains the based address and the min and max id of the
  12943. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  12944. * MSDU_EXT/FRAG_DESC.
  12945. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  12946. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  12947. * the hardware does the mapping/translation.
  12948. *
  12949. * Total banks that can be configured is configured to 16.
  12950. *
  12951. * This should be called before any TX has be initiated by the HTT
  12952. *
  12953. * |31 16|15 8|7 5|4 0|
  12954. * |------------------------------------------------------------|
  12955. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  12956. * |------------------------------------------------------------|
  12957. * | BANK0_BASE_ADDRESS (bits 31:0) |
  12958. #if HTT_PADDR64
  12959. * | BANK0_BASE_ADDRESS (bits 63:32) |
  12960. #endif
  12961. * |------------------------------------------------------------|
  12962. * | ... |
  12963. * |------------------------------------------------------------|
  12964. * | BANK15_BASE_ADDRESS (bits 31:0) |
  12965. #if HTT_PADDR64
  12966. * | BANK15_BASE_ADDRESS (bits 63:32) |
  12967. #endif
  12968. * |------------------------------------------------------------|
  12969. * | BANK0_MAX_ID | BANK0_MIN_ID |
  12970. * |------------------------------------------------------------|
  12971. * | ... |
  12972. * |------------------------------------------------------------|
  12973. * | BANK15_MAX_ID | BANK15_MIN_ID |
  12974. * |------------------------------------------------------------|
  12975. * Header fields:
  12976. * - MSG_TYPE
  12977. * Bits 7:0
  12978. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  12979. * for systems with 64-bit format for bus addresses:
  12980. * - BANKx_BASE_ADDRESS_LO
  12981. * Bits 31:0
  12982. * Purpose: Provide a mechanism to specify the base address of the
  12983. * MSDU_EXT bank physical/bus address.
  12984. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  12985. * - BANKx_BASE_ADDRESS_HI
  12986. * Bits 31:0
  12987. * Purpose: Provide a mechanism to specify the base address of the
  12988. * MSDU_EXT bank physical/bus address.
  12989. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  12990. * for systems with 32-bit format for bus addresses:
  12991. * - BANKx_BASE_ADDRESS
  12992. * Bits 31:0
  12993. * Purpose: Provide a mechanism to specify the base address of the
  12994. * MSDU_EXT bank physical/bus address.
  12995. * Value: MSDU_EXT bank physical / bus address
  12996. * - BANKx_MIN_ID
  12997. * Bits 15:0
  12998. * Purpose: Provide a mechanism to specify the min index that needs to
  12999. * mapped.
  13000. * - BANKx_MAX_ID
  13001. * Bits 31:16
  13002. * Purpose: Provide a mechanism to specify the max index that needs to
  13003. * mapped.
  13004. *
  13005. */
  13006. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13007. * safe value.
  13008. * @note MAX supported banks is 16.
  13009. */
  13010. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13011. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13012. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13013. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13014. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13015. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13016. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13017. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13018. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13019. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13020. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13021. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13022. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13023. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13024. do { \
  13025. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13026. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13027. } while (0)
  13028. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13029. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13030. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13031. do { \
  13032. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13033. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13034. } while (0)
  13035. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13036. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13037. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13038. do { \
  13039. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13040. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13041. } while (0)
  13042. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13043. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13044. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13045. do { \
  13046. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13047. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13048. } while (0)
  13049. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13050. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13051. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13052. do { \
  13053. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13054. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13055. } while (0)
  13056. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13057. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13058. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13059. do { \
  13060. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13061. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13062. } while (0)
  13063. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13064. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13065. /*
  13066. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13067. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13068. * addresses are stored in a XXX-bit field.
  13069. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13070. * htt_tx_frag_desc64_bank_cfg_t structs.
  13071. */
  13072. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13073. _paddr_bits_, \
  13074. _paddr__bank_base_address_) \
  13075. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13076. /** word 0 \
  13077. * msg_type: 8, \
  13078. * pdev_id: 2, \
  13079. * swap: 1, \
  13080. * reserved0: 5, \
  13081. * num_banks: 8, \
  13082. * desc_size: 8; \
  13083. */ \
  13084. A_UINT32 word0; \
  13085. /* \
  13086. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13087. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13088. * the second A_UINT32). \
  13089. */ \
  13090. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13091. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13092. } POSTPACK
  13093. /* define htt_tx_frag_desc32_bank_cfg_t */
  13094. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13095. /* define htt_tx_frag_desc64_bank_cfg_t */
  13096. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13097. /*
  13098. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13099. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13100. */
  13101. #if HTT_PADDR64
  13102. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13103. #else
  13104. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13105. #endif
  13106. /**
  13107. * @brief target -> host HTT TX Credit total count update message definition
  13108. *
  13109. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13110. *
  13111. *|31 16|15|14 9| 8 |7 0 |
  13112. *|---------------------+--+----------+-------+----------|
  13113. *|cur htt credit delta | Q| reserved | sign | msg type |
  13114. *|------------------------------------------------------|
  13115. *
  13116. * Header fields:
  13117. * - MSG_TYPE
  13118. * Bits 7:0
  13119. * Purpose: identifies this as a htt tx credit delta update message
  13120. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13121. * - SIGN
  13122. * Bits 8
  13123. * identifies whether credit delta is positive or negative
  13124. * Value:
  13125. * - 0x0: credit delta is positive, rebalance in some buffers
  13126. * - 0x1: credit delta is negative, rebalance out some buffers
  13127. * - reserved
  13128. * Bits 14:9
  13129. * Value: 0x0
  13130. * - TXQ_GRP
  13131. * Bit 15
  13132. * Purpose: indicates whether any tx queue group information elements
  13133. * are appended to the tx credit update message
  13134. * Value: 0 -> no tx queue group information element is present
  13135. * 1 -> a tx queue group information element immediately follows
  13136. * - DELTA_COUNT
  13137. * Bits 31:16
  13138. * Purpose: Specify current htt credit delta absolute count
  13139. */
  13140. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13141. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13142. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13143. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13144. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13145. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13146. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13147. do { \
  13148. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13149. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13150. } while (0)
  13151. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13152. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13153. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13154. do { \
  13155. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13156. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13157. } while (0)
  13158. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13159. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13160. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13161. do { \
  13162. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13163. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13164. } while (0)
  13165. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13166. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13167. #define HTT_TX_CREDIT_MSG_BYTES 4
  13168. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13169. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13170. /**
  13171. * @brief HTT WDI_IPA Operation Response Message
  13172. *
  13173. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13174. *
  13175. * @details
  13176. * HTT WDI_IPA Operation Response message is sent by target
  13177. * to host confirming suspend or resume operation.
  13178. * |31 24|23 16|15 8|7 0|
  13179. * |----------------+----------------+----------------+----------------|
  13180. * | op_code | Rsvd | msg_type |
  13181. * |-------------------------------------------------------------------|
  13182. * | Rsvd | Response len |
  13183. * |-------------------------------------------------------------------|
  13184. * | |
  13185. * | Response-type specific info |
  13186. * | |
  13187. * | |
  13188. * |-------------------------------------------------------------------|
  13189. * Header fields:
  13190. * - MSG_TYPE
  13191. * Bits 7:0
  13192. * Purpose: Identifies this as WDI_IPA Operation Response message
  13193. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13194. * - OP_CODE
  13195. * Bits 31:16
  13196. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13197. * value: = enum htt_wdi_ipa_op_code
  13198. * - RSP_LEN
  13199. * Bits 16:0
  13200. * Purpose: length for the response-type specific info
  13201. * value: = length in bytes for response-type specific info
  13202. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13203. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13204. */
  13205. PREPACK struct htt_wdi_ipa_op_response_t
  13206. {
  13207. /* DWORD 0: flags and meta-data */
  13208. A_UINT32
  13209. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13210. reserved1: 8,
  13211. op_code: 16;
  13212. A_UINT32
  13213. rsp_len: 16,
  13214. reserved2: 16;
  13215. } POSTPACK;
  13216. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13217. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13218. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13219. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13220. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13221. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13222. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13223. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13224. do { \
  13225. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13226. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13227. } while (0)
  13228. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13229. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13230. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13231. do { \
  13232. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13233. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13234. } while (0)
  13235. enum htt_phy_mode {
  13236. htt_phy_mode_11a = 0,
  13237. htt_phy_mode_11g = 1,
  13238. htt_phy_mode_11b = 2,
  13239. htt_phy_mode_11g_only = 3,
  13240. htt_phy_mode_11na_ht20 = 4,
  13241. htt_phy_mode_11ng_ht20 = 5,
  13242. htt_phy_mode_11na_ht40 = 6,
  13243. htt_phy_mode_11ng_ht40 = 7,
  13244. htt_phy_mode_11ac_vht20 = 8,
  13245. htt_phy_mode_11ac_vht40 = 9,
  13246. htt_phy_mode_11ac_vht80 = 10,
  13247. htt_phy_mode_11ac_vht20_2g = 11,
  13248. htt_phy_mode_11ac_vht40_2g = 12,
  13249. htt_phy_mode_11ac_vht80_2g = 13,
  13250. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13251. htt_phy_mode_11ac_vht160 = 15,
  13252. htt_phy_mode_max,
  13253. };
  13254. /**
  13255. * @brief target -> host HTT channel change indication
  13256. *
  13257. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13258. *
  13259. * @details
  13260. * Specify when a channel change occurs.
  13261. * This allows the host to precisely determine which rx frames arrived
  13262. * on the old channel and which rx frames arrived on the new channel.
  13263. *
  13264. *|31 |7 0 |
  13265. *|-------------------------------------------+----------|
  13266. *| reserved | msg type |
  13267. *|------------------------------------------------------|
  13268. *| primary_chan_center_freq_mhz |
  13269. *|------------------------------------------------------|
  13270. *| contiguous_chan1_center_freq_mhz |
  13271. *|------------------------------------------------------|
  13272. *| contiguous_chan2_center_freq_mhz |
  13273. *|------------------------------------------------------|
  13274. *| phy_mode |
  13275. *|------------------------------------------------------|
  13276. *
  13277. * Header fields:
  13278. * - MSG_TYPE
  13279. * Bits 7:0
  13280. * Purpose: identifies this as a htt channel change indication message
  13281. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13282. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13283. * Bits 31:0
  13284. * Purpose: identify the (center of the) new 20 MHz primary channel
  13285. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13286. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13287. * Bits 31:0
  13288. * Purpose: identify the (center of the) contiguous frequency range
  13289. * comprising the new channel.
  13290. * For example, if the new channel is a 80 MHz channel extending
  13291. * 60 MHz beyond the primary channel, this field would be 30 larger
  13292. * than the primary channel center frequency field.
  13293. * Value: center frequency of the contiguous frequency range comprising
  13294. * the full channel in MHz units
  13295. * (80+80 channels also use the CONTIG_CHAN2 field)
  13296. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13297. * Bits 31:0
  13298. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13299. * within a VHT 80+80 channel.
  13300. * This field is only relevant for VHT 80+80 channels.
  13301. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13302. * channel (arbitrary value for cases besides VHT 80+80)
  13303. * - PHY_MODE
  13304. * Bits 31:0
  13305. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13306. * and band
  13307. * Value: htt_phy_mode enum value
  13308. */
  13309. PREPACK struct htt_chan_change_t
  13310. {
  13311. /* DWORD 0: flags and meta-data */
  13312. A_UINT32
  13313. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13314. reserved1: 24;
  13315. A_UINT32 primary_chan_center_freq_mhz;
  13316. A_UINT32 contig_chan1_center_freq_mhz;
  13317. A_UINT32 contig_chan2_center_freq_mhz;
  13318. A_UINT32 phy_mode;
  13319. } POSTPACK;
  13320. /*
  13321. * Due to historical / backwards-compatibility reasons, maintain the
  13322. * below htt_chan_change_msg struct definition, which needs to be
  13323. * consistent with the above htt_chan_change_t struct definition
  13324. * (aside from the htt_chan_change_t definition including the msg_type
  13325. * dword within the message, and the htt_chan_change_msg only containing
  13326. * the payload of the message that follows the msg_type dword).
  13327. */
  13328. PREPACK struct htt_chan_change_msg {
  13329. A_UINT32 chan_mhz; /* frequency in mhz */
  13330. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13331. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13332. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13333. } POSTPACK;
  13334. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13335. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13336. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13337. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13338. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13339. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13340. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13341. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13342. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13343. do { \
  13344. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13345. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13346. } while (0)
  13347. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13348. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13349. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13350. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13351. do { \
  13352. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13353. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13354. } while (0)
  13355. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13356. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13357. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13358. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13359. do { \
  13360. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13361. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13362. } while (0)
  13363. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13364. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13365. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13366. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13367. do { \
  13368. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13369. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13370. } while (0)
  13371. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13372. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13373. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13374. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13375. /**
  13376. * @brief rx offload packet error message
  13377. *
  13378. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13379. *
  13380. * @details
  13381. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13382. * of target payload like mic err.
  13383. *
  13384. * |31 24|23 16|15 8|7 0|
  13385. * |----------------+----------------+----------------+----------------|
  13386. * | tid | vdev_id | msg_sub_type | msg_type |
  13387. * |-------------------------------------------------------------------|
  13388. * : (sub-type dependent content) :
  13389. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13390. * Header fields:
  13391. * - msg_type
  13392. * Bits 7:0
  13393. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13394. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13395. * - msg_sub_type
  13396. * Bits 15:8
  13397. * Purpose: Identifies which type of rx error is reported by this message
  13398. * value: htt_rx_ofld_pkt_err_type
  13399. * - vdev_id
  13400. * Bits 23:16
  13401. * Purpose: Identifies which vdev received the erroneous rx frame
  13402. * value:
  13403. * - tid
  13404. * Bits 31:24
  13405. * Purpose: Identifies the traffic type of the rx frame
  13406. * value:
  13407. *
  13408. * - The payload fields used if the sub-type == MIC error are shown below.
  13409. * Note - MIC err is per MSDU, while PN is per MPDU.
  13410. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13411. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13412. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13413. * instead of sending separate HTT messages for each wrong MSDU within
  13414. * the MPDU.
  13415. *
  13416. * |31 24|23 16|15 8|7 0|
  13417. * |----------------+----------------+----------------+----------------|
  13418. * | Rsvd | key_id | peer_id |
  13419. * |-------------------------------------------------------------------|
  13420. * | receiver MAC addr 31:0 |
  13421. * |-------------------------------------------------------------------|
  13422. * | Rsvd | receiver MAC addr 47:32 |
  13423. * |-------------------------------------------------------------------|
  13424. * | transmitter MAC addr 31:0 |
  13425. * |-------------------------------------------------------------------|
  13426. * | Rsvd | transmitter MAC addr 47:32 |
  13427. * |-------------------------------------------------------------------|
  13428. * | PN 31:0 |
  13429. * |-------------------------------------------------------------------|
  13430. * | Rsvd | PN 47:32 |
  13431. * |-------------------------------------------------------------------|
  13432. * - peer_id
  13433. * Bits 15:0
  13434. * Purpose: identifies which peer is frame is from
  13435. * value:
  13436. * - key_id
  13437. * Bits 23:16
  13438. * Purpose: identifies key_id of rx frame
  13439. * value:
  13440. * - RA_31_0 (receiver MAC addr 31:0)
  13441. * Bits 31:0
  13442. * Purpose: identifies by MAC address which vdev received the frame
  13443. * value: MAC address lower 4 bytes
  13444. * - RA_47_32 (receiver MAC addr 47:32)
  13445. * Bits 15:0
  13446. * Purpose: identifies by MAC address which vdev received the frame
  13447. * value: MAC address upper 2 bytes
  13448. * - TA_31_0 (transmitter MAC addr 31:0)
  13449. * Bits 31:0
  13450. * Purpose: identifies by MAC address which peer transmitted the frame
  13451. * value: MAC address lower 4 bytes
  13452. * - TA_47_32 (transmitter MAC addr 47:32)
  13453. * Bits 15:0
  13454. * Purpose: identifies by MAC address which peer transmitted the frame
  13455. * value: MAC address upper 2 bytes
  13456. * - PN_31_0
  13457. * Bits 31:0
  13458. * Purpose: Identifies pn of rx frame
  13459. * value: PN lower 4 bytes
  13460. * - PN_47_32
  13461. * Bits 15:0
  13462. * Purpose: Identifies pn of rx frame
  13463. * value:
  13464. * TKIP or CCMP: PN upper 2 bytes
  13465. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  13466. */
  13467. enum htt_rx_ofld_pkt_err_type {
  13468. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  13469. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  13470. };
  13471. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  13472. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  13473. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  13474. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  13475. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  13476. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  13477. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  13478. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  13479. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  13480. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  13481. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  13482. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  13483. do { \
  13484. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  13485. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  13486. } while (0)
  13487. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  13488. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  13489. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  13490. do { \
  13491. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  13492. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  13493. } while (0)
  13494. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  13495. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  13496. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  13497. do { \
  13498. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  13499. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  13500. } while (0)
  13501. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  13502. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  13503. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  13504. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  13505. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  13506. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  13507. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  13508. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  13509. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  13510. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  13511. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  13512. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  13513. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  13514. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  13515. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  13516. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  13517. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  13518. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  13519. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  13520. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  13521. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  13522. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  13523. do { \
  13524. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  13525. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  13526. } while (0)
  13527. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  13528. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  13529. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  13530. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  13531. do { \
  13532. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  13533. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  13534. } while (0)
  13535. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  13536. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  13537. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  13538. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  13539. do { \
  13540. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  13541. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  13542. } while (0)
  13543. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  13544. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  13545. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  13546. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  13547. do { \
  13548. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  13549. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  13550. } while (0)
  13551. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  13552. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  13553. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  13554. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  13555. do { \
  13556. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  13557. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  13558. } while (0)
  13559. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  13560. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  13561. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  13562. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  13563. do { \
  13564. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  13565. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  13566. } while (0)
  13567. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  13568. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  13569. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  13570. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  13571. do { \
  13572. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  13573. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  13574. } while (0)
  13575. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  13576. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  13577. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  13578. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  13579. do { \
  13580. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  13581. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  13582. } while (0)
  13583. /**
  13584. * @brief target -> host peer rate report message
  13585. *
  13586. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  13587. *
  13588. * @details
  13589. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  13590. * justified rate of all the peers.
  13591. *
  13592. * |31 24|23 16|15 8|7 0|
  13593. * |----------------+----------------+----------------+----------------|
  13594. * | peer_count | | msg_type |
  13595. * |-------------------------------------------------------------------|
  13596. * : Payload (variant number of peer rate report) :
  13597. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13598. * Header fields:
  13599. * - msg_type
  13600. * Bits 7:0
  13601. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  13602. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  13603. * - reserved
  13604. * Bits 15:8
  13605. * Purpose:
  13606. * value:
  13607. * - peer_count
  13608. * Bits 31:16
  13609. * Purpose: Specify how many peer rate report elements are present in the payload.
  13610. * value:
  13611. *
  13612. * Payload:
  13613. * There are variant number of peer rate report follow the first 32 bits.
  13614. * The peer rate report is defined as follows.
  13615. *
  13616. * |31 20|19 16|15 0|
  13617. * |-----------------------+---------+---------------------------------|-
  13618. * | reserved | phy | peer_id | \
  13619. * |-------------------------------------------------------------------| -> report #0
  13620. * | rate | /
  13621. * |-----------------------+---------+---------------------------------|-
  13622. * | reserved | phy | peer_id | \
  13623. * |-------------------------------------------------------------------| -> report #1
  13624. * | rate | /
  13625. * |-----------------------+---------+---------------------------------|-
  13626. * | reserved | phy | peer_id | \
  13627. * |-------------------------------------------------------------------| -> report #2
  13628. * | rate | /
  13629. * |-------------------------------------------------------------------|-
  13630. * : :
  13631. * : :
  13632. * : :
  13633. * :-------------------------------------------------------------------:
  13634. *
  13635. * - peer_id
  13636. * Bits 15:0
  13637. * Purpose: identify the peer
  13638. * value:
  13639. * - phy
  13640. * Bits 19:16
  13641. * Purpose: identify which phy is in use
  13642. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  13643. * Please see enum htt_peer_report_phy_type for detail.
  13644. * - reserved
  13645. * Bits 31:20
  13646. * Purpose:
  13647. * value:
  13648. * - rate
  13649. * Bits 31:0
  13650. * Purpose: represent the justified rate of the peer specified by peer_id
  13651. * value:
  13652. */
  13653. enum htt_peer_rate_report_phy_type {
  13654. HTT_PEER_RATE_REPORT_11B = 0,
  13655. HTT_PEER_RATE_REPORT_11A_G,
  13656. HTT_PEER_RATE_REPORT_11N,
  13657. HTT_PEER_RATE_REPORT_11AC,
  13658. };
  13659. #define HTT_PEER_RATE_REPORT_SIZE 8
  13660. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  13661. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  13662. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  13663. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  13664. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  13665. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  13666. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  13667. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  13668. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  13669. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  13670. do { \
  13671. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  13672. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  13673. } while (0)
  13674. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  13675. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  13676. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  13677. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  13678. do { \
  13679. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  13680. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  13681. } while (0)
  13682. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  13683. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  13684. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  13685. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  13686. do { \
  13687. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  13688. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  13689. } while (0)
  13690. /**
  13691. * @brief target -> host flow pool map message
  13692. *
  13693. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  13694. *
  13695. * @details
  13696. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  13697. * a flow of descriptors.
  13698. *
  13699. * This message is in TLV format and indicates the parameters to be setup a
  13700. * flow in the host. Each entry indicates that a particular flow ID is ready to
  13701. * receive descriptors from a specified pool.
  13702. *
  13703. * The message would appear as follows:
  13704. *
  13705. * |31 24|23 16|15 8|7 0|
  13706. * |----------------+----------------+----------------+----------------|
  13707. * header | reserved | num_flows | msg_type |
  13708. * |-------------------------------------------------------------------|
  13709. * | |
  13710. * : payload :
  13711. * | |
  13712. * |-------------------------------------------------------------------|
  13713. *
  13714. * The header field is one DWORD long and is interpreted as follows:
  13715. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  13716. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  13717. * this message
  13718. * b'16-31 - reserved: These bits are reserved for future use
  13719. *
  13720. * Payload:
  13721. * The payload would contain multiple objects of the following structure. Each
  13722. * object represents a flow.
  13723. *
  13724. * |31 24|23 16|15 8|7 0|
  13725. * |----------------+----------------+----------------+----------------|
  13726. * header | reserved | num_flows | msg_type |
  13727. * |-------------------------------------------------------------------|
  13728. * payload0| flow_type |
  13729. * |-------------------------------------------------------------------|
  13730. * | flow_id |
  13731. * |-------------------------------------------------------------------|
  13732. * | reserved0 | flow_pool_id |
  13733. * |-------------------------------------------------------------------|
  13734. * | reserved1 | flow_pool_size |
  13735. * |-------------------------------------------------------------------|
  13736. * | reserved2 |
  13737. * |-------------------------------------------------------------------|
  13738. * payload1| flow_type |
  13739. * |-------------------------------------------------------------------|
  13740. * | flow_id |
  13741. * |-------------------------------------------------------------------|
  13742. * | reserved0 | flow_pool_id |
  13743. * |-------------------------------------------------------------------|
  13744. * | reserved1 | flow_pool_size |
  13745. * |-------------------------------------------------------------------|
  13746. * | reserved2 |
  13747. * |-------------------------------------------------------------------|
  13748. * | . |
  13749. * | . |
  13750. * | . |
  13751. * |-------------------------------------------------------------------|
  13752. *
  13753. * Each payload is 5 DWORDS long and is interpreted as follows:
  13754. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  13755. * this flow is associated. It can be VDEV, peer,
  13756. * or tid (AC). Based on enum htt_flow_type.
  13757. *
  13758. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13759. * object. For flow_type vdev it is set to the
  13760. * vdevid, for peer it is peerid and for tid, it is
  13761. * tid_num.
  13762. *
  13763. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  13764. * in the host for this flow
  13765. * b'16:31 - reserved0: This field in reserved for the future. In case
  13766. * we have a hierarchical implementation (HCM) of
  13767. * pools, it can be used to indicate the ID of the
  13768. * parent-pool.
  13769. *
  13770. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  13771. * Descriptors for this flow will be
  13772. * allocated from this pool in the host.
  13773. * b'16:31 - reserved1: This field in reserved for the future. In case
  13774. * we have a hierarchical implementation of pools,
  13775. * it can be used to indicate the max number of
  13776. * descriptors in the pool. The b'0:15 can be used
  13777. * to indicate min number of descriptors in the
  13778. * HCM scheme.
  13779. *
  13780. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  13781. * we have a hierarchical implementation of pools,
  13782. * b'0:15 can be used to indicate the
  13783. * priority-based borrowing (PBB) threshold of
  13784. * the flow's pool. The b'16:31 are still left
  13785. * reserved.
  13786. */
  13787. enum htt_flow_type {
  13788. FLOW_TYPE_VDEV = 0,
  13789. /* Insert new flow types above this line */
  13790. };
  13791. PREPACK struct htt_flow_pool_map_payload_t {
  13792. A_UINT32 flow_type;
  13793. A_UINT32 flow_id;
  13794. A_UINT32 flow_pool_id:16,
  13795. reserved0:16;
  13796. A_UINT32 flow_pool_size:16,
  13797. reserved1:16;
  13798. A_UINT32 reserved2;
  13799. } POSTPACK;
  13800. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  13801. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  13802. (sizeof(struct htt_flow_pool_map_payload_t))
  13803. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  13804. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  13805. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  13806. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  13807. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  13808. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  13809. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  13810. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  13811. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  13812. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  13813. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  13814. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  13815. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  13816. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  13817. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  13818. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  13819. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  13820. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  13821. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  13822. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  13823. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  13824. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  13825. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  13826. do { \
  13827. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  13828. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  13829. } while (0)
  13830. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  13831. do { \
  13832. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  13833. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  13834. } while (0)
  13835. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  13836. do { \
  13837. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  13838. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  13839. } while (0)
  13840. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  13841. do { \
  13842. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  13843. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  13844. } while (0)
  13845. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  13846. do { \
  13847. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  13848. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  13849. } while (0)
  13850. /**
  13851. * @brief target -> host flow pool unmap message
  13852. *
  13853. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  13854. *
  13855. * @details
  13856. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  13857. * down a flow of descriptors.
  13858. * This message indicates that for the flow (whose ID is provided) is wanting
  13859. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  13860. * pool of descriptors from where descriptors are being allocated for this
  13861. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  13862. * be unmapped by the host.
  13863. *
  13864. * The message would appear as follows:
  13865. *
  13866. * |31 24|23 16|15 8|7 0|
  13867. * |----------------+----------------+----------------+----------------|
  13868. * | reserved0 | msg_type |
  13869. * |-------------------------------------------------------------------|
  13870. * | flow_type |
  13871. * |-------------------------------------------------------------------|
  13872. * | flow_id |
  13873. * |-------------------------------------------------------------------|
  13874. * | reserved1 | flow_pool_id |
  13875. * |-------------------------------------------------------------------|
  13876. *
  13877. * The message is interpreted as follows:
  13878. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  13879. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  13880. * b'8:31 - reserved0: Reserved for future use
  13881. *
  13882. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  13883. * this flow is associated. It can be VDEV, peer,
  13884. * or tid (AC). Based on enum htt_flow_type.
  13885. *
  13886. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13887. * object. For flow_type vdev it is set to the
  13888. * vdevid, for peer it is peerid and for tid, it is
  13889. * tid_num.
  13890. *
  13891. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  13892. * used in the host for this flow
  13893. * b'16:31 - reserved0: This field in reserved for the future.
  13894. *
  13895. */
  13896. PREPACK struct htt_flow_pool_unmap_t {
  13897. A_UINT32 msg_type:8,
  13898. reserved0:24;
  13899. A_UINT32 flow_type;
  13900. A_UINT32 flow_id;
  13901. A_UINT32 flow_pool_id:16,
  13902. reserved1:16;
  13903. } POSTPACK;
  13904. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  13905. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  13906. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  13907. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  13908. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  13909. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  13910. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  13911. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  13912. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  13913. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  13914. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  13915. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  13916. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  13917. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  13918. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  13919. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  13920. do { \
  13921. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  13922. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  13923. } while (0)
  13924. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  13925. do { \
  13926. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  13927. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  13928. } while (0)
  13929. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  13930. do { \
  13931. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  13932. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  13933. } while (0)
  13934. /**
  13935. * @brief target -> host SRING setup done message
  13936. *
  13937. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  13938. *
  13939. * @details
  13940. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  13941. * SRNG ring setup is done
  13942. *
  13943. * This message indicates whether the last setup operation is successful.
  13944. * It will be sent to host when host set respose_required bit in
  13945. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  13946. * The message would appear as follows:
  13947. *
  13948. * |31 24|23 16|15 8|7 0|
  13949. * |--------------- +----------------+----------------+----------------|
  13950. * | setup_status | ring_id | pdev_id | msg_type |
  13951. * |-------------------------------------------------------------------|
  13952. *
  13953. * The message is interpreted as follows:
  13954. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  13955. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  13956. * b'8:15 - pdev_id:
  13957. * 0 (for rings at SOC/UMAC level),
  13958. * 1/2/3 mac id (for rings at LMAC level)
  13959. * b'16:23 - ring_id: Identify the ring which is set up
  13960. * More details can be got from enum htt_srng_ring_id
  13961. * b'24:31 - setup_status: Indicate status of setup operation
  13962. * Refer to htt_ring_setup_status
  13963. */
  13964. PREPACK struct htt_sring_setup_done_t {
  13965. A_UINT32 msg_type: 8,
  13966. pdev_id: 8,
  13967. ring_id: 8,
  13968. setup_status: 8;
  13969. } POSTPACK;
  13970. enum htt_ring_setup_status {
  13971. htt_ring_setup_status_ok = 0,
  13972. htt_ring_setup_status_error,
  13973. };
  13974. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  13975. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  13976. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  13977. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  13978. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  13979. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  13980. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  13981. do { \
  13982. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  13983. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13984. } while (0)
  13985. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  13986. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  13987. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  13988. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  13989. HTT_SRING_SETUP_DONE_RING_ID_S)
  13990. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  13991. do { \
  13992. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  13993. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  13994. } while (0)
  13995. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  13996. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  13997. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  13998. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  13999. HTT_SRING_SETUP_DONE_STATUS_S)
  14000. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14001. do { \
  14002. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14003. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14004. } while (0)
  14005. /**
  14006. * @brief target -> flow map flow info
  14007. *
  14008. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14009. *
  14010. * @details
  14011. * HTT TX map flow entry with tqm flow pointer
  14012. * Sent from firmware to host to add tqm flow pointer in corresponding
  14013. * flow search entry. Flow metadata is replayed back to host as part of this
  14014. * struct to enable host to find the specific flow search entry
  14015. *
  14016. * The message would appear as follows:
  14017. *
  14018. * |31 28|27 18|17 14|13 8|7 0|
  14019. * |-------+------------------------------------------+----------------|
  14020. * | rsvd0 | fse_hsh_idx | msg_type |
  14021. * |-------------------------------------------------------------------|
  14022. * | rsvd1 | tid | peer_id |
  14023. * |-------------------------------------------------------------------|
  14024. * | tqm_flow_pntr_lo |
  14025. * |-------------------------------------------------------------------|
  14026. * | tqm_flow_pntr_hi |
  14027. * |-------------------------------------------------------------------|
  14028. * | fse_meta_data |
  14029. * |-------------------------------------------------------------------|
  14030. *
  14031. * The message is interpreted as follows:
  14032. *
  14033. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14034. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14035. *
  14036. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14037. * for this flow entry
  14038. *
  14039. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14040. *
  14041. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14042. *
  14043. * dword1 - b'14:17 - tid
  14044. *
  14045. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14046. *
  14047. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14048. *
  14049. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14050. *
  14051. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14052. * given by host
  14053. */
  14054. PREPACK struct htt_tx_map_flow_info {
  14055. A_UINT32
  14056. msg_type: 8,
  14057. fse_hsh_idx: 20,
  14058. rsvd0: 4;
  14059. A_UINT32
  14060. peer_id: 14,
  14061. tid: 4,
  14062. rsvd1: 14;
  14063. A_UINT32 tqm_flow_pntr_lo;
  14064. A_UINT32 tqm_flow_pntr_hi;
  14065. struct htt_tx_flow_metadata fse_meta_data;
  14066. } POSTPACK;
  14067. /* DWORD 0 */
  14068. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14069. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14070. /* DWORD 1 */
  14071. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14072. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14073. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14074. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14075. /* DWORD 0 */
  14076. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14077. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14078. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14079. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14080. do { \
  14081. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14082. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14083. } while (0)
  14084. /* DWORD 1 */
  14085. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14086. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14087. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14088. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14089. do { \
  14090. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14091. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14092. } while (0)
  14093. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14094. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14095. HTT_TX_MAP_FLOW_INFO_TID_S)
  14096. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14097. do { \
  14098. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14099. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14100. } while (0)
  14101. /*
  14102. * htt_dbg_ext_stats_status -
  14103. * present - The requested stats have been delivered in full.
  14104. * This indicates that either the stats information was contained
  14105. * in its entirety within this message, or else this message
  14106. * completes the delivery of the requested stats info that was
  14107. * partially delivered through earlier STATS_CONF messages.
  14108. * partial - The requested stats have been delivered in part.
  14109. * One or more subsequent STATS_CONF messages with the same
  14110. * cookie value will be sent to deliver the remainder of the
  14111. * information.
  14112. * error - The requested stats could not be delivered, for example due
  14113. * to a shortage of memory to construct a message holding the
  14114. * requested stats.
  14115. * invalid - The requested stat type is either not recognized, or the
  14116. * target is configured to not gather the stats type in question.
  14117. */
  14118. enum htt_dbg_ext_stats_status {
  14119. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14120. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14121. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14122. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14123. };
  14124. /**
  14125. * @brief target -> host ppdu stats upload
  14126. *
  14127. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14128. *
  14129. * @details
  14130. * The following field definitions describe the format of the HTT target
  14131. * to host ppdu stats indication message.
  14132. *
  14133. *
  14134. * |31 16|15 12|11 10|9 8|7 0 |
  14135. * |----------------------------------------------------------------------|
  14136. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14137. * |----------------------------------------------------------------------|
  14138. * | ppdu_id |
  14139. * |----------------------------------------------------------------------|
  14140. * | Timestamp in us |
  14141. * |----------------------------------------------------------------------|
  14142. * | reserved |
  14143. * |----------------------------------------------------------------------|
  14144. * | type-specific stats info |
  14145. * | (see htt_ppdu_stats.h) |
  14146. * |----------------------------------------------------------------------|
  14147. * Header fields:
  14148. * - MSG_TYPE
  14149. * Bits 7:0
  14150. * Purpose: Identifies this is a PPDU STATS indication
  14151. * message.
  14152. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14153. * - mac_id
  14154. * Bits 9:8
  14155. * Purpose: mac_id of this ppdu_id
  14156. * Value: 0-3
  14157. * - pdev_id
  14158. * Bits 11:10
  14159. * Purpose: pdev_id of this ppdu_id
  14160. * Value: 0-3
  14161. * 0 (for rings at SOC level),
  14162. * 1/2/3 PDEV -> 0/1/2
  14163. * - payload_size
  14164. * Bits 31:16
  14165. * Purpose: total tlv size
  14166. * Value: payload_size in bytes
  14167. */
  14168. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14169. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14170. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14171. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14172. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14173. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14174. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14175. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14176. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14177. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14178. do { \
  14179. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14180. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14181. } while (0)
  14182. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14183. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14184. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14185. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14186. do { \
  14187. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14188. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14189. } while (0)
  14190. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14191. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14192. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14193. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14194. do { \
  14195. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14196. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14197. } while (0)
  14198. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14199. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14200. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14201. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14202. do { \
  14203. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14204. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14205. } while (0)
  14206. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14207. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14208. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14209. /* htt_t2h_ppdu_stats_ind_hdr_t
  14210. * This struct contains the fields within the header of the
  14211. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14212. * stats info.
  14213. * This struct assumes little-endian layout, and thus is only
  14214. * suitable for use within processors known to be little-endian
  14215. * (such as the target).
  14216. * In contrast, the above macros provide endian-portable methods
  14217. * to get and set the bitfields within this PPDU_STATS_IND header.
  14218. */
  14219. typedef struct {
  14220. A_UINT32 msg_type: 8, /* bits 7:0 */
  14221. mac_id: 2, /* bits 9:8 */
  14222. pdev_id: 2, /* bits 11:10 */
  14223. reserved1: 4, /* bits 15:12 */
  14224. payload_size: 16; /* bits 31:16 */
  14225. A_UINT32 ppdu_id;
  14226. A_UINT32 timestamp_us;
  14227. A_UINT32 reserved2;
  14228. } htt_t2h_ppdu_stats_ind_hdr_t;
  14229. /**
  14230. * @brief target -> host extended statistics upload
  14231. *
  14232. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14233. *
  14234. * @details
  14235. * The following field definitions describe the format of the HTT target
  14236. * to host stats upload confirmation message.
  14237. * The message contains a cookie echoed from the HTT host->target stats
  14238. * upload request, which identifies which request the confirmation is
  14239. * for, and a single stats can span over multiple HTT stats indication
  14240. * due to the HTT message size limitation so every HTT ext stats indication
  14241. * will have tag-length-value stats information elements.
  14242. * The tag-length header for each HTT stats IND message also includes a
  14243. * status field, to indicate whether the request for the stat type in
  14244. * question was fully met, partially met, unable to be met, or invalid
  14245. * (if the stat type in question is disabled in the target).
  14246. * A Done bit 1's indicate the end of the of stats info elements.
  14247. *
  14248. *
  14249. * |31 16|15 12|11|10 8|7 5|4 0|
  14250. * |--------------------------------------------------------------|
  14251. * | reserved | msg type |
  14252. * |--------------------------------------------------------------|
  14253. * | cookie LSBs |
  14254. * |--------------------------------------------------------------|
  14255. * | cookie MSBs |
  14256. * |--------------------------------------------------------------|
  14257. * | stats entry length | rsvd | D| S | stat type |
  14258. * |--------------------------------------------------------------|
  14259. * | type-specific stats info |
  14260. * | (see htt_stats.h) |
  14261. * |--------------------------------------------------------------|
  14262. * Header fields:
  14263. * - MSG_TYPE
  14264. * Bits 7:0
  14265. * Purpose: Identifies this is a extended statistics upload confirmation
  14266. * message.
  14267. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14268. * - COOKIE_LSBS
  14269. * Bits 31:0
  14270. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14271. * message with its preceding host->target stats request message.
  14272. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14273. * - COOKIE_MSBS
  14274. * Bits 31:0
  14275. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14276. * message with its preceding host->target stats request message.
  14277. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14278. *
  14279. * Stats Information Element tag-length header fields:
  14280. * - STAT_TYPE
  14281. * Bits 7:0
  14282. * Purpose: identifies the type of statistics info held in the
  14283. * following information element
  14284. * Value: htt_dbg_ext_stats_type
  14285. * - STATUS
  14286. * Bits 10:8
  14287. * Purpose: indicate whether the requested stats are present
  14288. * Value: htt_dbg_ext_stats_status
  14289. * - DONE
  14290. * Bits 11
  14291. * Purpose:
  14292. * Indicates the completion of the stats entry, this will be the last
  14293. * stats conf HTT segment for the requested stats type.
  14294. * Value:
  14295. * 0 -> the stats retrieval is ongoing
  14296. * 1 -> the stats retrieval is complete
  14297. * - LENGTH
  14298. * Bits 31:16
  14299. * Purpose: indicate the stats information size
  14300. * Value: This field specifies the number of bytes of stats information
  14301. * that follows the element tag-length header.
  14302. * It is expected but not required that this length is a multiple of
  14303. * 4 bytes.
  14304. */
  14305. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14306. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14307. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14308. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14309. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14310. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14311. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14312. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14313. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14314. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14315. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14316. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14317. do { \
  14318. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14319. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14320. } while (0)
  14321. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14322. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14323. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14324. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14325. do { \
  14326. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14327. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14328. } while (0)
  14329. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14330. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14331. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14332. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14333. do { \
  14334. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14335. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14336. } while (0)
  14337. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14338. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14339. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14340. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14341. do { \
  14342. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14343. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14344. } while (0)
  14345. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14346. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14347. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14348. typedef enum {
  14349. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14350. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14351. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14352. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14353. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14354. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14355. /* Reserved from 128 - 255 for target internal use.*/
  14356. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14357. } HTT_PEER_TYPE;
  14358. /** macro to convert MAC address from char array to HTT word format */
  14359. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14360. (phtt_mac_addr)->mac_addr31to0 = \
  14361. (((c_macaddr)[0] << 0) | \
  14362. ((c_macaddr)[1] << 8) | \
  14363. ((c_macaddr)[2] << 16) | \
  14364. ((c_macaddr)[3] << 24)); \
  14365. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14366. } while (0)
  14367. /**
  14368. * @brief target -> host monitor mac header indication message
  14369. *
  14370. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14371. *
  14372. * @details
  14373. * The following diagram shows the format of the monitor mac header message
  14374. * sent from the target to the host.
  14375. * This message is primarily sent when promiscuous rx mode is enabled.
  14376. * One message is sent per rx PPDU.
  14377. *
  14378. * |31 24|23 16|15 8|7 0|
  14379. * |-------------------------------------------------------------|
  14380. * | peer_id | reserved0 | msg_type |
  14381. * |-------------------------------------------------------------|
  14382. * | reserved1 | num_mpdu |
  14383. * |-------------------------------------------------------------|
  14384. * | struct hw_rx_desc |
  14385. * | (see wal_rx_desc.h) |
  14386. * |-------------------------------------------------------------|
  14387. * | struct ieee80211_frame_addr4 |
  14388. * | (see ieee80211_defs.h) |
  14389. * |-------------------------------------------------------------|
  14390. * | struct ieee80211_frame_addr4 |
  14391. * | (see ieee80211_defs.h) |
  14392. * |-------------------------------------------------------------|
  14393. * | ...... |
  14394. * |-------------------------------------------------------------|
  14395. *
  14396. * Header fields:
  14397. * - msg_type
  14398. * Bits 7:0
  14399. * Purpose: Identifies this is a monitor mac header indication message.
  14400. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14401. * - peer_id
  14402. * Bits 31:16
  14403. * Purpose: Software peer id given by host during association,
  14404. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14405. * for rx PPDUs received from unassociated peers.
  14406. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14407. * - num_mpdu
  14408. * Bits 15:0
  14409. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14410. * delivered within the message.
  14411. * Value: 1 to 32
  14412. * num_mpdu is limited to a maximum value of 32, due to buffer
  14413. * size limits. For PPDUs with more than 32 MPDUs, only the
  14414. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14415. * the PPDU will be provided.
  14416. */
  14417. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  14418. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  14419. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  14420. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  14421. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  14422. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  14423. do { \
  14424. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  14425. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  14426. } while (0)
  14427. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  14428. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  14429. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  14430. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  14431. do { \
  14432. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  14433. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  14434. } while (0)
  14435. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  14436. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  14437. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  14438. /**
  14439. * @brief target -> host flow pool resize Message
  14440. *
  14441. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  14442. *
  14443. * @details
  14444. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  14445. * the flow pool associated with the specified ID is resized
  14446. *
  14447. * The message would appear as follows:
  14448. *
  14449. * |31 16|15 8|7 0|
  14450. * |---------------------------------+----------------+----------------|
  14451. * | reserved0 | Msg type |
  14452. * |-------------------------------------------------------------------|
  14453. * | flow pool new size | flow pool ID |
  14454. * |-------------------------------------------------------------------|
  14455. *
  14456. * The message is interpreted as follows:
  14457. * b'0:7 - msg_type: This will be set to 0x21
  14458. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  14459. *
  14460. * b'0:15 - flow pool ID: Existing flow pool ID
  14461. *
  14462. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  14463. *
  14464. */
  14465. PREPACK struct htt_flow_pool_resize_t {
  14466. A_UINT32 msg_type:8,
  14467. reserved0:24;
  14468. A_UINT32 flow_pool_id:16,
  14469. flow_pool_new_size:16;
  14470. } POSTPACK;
  14471. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  14472. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  14473. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  14474. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  14475. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  14476. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  14477. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  14478. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  14479. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  14480. do { \
  14481. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  14482. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  14483. } while (0)
  14484. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  14485. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  14486. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  14487. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  14488. do { \
  14489. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  14490. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  14491. } while (0)
  14492. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  14493. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  14494. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  14495. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  14496. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  14497. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  14498. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  14499. /*
  14500. * The read and write indices point to the data within the host buffer.
  14501. * Because the first 4 bytes of the host buffer is used for the read index and
  14502. * the next 4 bytes for the write index, the data itself starts at offset 8.
  14503. * The read index and write index are the byte offsets from the base of the
  14504. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  14505. * Refer the ASCII text picture below.
  14506. */
  14507. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  14508. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  14509. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  14510. /*
  14511. ***************************************************************************
  14512. *
  14513. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14514. *
  14515. ***************************************************************************
  14516. *
  14517. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  14518. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  14519. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  14520. * written into the Host memory region mentioned below.
  14521. *
  14522. * Read index is updated by the Host. At any point of time, the read index will
  14523. * indicate the index that will next be read by the Host. The read index is
  14524. * in units of bytes offset from the base of the meta-data buffer.
  14525. *
  14526. * Write index is updated by the FW. At any point of time, the write index will
  14527. * indicate from where the FW can start writing any new data. The write index is
  14528. * in units of bytes offset from the base of the meta-data buffer.
  14529. *
  14530. * If the Host is not fast enough in reading the CFR data, any new capture data
  14531. * would be dropped if there is no space left to write the new captures.
  14532. *
  14533. * The last 4 bytes of the memory region will have the magic pattern
  14534. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  14535. * not overrun the host buffer.
  14536. *
  14537. * ,--------------------. read and write indices store the
  14538. * | | byte offset from the base of the
  14539. * | ,--------+--------. meta-data buffer to the next
  14540. * | | | | location within the data buffer
  14541. * | | v v that will be read / written
  14542. * ************************************************************************
  14543. * * Read * Write * * Magic *
  14544. * * index * index * CFR data1 ...... CFR data N * pattern *
  14545. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  14546. * ************************************************************************
  14547. * |<---------- data buffer ---------->|
  14548. *
  14549. * |<----------------- meta-data buffer allocated in Host ----------------|
  14550. *
  14551. * Note:
  14552. * - Considering the 4 bytes needed to store the Read index (R) and the
  14553. * Write index (W), the initial value is as follows:
  14554. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  14555. * - Buffer empty condition:
  14556. * R = W
  14557. *
  14558. * Regarding CFR data format:
  14559. * --------------------------
  14560. *
  14561. * Each CFR tone is stored in HW as 16-bits with the following format:
  14562. * {bits[15:12], bits[11:6], bits[5:0]} =
  14563. * {unsigned exponent (4 bits),
  14564. * signed mantissa_real (6 bits),
  14565. * signed mantissa_imag (6 bits)}
  14566. *
  14567. * CFR_real = mantissa_real * 2^(exponent-5)
  14568. * CFR_imag = mantissa_imag * 2^(exponent-5)
  14569. *
  14570. *
  14571. * The CFR data is written to the 16-bit unsigned output array (buff) in
  14572. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  14573. *
  14574. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  14575. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  14576. * .
  14577. * .
  14578. * .
  14579. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  14580. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  14581. */
  14582. /* Bandwidth of peer CFR captures */
  14583. typedef enum {
  14584. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  14585. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  14586. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  14587. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  14588. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  14589. HTT_PEER_CFR_CAPTURE_BW_MAX,
  14590. } HTT_PEER_CFR_CAPTURE_BW;
  14591. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  14592. * was captured
  14593. */
  14594. typedef enum {
  14595. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  14596. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  14597. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  14598. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  14599. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  14600. } HTT_PEER_CFR_CAPTURE_MODE;
  14601. typedef enum {
  14602. /* This message type is currently used for the below purpose:
  14603. *
  14604. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  14605. * wmi_peer_cfr_capture_cmd.
  14606. * If payload_present bit is set to 0 then the associated memory region
  14607. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  14608. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  14609. * message; the CFR dump will be present at the end of the message,
  14610. * after the chan_phy_mode.
  14611. */
  14612. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  14613. /* Always keep this last */
  14614. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  14615. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  14616. /**
  14617. * @brief target -> host CFR dump completion indication message definition
  14618. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  14619. *
  14620. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  14621. *
  14622. * @details
  14623. * The following diagram shows the format of the Channel Frequency Response
  14624. * (CFR) dump completion indication. This inidcation is sent to the Host when
  14625. * the channel capture of a peer is copied by Firmware into the Host memory
  14626. *
  14627. * **************************************************************************
  14628. *
  14629. * Message format when the CFR capture message type is
  14630. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14631. *
  14632. * **************************************************************************
  14633. *
  14634. * |31 16|15 |8|7 0|
  14635. * |----------------------------------------------------------------|
  14636. * header: | reserved |P| msg_type |
  14637. * word 0 | | | |
  14638. * |----------------------------------------------------------------|
  14639. * payload: | cfr_capture_msg_type |
  14640. * word 1 | |
  14641. * |----------------------------------------------------------------|
  14642. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  14643. * word 2 | | | | | | | | |
  14644. * |----------------------------------------------------------------|
  14645. * | mac_addr31to0 |
  14646. * word 3 | |
  14647. * |----------------------------------------------------------------|
  14648. * | unused / reserved | mac_addr47to32 |
  14649. * word 4 | | |
  14650. * |----------------------------------------------------------------|
  14651. * | index |
  14652. * word 5 | |
  14653. * |----------------------------------------------------------------|
  14654. * | length |
  14655. * word 6 | |
  14656. * |----------------------------------------------------------------|
  14657. * | timestamp |
  14658. * word 7 | |
  14659. * |----------------------------------------------------------------|
  14660. * | counter |
  14661. * word 8 | |
  14662. * |----------------------------------------------------------------|
  14663. * | chan_mhz |
  14664. * word 9 | |
  14665. * |----------------------------------------------------------------|
  14666. * | band_center_freq1 |
  14667. * word 10 | |
  14668. * |----------------------------------------------------------------|
  14669. * | band_center_freq2 |
  14670. * word 11 | |
  14671. * |----------------------------------------------------------------|
  14672. * | chan_phy_mode |
  14673. * word 12 | |
  14674. * |----------------------------------------------------------------|
  14675. * where,
  14676. * P - payload present bit (payload_present explained below)
  14677. * req_id - memory request id (mem_req_id explained below)
  14678. * S - status field (status explained below)
  14679. * capbw - capture bandwidth (capture_bw explained below)
  14680. * mode - mode of capture (mode explained below)
  14681. * sts - space time streams (sts_count explained below)
  14682. * chbw - channel bandwidth (channel_bw explained below)
  14683. * captype - capture type (cap_type explained below)
  14684. *
  14685. * The following field definitions describe the format of the CFR dump
  14686. * completion indication sent from the target to the host
  14687. *
  14688. * Header fields:
  14689. *
  14690. * Word 0
  14691. * - msg_type
  14692. * Bits 7:0
  14693. * Purpose: Identifies this as CFR TX completion indication
  14694. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  14695. * - payload_present
  14696. * Bit 8
  14697. * Purpose: Identifies how CFR data is sent to host
  14698. * Value: 0 - If CFR Payload is written to host memory
  14699. * 1 - If CFR Payload is sent as part of HTT message
  14700. * (This is the requirement for SDIO/USB where it is
  14701. * not possible to write CFR data to host memory)
  14702. * - reserved
  14703. * Bits 31:9
  14704. * Purpose: Reserved
  14705. * Value: 0
  14706. *
  14707. * Payload fields:
  14708. *
  14709. * Word 1
  14710. * - cfr_capture_msg_type
  14711. * Bits 31:0
  14712. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  14713. * to specify the format used for the remainder of the message
  14714. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14715. * (currently only MSG_TYPE_1 is defined)
  14716. *
  14717. * Word 2
  14718. * - mem_req_id
  14719. * Bits 6:0
  14720. * Purpose: Contain the mem request id of the region where the CFR capture
  14721. * has been stored - of type WMI_HOST_MEM_REQ_ID
  14722. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  14723. this value is invalid)
  14724. * - status
  14725. * Bit 7
  14726. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  14727. * Value: 1 (True) - Successful; 0 (False) - Not successful
  14728. * - capture_bw
  14729. * Bits 10:8
  14730. * Purpose: Carry the bandwidth of the CFR capture
  14731. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  14732. * - mode
  14733. * Bits 13:11
  14734. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  14735. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  14736. * - sts_count
  14737. * Bits 16:14
  14738. * Purpose: Carry the number of space time streams
  14739. * Value: Number of space time streams
  14740. * - channel_bw
  14741. * Bits 19:17
  14742. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  14743. * measurement
  14744. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  14745. * - cap_type
  14746. * Bits 23:20
  14747. * Purpose: Carry the type of the capture
  14748. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  14749. * - vdev_id
  14750. * Bits 31:24
  14751. * Purpose: Carry the virtual device id
  14752. * Value: vdev ID
  14753. *
  14754. * Word 3
  14755. * - mac_addr31to0
  14756. * Bits 31:0
  14757. * Purpose: Contain the bits 31:0 of the peer MAC address
  14758. * Value: Bits 31:0 of the peer MAC address
  14759. *
  14760. * Word 4
  14761. * - mac_addr47to32
  14762. * Bits 15:0
  14763. * Purpose: Contain the bits 47:32 of the peer MAC address
  14764. * Value: Bits 47:32 of the peer MAC address
  14765. *
  14766. * Word 5
  14767. * - index
  14768. * Bits 31:0
  14769. * Purpose: Contain the index at which this CFR dump was written in the Host
  14770. * allocated memory. This index is the number of bytes from the base address.
  14771. * Value: Index position
  14772. *
  14773. * Word 6
  14774. * - length
  14775. * Bits 31:0
  14776. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  14777. * Value: Length of the CFR capture of the peer
  14778. *
  14779. * Word 7
  14780. * - timestamp
  14781. * Bits 31:0
  14782. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  14783. * clock used for this timestamp is private to the target and not visible to
  14784. * the host i.e., Host can interpret only the relative timestamp deltas from
  14785. * one message to the next, but can't interpret the absolute timestamp from a
  14786. * single message.
  14787. * Value: Timestamp in microseconds
  14788. *
  14789. * Word 8
  14790. * - counter
  14791. * Bits 31:0
  14792. * Purpose: Carry the count of the current CFR capture from FW. This is
  14793. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  14794. * in host memory)
  14795. * Value: Count of the current CFR capture
  14796. *
  14797. * Word 9
  14798. * - chan_mhz
  14799. * Bits 31:0
  14800. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  14801. * Value: Primary 20 channel frequency
  14802. *
  14803. * Word 10
  14804. * - band_center_freq1
  14805. * Bits 31:0
  14806. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  14807. * Value: Center frequency 1 in MHz
  14808. *
  14809. * Word 11
  14810. * - band_center_freq2
  14811. * Bits 31:0
  14812. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  14813. * the VDEV
  14814. * 80plus80 mode
  14815. * Value: Center frequency 2 in MHz
  14816. *
  14817. * Word 12
  14818. * - chan_phy_mode
  14819. * Bits 31:0
  14820. * Purpose: Carry the phy mode of the channel, of the VDEV
  14821. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  14822. */
  14823. PREPACK struct htt_cfr_dump_ind_type_1 {
  14824. A_UINT32 mem_req_id:7,
  14825. status:1,
  14826. capture_bw:3,
  14827. mode:3,
  14828. sts_count:3,
  14829. channel_bw:3,
  14830. cap_type:4,
  14831. vdev_id:8;
  14832. htt_mac_addr addr;
  14833. A_UINT32 index;
  14834. A_UINT32 length;
  14835. A_UINT32 timestamp;
  14836. A_UINT32 counter;
  14837. struct htt_chan_change_msg chan;
  14838. } POSTPACK;
  14839. PREPACK struct htt_cfr_dump_compl_ind {
  14840. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  14841. union {
  14842. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  14843. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  14844. /* If there is a need to change the memory layout and its associated
  14845. * HTT indication format, a new CFR capture message type can be
  14846. * introduced and added into this union.
  14847. */
  14848. };
  14849. } POSTPACK;
  14850. /*
  14851. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  14852. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14853. */
  14854. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  14855. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  14856. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  14857. do { \
  14858. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  14859. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  14860. } while(0)
  14861. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  14862. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  14863. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  14864. /*
  14865. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  14866. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14867. */
  14868. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  14869. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  14870. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  14871. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  14872. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  14873. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  14874. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  14875. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  14876. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  14877. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  14878. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  14879. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  14880. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  14881. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  14882. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  14883. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  14884. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  14885. do { \
  14886. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  14887. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  14888. } while (0)
  14889. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  14890. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  14891. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  14892. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  14893. do { \
  14894. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  14895. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  14896. } while (0)
  14897. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  14898. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  14899. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  14900. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  14901. do { \
  14902. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  14903. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  14904. } while (0)
  14905. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  14906. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  14907. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  14908. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  14909. do { \
  14910. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  14911. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  14912. } while (0)
  14913. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  14914. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  14915. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  14916. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  14917. do { \
  14918. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  14919. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  14920. } while (0)
  14921. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  14922. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  14923. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  14924. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  14925. do { \
  14926. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  14927. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  14928. } while (0)
  14929. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  14930. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  14931. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  14932. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  14933. do { \
  14934. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  14935. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  14936. } while (0)
  14937. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  14938. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  14939. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  14940. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  14941. do { \
  14942. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  14943. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  14944. } while (0)
  14945. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  14946. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  14947. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  14948. /**
  14949. * @brief target -> host peer (PPDU) stats message
  14950. *
  14951. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  14952. *
  14953. * @details
  14954. * This message is generated by FW when FW is sending stats to host
  14955. * about one or more PPDUs that the FW has transmitted to one or more peers.
  14956. * This message is sent autonomously by the target rather than upon request
  14957. * by the host.
  14958. * The following field definitions describe the format of the HTT target
  14959. * to host peer stats indication message.
  14960. *
  14961. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  14962. * or more PPDU stats records.
  14963. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  14964. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  14965. * then the message would start with the
  14966. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  14967. * below.
  14968. *
  14969. * |31 16|15|14|13 11|10 9|8|7 0|
  14970. * |-------------------------------------------------------------|
  14971. * | reserved |MSG_TYPE |
  14972. * |-------------------------------------------------------------|
  14973. * rec 0 | TLV header |
  14974. * rec 0 |-------------------------------------------------------------|
  14975. * rec 0 | ppdu successful bytes |
  14976. * rec 0 |-------------------------------------------------------------|
  14977. * rec 0 | ppdu retry bytes |
  14978. * rec 0 |-------------------------------------------------------------|
  14979. * rec 0 | ppdu failed bytes |
  14980. * rec 0 |-------------------------------------------------------------|
  14981. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  14982. * rec 0 |-------------------------------------------------------------|
  14983. * rec 0 | retried MSDUs | successful MSDUs |
  14984. * rec 0 |-------------------------------------------------------------|
  14985. * rec 0 | TX duration | failed MSDUs |
  14986. * rec 0 |-------------------------------------------------------------|
  14987. * ...
  14988. * |-------------------------------------------------------------|
  14989. * rec N | TLV header |
  14990. * rec N |-------------------------------------------------------------|
  14991. * rec N | ppdu successful bytes |
  14992. * rec N |-------------------------------------------------------------|
  14993. * rec N | ppdu retry bytes |
  14994. * rec N |-------------------------------------------------------------|
  14995. * rec N | ppdu failed bytes |
  14996. * rec N |-------------------------------------------------------------|
  14997. * rec N | peer id | S|SG| BW | BA |A|rate code|
  14998. * rec N |-------------------------------------------------------------|
  14999. * rec N | retried MSDUs | successful MSDUs |
  15000. * rec N |-------------------------------------------------------------|
  15001. * rec N | TX duration | failed MSDUs |
  15002. * rec N |-------------------------------------------------------------|
  15003. *
  15004. * where:
  15005. * A = is A-MPDU flag
  15006. * BA = block-ack failure flags
  15007. * BW = bandwidth spec
  15008. * SG = SGI enabled spec
  15009. * S = skipped rate ctrl
  15010. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15011. *
  15012. * Header
  15013. * ------
  15014. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15015. * dword0 - b'8:31 - reserved : Reserved for future use
  15016. *
  15017. * payload include below peer_stats information
  15018. * --------------------------------------------
  15019. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15020. * @tx_success_bytes : total successful bytes in the PPDU.
  15021. * @tx_retry_bytes : total retried bytes in the PPDU.
  15022. * @tx_failed_bytes : total failed bytes in the PPDU.
  15023. * @tx_ratecode : rate code used for the PPDU.
  15024. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15025. * @ba_ack_failed : BA/ACK failed for this PPDU
  15026. * b00 -> BA received
  15027. * b01 -> BA failed once
  15028. * b10 -> BA failed twice, when HW retry is enabled.
  15029. * @bw : BW
  15030. * b00 -> 20 MHz
  15031. * b01 -> 40 MHz
  15032. * b10 -> 80 MHz
  15033. * b11 -> 160 MHz (or 80+80)
  15034. * @sg : SGI enabled
  15035. * @s : skipped ratectrl
  15036. * @peer_id : peer id
  15037. * @tx_success_msdus : successful MSDUs
  15038. * @tx_retry_msdus : retried MSDUs
  15039. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15040. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15041. */
  15042. /**
  15043. * @brief target -> host backpressure event
  15044. *
  15045. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15046. *
  15047. * @details
  15048. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15049. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15050. * This message will only be sent if the backpressure condition has existed
  15051. * continuously for an initial period (100 ms).
  15052. * Repeat messages with updated information will be sent after each
  15053. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15054. * This message indicates the ring id along with current head and tail index
  15055. * locations (i.e. write and read indices).
  15056. * The backpressure time indicates the time in ms for which continous
  15057. * backpressure has been observed in the ring.
  15058. *
  15059. * The message format is as follows:
  15060. *
  15061. * |31 24|23 16|15 8|7 0|
  15062. * |----------------+----------------+----------------+----------------|
  15063. * | ring_id | ring_type | pdev_id | msg_type |
  15064. * |-------------------------------------------------------------------|
  15065. * | tail_idx | head_idx |
  15066. * |-------------------------------------------------------------------|
  15067. * | backpressure_time_ms |
  15068. * |-------------------------------------------------------------------|
  15069. *
  15070. * The message is interpreted as follows:
  15071. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15072. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15073. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15074. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15075. the msg is for LMAC ring.
  15076. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15077. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15078. * htt_backpressure_lmac_ring_id. This represents
  15079. * the ring id for which continous backpressure is seen
  15080. *
  15081. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15082. * the ring indicated by the ring_id
  15083. *
  15084. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15085. * the ring indicated by the ring id
  15086. *
  15087. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15088. * backpressure has been seen in the ring
  15089. * indicated by the ring_id.
  15090. * Units = milliseconds
  15091. */
  15092. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15093. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15094. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15095. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15096. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15097. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15098. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15099. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15100. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15101. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15102. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15103. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15104. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15105. do { \
  15106. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15107. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15108. } while (0)
  15109. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15110. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15111. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15112. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15113. do { \
  15114. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15115. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15116. } while (0)
  15117. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15118. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15119. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15120. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15121. do { \
  15122. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15123. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15124. } while (0)
  15125. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15126. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15127. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15128. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15129. do { \
  15130. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15131. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15132. } while (0)
  15133. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15134. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15135. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15136. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15137. do { \
  15138. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15139. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15140. } while (0)
  15141. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15142. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15143. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15144. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15145. do { \
  15146. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15147. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15148. } while (0)
  15149. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15150. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15151. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15152. enum htt_backpressure_ring_type {
  15153. HTT_SW_RING_TYPE_UMAC,
  15154. HTT_SW_RING_TYPE_LMAC,
  15155. HTT_SW_RING_TYPE_MAX,
  15156. };
  15157. /* Ring id for which the message is sent to host */
  15158. enum htt_backpressure_umac_ringid {
  15159. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15160. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15161. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15162. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15163. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15164. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15165. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15166. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15167. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15168. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15169. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15170. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15171. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15172. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15173. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15174. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15175. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15176. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15177. HTT_SW_UMAC_RING_IDX_MAX,
  15178. };
  15179. enum htt_backpressure_lmac_ringid {
  15180. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15181. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15182. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15183. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15184. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15185. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15186. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15187. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15188. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15189. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15190. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15191. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15192. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15193. HTT_SW_LMAC_RING_IDX_MAX,
  15194. };
  15195. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15196. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15197. pdev_id: 8,
  15198. ring_type: 8, /* htt_backpressure_ring_type */
  15199. /*
  15200. * ring_id holds an enum value from either
  15201. * htt_backpressure_umac_ringid or
  15202. * htt_backpressure_lmac_ringid, based on
  15203. * the ring_type setting.
  15204. */
  15205. ring_id: 8;
  15206. A_UINT16 head_idx;
  15207. A_UINT16 tail_idx;
  15208. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15209. } POSTPACK;
  15210. /*
  15211. * Defines two 32 bit words that can be used by the target to indicate a per
  15212. * user RU allocation and rate information.
  15213. *
  15214. * This information is currently provided in the "sw_response_reference_ptr"
  15215. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15216. * "rx_ppdu_end_user_stats" TLV.
  15217. *
  15218. * VALID:
  15219. * The consumer of these words must explicitly check the valid bit,
  15220. * and only attempt interpretation of any of the remaining fields if
  15221. * the valid bit is set to 1.
  15222. *
  15223. * VERSION:
  15224. * The consumer of these words must also explicitly check the version bit,
  15225. * and only use the V0 definition if the VERSION field is set to 0.
  15226. *
  15227. * Version 1 is currently undefined, with the exception of the VALID and
  15228. * VERSION fields.
  15229. *
  15230. * Version 0:
  15231. *
  15232. * The fields below are duplicated per BW.
  15233. *
  15234. * The consumer must determine which BW field to use, based on the UL OFDMA
  15235. * PPDU BW indicated by HW.
  15236. *
  15237. * RU_START: RU26 start index for the user.
  15238. * Note that this is always using the RU26 index, regardless
  15239. * of the actual RU assigned to the user
  15240. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15241. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15242. *
  15243. * For example, 20MHz (the value in the top row is RU_START)
  15244. *
  15245. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15246. * RU Size 1 (52): | | | | | |
  15247. * RU Size 2 (106): | | | |
  15248. * RU Size 3 (242): | |
  15249. *
  15250. * RU_SIZE: Indicates the RU size, as defined by enum
  15251. * htt_ul_ofdma_user_info_ru_size.
  15252. *
  15253. * LDPC: LDPC enabled (if 0, BCC is used)
  15254. *
  15255. * DCM: DCM enabled
  15256. *
  15257. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15258. * |---------------------------------+--------------------------------|
  15259. * |Ver|Valid| FW internal |
  15260. * |---------------------------------+--------------------------------|
  15261. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15262. * |---------------------------------+--------------------------------|
  15263. */
  15264. enum htt_ul_ofdma_user_info_ru_size {
  15265. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15266. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15267. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15268. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15269. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15270. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15271. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15272. };
  15273. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15274. struct htt_ul_ofdma_user_info_v0 {
  15275. A_UINT32 word0;
  15276. A_UINT32 word1;
  15277. };
  15278. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15279. A_UINT32 w0_fw_rsvd:30; \
  15280. A_UINT32 w0_valid:1; \
  15281. A_UINT32 w0_version:1;
  15282. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15283. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15284. };
  15285. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15286. A_UINT32 w1_nss:3; \
  15287. A_UINT32 w1_mcs:4; \
  15288. A_UINT32 w1_ldpc:1; \
  15289. A_UINT32 w1_dcm:1; \
  15290. A_UINT32 w1_ru_start:7; \
  15291. A_UINT32 w1_ru_size:3; \
  15292. A_UINT32 w1_trig_type:4; \
  15293. A_UINT32 w1_unused:9;
  15294. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15295. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15296. };
  15297. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15298. A_UINT32 w0_fw_rsvd:27; \
  15299. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15300. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15301. A_UINT32 w0_version:1; /* set to a value of “1” to indicate picking htt_ul_ofdma_user_info_v1_bitmap (field aligns with V0 definition) */
  15302. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15303. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15304. };
  15305. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15306. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15307. A_UINT32 w1_trig_type:4; \
  15308. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15309. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15310. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15311. };
  15312. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15313. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15314. union {
  15315. A_UINT32 word0;
  15316. struct {
  15317. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15318. };
  15319. };
  15320. union {
  15321. A_UINT32 word1;
  15322. struct {
  15323. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15324. };
  15325. };
  15326. } POSTPACK;
  15327. /*
  15328. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15329. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15330. * this should be picked.
  15331. */
  15332. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15333. union {
  15334. A_UINT32 word0;
  15335. struct {
  15336. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15337. };
  15338. };
  15339. union {
  15340. A_UINT32 word1;
  15341. struct {
  15342. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15343. };
  15344. };
  15345. } POSTPACK;
  15346. enum HTT_UL_OFDMA_TRIG_TYPE {
  15347. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15348. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15349. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15350. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15351. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15352. };
  15353. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15354. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15355. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15356. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15357. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15358. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15359. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15360. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15361. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15362. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15363. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15364. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15365. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15366. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15367. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15368. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15369. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15370. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15371. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15372. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15373. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15374. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15375. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15376. /*--- word 0 ---*/
  15377. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15378. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15379. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15380. do { \
  15381. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15382. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15383. } while (0)
  15384. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15385. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15386. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15387. do { \
  15388. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15389. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15390. } while (0)
  15391. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15392. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15393. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15394. do { \
  15395. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15396. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15397. } while (0)
  15398. /*--- word 1 ---*/
  15399. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15400. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15401. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15402. do { \
  15403. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15404. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15405. } while (0)
  15406. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15407. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15408. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15409. do { \
  15410. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15411. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15412. } while (0)
  15413. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15414. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15415. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  15416. do { \
  15417. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  15418. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  15419. } while (0)
  15420. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  15421. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  15422. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  15423. do { \
  15424. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  15425. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  15426. } while (0)
  15427. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  15428. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  15429. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  15430. do { \
  15431. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  15432. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  15433. } while (0)
  15434. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  15435. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  15436. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  15437. do { \
  15438. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  15439. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  15440. } while (0)
  15441. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  15442. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  15443. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  15444. do { \
  15445. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  15446. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  15447. } while (0)
  15448. /**
  15449. * @brief target -> host channel calibration data message
  15450. *
  15451. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  15452. *
  15453. * @brief host -> target channel calibration data message
  15454. *
  15455. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  15456. *
  15457. * @details
  15458. * The following field definitions describe the format of the channel
  15459. * calibration data message sent from the target to the host when
  15460. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  15461. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  15462. * The message is defined as htt_chan_caldata_msg followed by a variable
  15463. * number of 32-bit character values.
  15464. *
  15465. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  15466. * |------------------------------------------------------------------|
  15467. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  15468. * |------------------------------------------------------------------|
  15469. * | payload size | mhz |
  15470. * |------------------------------------------------------------------|
  15471. * | center frequency 2 | center frequency 1 |
  15472. * |------------------------------------------------------------------|
  15473. * | check sum |
  15474. * |------------------------------------------------------------------|
  15475. * | payload |
  15476. * |------------------------------------------------------------------|
  15477. * message info field:
  15478. * - MSG_TYPE
  15479. * Bits 7:0
  15480. * Purpose: identifies this as a channel calibration data message
  15481. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  15482. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  15483. * - SUB_TYPE
  15484. * Bits 11:8
  15485. * Purpose: T2H: indicates whether target is providing chan cal data
  15486. * to the host to store, or requesting that the host
  15487. * download previously-stored data.
  15488. * H2T: indicates whether the host is providing the requested
  15489. * channel cal data, or if it is rejecting the data
  15490. * request because it does not have the requested data.
  15491. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  15492. * - CHKSUM_VALID
  15493. * Bit 12
  15494. * Purpose: indicates if the checksum field is valid
  15495. * value:
  15496. * - FRAG
  15497. * Bit 19:16
  15498. * Purpose: indicates the fragment index for message
  15499. * value: 0 for first fragment, 1 for second fragment, ...
  15500. * - APPEND
  15501. * Bit 20
  15502. * Purpose: indicates if this is the last fragment
  15503. * value: 0 = final fragment, 1 = more fragments will be appended
  15504. *
  15505. * channel and payload size field
  15506. * - MHZ
  15507. * Bits 15:0
  15508. * Purpose: indicates the channel primary frequency
  15509. * Value:
  15510. * - PAYLOAD_SIZE
  15511. * Bits 31:16
  15512. * Purpose: indicates the bytes of calibration data in payload
  15513. * Value:
  15514. *
  15515. * center frequency field
  15516. * - CENTER FREQUENCY 1
  15517. * Bits 15:0
  15518. * Purpose: indicates the channel center frequency
  15519. * Value: channel center frequency, in MHz units
  15520. * - CENTER FREQUENCY 2
  15521. * Bits 31:16
  15522. * Purpose: indicates the secondary channel center frequency,
  15523. * only for 11acvht 80plus80 mode
  15524. * Value: secondary channel center frequeny, in MHz units, if applicable
  15525. *
  15526. * checksum field
  15527. * - CHECK_SUM
  15528. * Bits 31:0
  15529. * Purpose: check the payload data, it is just for this fragment.
  15530. * This is intended for the target to check that the channel
  15531. * calibration data returned by the host is the unmodified data
  15532. * that was previously provided to the host by the target.
  15533. * value: checksum of fragment payload
  15534. */
  15535. PREPACK struct htt_chan_caldata_msg {
  15536. /* DWORD 0: message info */
  15537. A_UINT32
  15538. msg_type: 8,
  15539. sub_type: 4 ,
  15540. chksum_valid: 1, /** 1:valid, 0:invalid */
  15541. reserved1: 3,
  15542. frag_idx: 4, /** fragment index for calibration data */
  15543. appending: 1, /** 0: no fragment appending,
  15544. * 1: extra fragment appending */
  15545. reserved2: 11;
  15546. /* DWORD 1: channel and payload size */
  15547. A_UINT32
  15548. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  15549. payload_size: 16; /** unit: bytes */
  15550. /* DWORD 2: center frequency */
  15551. A_UINT32
  15552. band_center_freq1: 16, /** Center frequency 1 in MHz */
  15553. band_center_freq2: 16; /** Center frequency 2 in MHz,
  15554. * valid only for 11acvht 80plus80 mode */
  15555. /* DWORD 3: check sum */
  15556. A_UINT32 chksum;
  15557. /* variable length for calibration data */
  15558. A_UINT32 payload[1/* or more */];
  15559. } POSTPACK;
  15560. /* T2H SUBTYPE */
  15561. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  15562. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  15563. /* H2T SUBTYPE */
  15564. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  15565. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  15566. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  15567. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  15568. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  15569. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  15570. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  15571. do { \
  15572. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  15573. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  15574. } while (0)
  15575. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  15576. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  15577. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  15578. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  15579. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  15580. do { \
  15581. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  15582. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  15583. } while (0)
  15584. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  15585. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  15586. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  15587. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  15588. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  15589. do { \
  15590. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  15591. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  15592. } while (0)
  15593. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  15594. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  15595. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  15596. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  15597. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  15598. do { \
  15599. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  15600. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  15601. } while (0)
  15602. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  15603. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  15604. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  15605. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  15606. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  15607. do { \
  15608. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  15609. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  15610. } while (0)
  15611. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  15612. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  15613. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  15614. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  15615. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  15616. do { \
  15617. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  15618. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  15619. } while (0)
  15620. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  15621. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  15622. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  15623. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  15624. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  15625. do { \
  15626. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  15627. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  15628. } while (0)
  15629. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  15630. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  15631. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  15632. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  15633. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  15634. do { \
  15635. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  15636. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  15637. } while (0)
  15638. /**
  15639. * @brief target -> host FSE CMEM based send
  15640. *
  15641. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  15642. *
  15643. * @details
  15644. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  15645. * FSE placement in CMEM is enabled.
  15646. *
  15647. * This message sends the non-secure CMEM base address.
  15648. * It will be sent to host in response to message
  15649. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  15650. * The message would appear as follows:
  15651. *
  15652. * |31 24|23 16|15 8|7 0|
  15653. * |----------------+----------------+----------------+----------------|
  15654. * | reserved | num_entries | msg_type |
  15655. * |----------------+----------------+----------------+----------------|
  15656. * | base_address_lo |
  15657. * |----------------+----------------+----------------+----------------|
  15658. * | base_address_hi |
  15659. * |-------------------------------------------------------------------|
  15660. *
  15661. * The message is interpreted as follows:
  15662. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  15663. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  15664. * b'8:15 - number_entries: Indicated the number of entries
  15665. * programmed.
  15666. * b'16:31 - reserved.
  15667. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  15668. * CMEM base address
  15669. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  15670. * CMEM base address
  15671. */
  15672. PREPACK struct htt_cmem_base_send_t {
  15673. A_UINT32 msg_type: 8,
  15674. num_entries: 8,
  15675. reserved: 16;
  15676. A_UINT32 base_address_lo;
  15677. A_UINT32 base_address_hi;
  15678. } POSTPACK;
  15679. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  15680. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  15681. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  15682. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  15683. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  15684. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  15685. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  15686. do { \
  15687. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  15688. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15689. } while (0)
  15690. /**
  15691. * @brief - HTT PPDU ID format
  15692. *
  15693. * @details
  15694. * The following field definitions describe the format of the PPDU ID.
  15695. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  15696. *
  15697. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  15698. * +--------------------------------------------------------------------------
  15699. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  15700. * +--------------------------------------------------------------------------
  15701. *
  15702. * sch id :Schedule command id
  15703. * Bits [11 : 0] : monotonically increasing counter to track the
  15704. * PPDU posted to a specific transmit queue.
  15705. *
  15706. * hwq_id: Hardware Queue ID.
  15707. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  15708. *
  15709. * mac_id: MAC ID
  15710. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  15711. *
  15712. * seq_idx: Sequence index.
  15713. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  15714. * a particular TXOP.
  15715. *
  15716. * tqm_cmd: HWSCH/TQM flag.
  15717. * Bit [23] : Always set to 0.
  15718. *
  15719. * seq_cmd_type: Sequence command type.
  15720. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  15721. * Refer to enum HTT_STATS_FTYPE for values.
  15722. */
  15723. PREPACK struct htt_ppdu_id {
  15724. A_UINT32
  15725. sch_id: 12,
  15726. hwq_id: 5,
  15727. mac_id: 2,
  15728. seq_idx: 2,
  15729. reserved1: 2,
  15730. tqm_cmd: 1,
  15731. seq_cmd_type: 6,
  15732. reserved2: 2;
  15733. } POSTPACK;
  15734. #define HTT_PPDU_ID_SCH_ID_S 0
  15735. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  15736. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  15737. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  15738. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  15739. do { \
  15740. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  15741. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  15742. } while (0)
  15743. #define HTT_PPDU_ID_HWQ_ID_S 12
  15744. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  15745. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  15746. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  15747. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  15748. do { \
  15749. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  15750. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  15751. } while (0)
  15752. #define HTT_PPDU_ID_MAC_ID_S 17
  15753. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  15754. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  15755. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  15756. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  15757. do { \
  15758. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  15759. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  15760. } while (0)
  15761. #define HTT_PPDU_ID_SEQ_IDX_S 19
  15762. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  15763. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  15764. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  15765. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  15766. do { \
  15767. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  15768. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  15769. } while (0)
  15770. #define HTT_PPDU_ID_TQM_CMD_S 23
  15771. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  15772. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  15773. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  15774. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  15775. do { \
  15776. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  15777. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  15778. } while (0)
  15779. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  15780. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  15781. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  15782. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  15783. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  15784. do { \
  15785. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  15786. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  15787. } while (0)
  15788. /**
  15789. * @brief target -> RX PEER METADATA V0 format
  15790. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15791. * message from target, and will confirm to the target which peer metadata
  15792. * version to use in the wmi_init message.
  15793. *
  15794. * The following diagram shows the format of the RX PEER METADATA.
  15795. *
  15796. * |31 24|23 16|15 8|7 0|
  15797. * |-----------------------------------------------------------------------|
  15798. * | Reserved | VDEV ID | PEER ID |
  15799. * |-----------------------------------------------------------------------|
  15800. */
  15801. PREPACK struct htt_rx_peer_metadata_v0 {
  15802. A_UINT32
  15803. peer_id: 16,
  15804. vdev_id: 8,
  15805. reserved1: 8;
  15806. } POSTPACK;
  15807. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  15808. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  15809. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  15810. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  15811. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  15812. do { \
  15813. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  15814. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  15815. } while (0)
  15816. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  15817. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  15818. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  15819. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  15820. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  15821. do { \
  15822. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  15823. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  15824. } while (0)
  15825. /**
  15826. * @brief target -> RX PEER METADATA V1 format
  15827. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15828. * message from target, and will confirm to the target which peer metadata
  15829. * version to use in the wmi_init message.
  15830. *
  15831. * The following diagram shows the format of the RX PEER METADATA V1 format.
  15832. *
  15833. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  15834. * |-----------------------------------------------------------------------|
  15835. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  15836. * |-----------------------------------------------------------------------|
  15837. */
  15838. PREPACK struct htt_rx_peer_metadata_v1 {
  15839. A_UINT32
  15840. peer_id: 13,
  15841. ml_peer_valid: 1,
  15842. reserved1: 2,
  15843. vdev_id: 8,
  15844. lmac_id: 2,
  15845. chip_id: 3,
  15846. reserved2: 3;
  15847. } POSTPACK;
  15848. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  15849. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  15850. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  15851. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  15852. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  15853. do { \
  15854. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  15855. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  15856. } while (0)
  15857. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  15858. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  15859. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  15860. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  15861. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  15862. do { \
  15863. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  15864. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  15865. } while (0)
  15866. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  15867. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  15868. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  15869. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  15870. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  15871. do { \
  15872. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  15873. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  15874. } while (0)
  15875. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  15876. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  15877. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  15878. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  15879. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  15880. do { \
  15881. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  15882. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  15883. } while (0)
  15884. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  15885. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  15886. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  15887. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  15888. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  15889. do { \
  15890. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  15891. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  15892. } while (0)
  15893. /*
  15894. * In some systems, the host SW wants to specify priorities between
  15895. * different MSDU / flow queues within the same peer-TID.
  15896. * The below enums are used for the host to identify to the target
  15897. * which MSDU queue's priority it wants to adjust.
  15898. */
  15899. /*
  15900. * The MSDUQ index describe index of TCL HW, where each index is
  15901. * used for queuing particular types of MSDUs.
  15902. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  15903. */
  15904. enum HTT_MSDUQ_INDEX {
  15905. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  15906. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  15907. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  15908. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  15909. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  15910. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  15911. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  15912. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  15913. HTT_MSDUQ_MAX_INDEX,
  15914. };
  15915. /* MSDU qtype definition */
  15916. enum HTT_MSDU_QTYPE {
  15917. /*
  15918. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  15919. * relative priority. Instead, the relative priority of CRIT_0 versus
  15920. * CRIT_1 is controlled by the FW, through the configuration parameters
  15921. * it applies to the queues.
  15922. */
  15923. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  15924. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  15925. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  15926. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  15927. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  15928. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  15929. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  15930. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  15931. /* New MSDU_QTYPE should be added above this line */
  15932. /*
  15933. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  15934. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  15935. * any host/target message definitions. The QTYPE_MAX value can
  15936. * only be used internally within the host or within the target.
  15937. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  15938. * it must regard the unexpected value as a default qtype value,
  15939. * or ignore it.
  15940. */
  15941. HTT_MSDU_QTYPE_MAX,
  15942. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  15943. };
  15944. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  15945. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  15946. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  15947. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  15948. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  15949. };
  15950. /**
  15951. * @brief target -> host mlo timestamp offset indication
  15952. *
  15953. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15954. *
  15955. * @details
  15956. * The following field definitions describe the format of the HTT target
  15957. * to host mlo timestamp offset indication message.
  15958. *
  15959. *
  15960. * |31 16|15 12|11 10|9 8|7 0 |
  15961. * |----------------------------------------------------------------------|
  15962. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  15963. * |----------------------------------------------------------------------|
  15964. * | Sync time stamp lo in us |
  15965. * |----------------------------------------------------------------------|
  15966. * | Sync time stamp hi in us |
  15967. * |----------------------------------------------------------------------|
  15968. * | mlo time stamp offset lo in us |
  15969. * |----------------------------------------------------------------------|
  15970. * | mlo time stamp offset hi in us |
  15971. * |----------------------------------------------------------------------|
  15972. * | mlo time stamp offset clocks in clock ticks |
  15973. * |----------------------------------------------------------------------|
  15974. * |31 26|25 16|15 0 |
  15975. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  15976. * | | compensation in clks | |
  15977. * |----------------------------------------------------------------------|
  15978. * |31 22|21 0 |
  15979. * | rsvd 3 | mlo time stamp comp timer period |
  15980. * |----------------------------------------------------------------------|
  15981. * The message is interpreted as follows:
  15982. *
  15983. * dword0 - b'0:7 - msg_type: This will be set to
  15984. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15985. * value: 0x28
  15986. *
  15987. * dword0 - b'9:8 - pdev_id
  15988. *
  15989. * dword0 - b'11:10 - chip_id
  15990. *
  15991. * dword0 - b'15:12 - rsvd1: Reserved for future use
  15992. *
  15993. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  15994. *
  15995. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  15996. * which last sync interrupt was received
  15997. *
  15998. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  15999. * which last sync interrupt was received
  16000. *
  16001. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16002. *
  16003. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16004. *
  16005. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16006. *
  16007. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16008. *
  16009. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16010. * for sub us resolution
  16011. *
  16012. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16013. *
  16014. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16015. * is applied, in us
  16016. *
  16017. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16018. */
  16019. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16020. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16021. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16022. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16023. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16024. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16025. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16026. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16027. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16028. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16029. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16030. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16031. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16032. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16033. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16034. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16035. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16036. do { \
  16037. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16038. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16039. } while (0)
  16040. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16041. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16042. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16043. do { \
  16044. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16045. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16046. } while (0)
  16047. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16048. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16049. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16050. do { \
  16051. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16052. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16053. } while (0)
  16054. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16055. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16056. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16057. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16058. do { \
  16059. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16060. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16061. } while (0)
  16062. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16063. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16064. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16065. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16066. do { \
  16067. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16068. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16069. } while (0)
  16070. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16071. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16072. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16073. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16074. do { \
  16075. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16076. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16077. } while (0)
  16078. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16079. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16080. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16081. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16082. do { \
  16083. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16084. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16085. } while (0)
  16086. typedef struct {
  16087. A_UINT32 msg_type: 8, /* bits 7:0 */
  16088. pdev_id: 2, /* bits 9:8 */
  16089. chip_id: 2, /* bits 11:10 */
  16090. reserved1: 4, /* bits 15:12 */
  16091. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16092. A_UINT32 sync_timestamp_lo_us;
  16093. A_UINT32 sync_timestamp_hi_us;
  16094. A_UINT32 mlo_timestamp_offset_lo_us;
  16095. A_UINT32 mlo_timestamp_offset_hi_us;
  16096. A_UINT32 mlo_timestamp_offset_clks;
  16097. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16098. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16099. reserved2: 6; /* bits 31:26 */
  16100. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16101. reserved3: 10; /* bits 31:22 */
  16102. } htt_t2h_mlo_offset_ind_t;
  16103. /*
  16104. * @brief target -> host VDEV TX RX STATS
  16105. *
  16106. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16107. *
  16108. * @details
  16109. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16110. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16111. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16112. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16113. * periodically by target even in the absence of any further HTT request
  16114. * messages from host.
  16115. *
  16116. * The message is formatted as follows:
  16117. *
  16118. * |31 16|15 8|7 0|
  16119. * |---------------------------------+----------------+----------------|
  16120. * | payload_size | pdev_id | msg_type |
  16121. * |---------------------------------+----------------+----------------|
  16122. * | reserved0 |
  16123. * |-------------------------------------------------------------------|
  16124. * | reserved1 |
  16125. * |-------------------------------------------------------------------|
  16126. * | reserved2 |
  16127. * |-------------------------------------------------------------------|
  16128. * | |
  16129. * | VDEV specific Tx Rx stats info |
  16130. * | |
  16131. * |-------------------------------------------------------------------|
  16132. *
  16133. * The message is interpreted as follows:
  16134. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16135. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16136. * b'8:15 - pdev_id
  16137. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16138. * message header fields (msg_type through reserved2)
  16139. * dword1 - b'0:31 - reserved0.
  16140. * dword2 - b'0:31 - reserved1.
  16141. * dword3 - b'0:31 - reserved2.
  16142. */
  16143. typedef struct {
  16144. A_UINT32 msg_type: 8,
  16145. pdev_id: 8,
  16146. payload_size: 16;
  16147. A_UINT32 reserved0;
  16148. A_UINT32 reserved1;
  16149. A_UINT32 reserved2;
  16150. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16151. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16152. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16153. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16154. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16155. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16156. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16157. do { \
  16158. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16159. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16160. } while (0)
  16161. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16162. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16163. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16164. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16165. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16166. do { \
  16167. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16168. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16169. } while (0)
  16170. /* SOC related stats */
  16171. typedef struct {
  16172. htt_tlv_hdr_t tlv_hdr;
  16173. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16174. * This can be due to either the peer is deleted or deletion is ongoing
  16175. * */
  16176. A_UINT32 inv_peers_msdu_drop_count_lo;
  16177. A_UINT32 inv_peers_msdu_drop_count_hi;
  16178. } htt_t2h_soc_txrx_stats_common_tlv;
  16179. /* VDEV HW Tx/Rx stats */
  16180. typedef struct {
  16181. htt_tlv_hdr_t tlv_hdr;
  16182. A_UINT32 vdev_id;
  16183. /* Rx msdu byte cnt */
  16184. A_UINT32 rx_msdu_byte_cnt_lo;
  16185. A_UINT32 rx_msdu_byte_cnt_hi;
  16186. /* Rx msdu cnt */
  16187. A_UINT32 rx_msdu_cnt_lo;
  16188. A_UINT32 rx_msdu_cnt_hi;
  16189. /* tx msdu byte cnt */
  16190. A_UINT32 tx_msdu_byte_cnt_lo;
  16191. A_UINT32 tx_msdu_byte_cnt_hi;
  16192. /* tx msdu cnt */
  16193. A_UINT32 tx_msdu_cnt_lo;
  16194. A_UINT32 tx_msdu_cnt_hi;
  16195. /* tx excessive retry discarded msdu cnt */
  16196. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16197. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16198. /* TX congestion ctrl msdu drop cnt */
  16199. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16200. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16201. /* discarded tx msdus cnt coz of time to live expiry */
  16202. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16203. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16204. /* tx excessive retry discarded msdu byte cnt */
  16205. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16206. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16207. /* TX congestion ctrl msdu drop byte cnt */
  16208. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16209. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16210. /* discarded tx msdus byte cnt coz of time to live expiry */
  16211. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16212. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16213. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16214. /*
  16215. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16216. *
  16217. * @details
  16218. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16219. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16220. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16221. * the default MSDU queues of each of the specified TIDs for the peer
  16222. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16223. * If the default MSDU queues of a given TID within the peer are not linked
  16224. * to a service class, the svc_class_id field for that TID will have a
  16225. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16226. * queues for that TID are not mapped to any service class.
  16227. *
  16228. * |31 16|15 8|7 0|
  16229. * |------------------------------+--------------+--------------|
  16230. * | peer ID | reserved | msg type |
  16231. * |------------------------------+--------------+------+-------|
  16232. * | reserved | svc class ID | TID |
  16233. * |------------------------------------------------------------|
  16234. * ...
  16235. * |------------------------------------------------------------|
  16236. * | reserved | svc class ID | TID |
  16237. * |------------------------------------------------------------|
  16238. * Header fields:
  16239. * dword0 - b'7:0 - msg_type: This will be set to
  16240. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16241. * b'31:16 - peer ID
  16242. * dword1 - b'7:0 - TID
  16243. * b'15:8 - svc class ID
  16244. * (dword2, etc. same format as dword1)
  16245. */
  16246. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16247. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16248. A_UINT32 msg_type :8,
  16249. reserved0 :8,
  16250. peer_id :16;
  16251. struct {
  16252. A_UINT32 tid :8,
  16253. svc_class_id :8,
  16254. reserved1 :16;
  16255. } tid_reports[1/*or more*/];
  16256. } POSTPACK;
  16257. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16258. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16259. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16260. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16261. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16262. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16263. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16264. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16265. do { \
  16266. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16267. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16268. } while (0)
  16269. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16270. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16271. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16272. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16273. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16274. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16275. do { \
  16276. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16277. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16278. } while (0)
  16279. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16280. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16281. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16282. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16283. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16284. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16285. do { \
  16286. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16287. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16288. } while (0)
  16289. /*
  16290. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16291. *
  16292. * @details
  16293. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16294. * flow if the flow is seen the associated service class is conveyed to the
  16295. * target via TCL Data Command. Target on the other hand internally creates the
  16296. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16297. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16298. * the newly created MSDUQ
  16299. *
  16300. * |31 27| 24|23 16|15 11|10|9 8|7 4|3 0|
  16301. * |------------------------------+----------------------+--------------|
  16302. * | peer ID | HTT qtype | msg type |
  16303. * |--------+---------------------+---------------+--+---+-------+------|
  16304. * |reserved| Ast Index |FO|WC | HLOS | remap|
  16305. * | | | | | TID | TID |
  16306. * |---------------------+----------------------------------------------|
  16307. * | reserved1 | tgt_opaque_id |
  16308. * |---------------------+----------------------------------------------|
  16309. *
  16310. * Header fields:
  16311. *
  16312. * dword0 - b'7:0 - msg_type: This will be set to
  16313. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16314. * b'15:8 - HTT qtype
  16315. * b'31:16 - peer ID
  16316. *
  16317. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16318. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16319. * hlos_tid : Common to Lithium and Beryllium
  16320. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16321. * TCL Data Command : Beryllium
  16322. * b10 - flow_override (FO), as sent by host in
  16323. * TCL Data Command: Beryllium
  16324. * b11:26 - ast_index
  16325. * Dummy AST Index in case of Lithium,
  16326. * Default AST Index in case of Beryllium
  16327. * b27:32 - reserved
  16328. *
  16329. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16330. * unique MSDUQ id in firmware
  16331. * b'24:31 - reserved1
  16332. */
  16333. PREPACK struct htt_t2h_sawf_msduq_event {
  16334. A_UINT32 msg_type : 8,
  16335. htt_qtype : 8,
  16336. peer_id :16;
  16337. A_UINT32 remap_tid : 4,
  16338. hlos_tid : 4,
  16339. who_classify_info_sel : 2,
  16340. flow_override : 1,
  16341. ast_index :16,
  16342. reserved : 5;
  16343. A_UINT32 tgt_opaque_id :24,
  16344. reserved1 : 8;
  16345. } POSTPACK;
  16346. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16347. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16348. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16349. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16350. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16351. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16352. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16353. do { \
  16354. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16355. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16356. } while (0)
  16357. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16358. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16359. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16360. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16361. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16362. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16363. do { \
  16364. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16365. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16366. } while (0)
  16367. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16368. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16369. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16370. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16371. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16372. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16373. do { \
  16374. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16375. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16376. } while (0)
  16377. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16378. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16379. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16380. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16381. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16382. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16383. do { \
  16384. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16385. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16386. } while (0)
  16387. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16388. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16389. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16390. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16391. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16392. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16393. do { \
  16394. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16395. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16396. } while (0)
  16397. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  16398. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  16399. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  16400. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  16401. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  16402. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  16403. do { \
  16404. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  16405. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  16406. } while (0)
  16407. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_M 0x07FFF800
  16408. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_S 11
  16409. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_GET(_var) \
  16410. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_M) >> \
  16411. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_S)
  16412. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_SET(_var, _val) \
  16413. do { \
  16414. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX, _val); \
  16415. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_INDEX_S)); \
  16416. } while (0)
  16417. #endif