htt.h 810 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. *
  4. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  5. *
  6. *
  7. * Permission to use, copy, modify, and/or distribute this software for
  8. * any purpose with or without fee is hereby granted, provided that the
  9. * above copyright notice and this permission notice appear in all
  10. * copies.
  11. *
  12. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  13. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  14. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  15. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  16. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  17. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  18. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  19. * PERFORMANCE OF THIS SOFTWARE.
  20. */
  21. /*
  22. * This file was originally distributed by Qualcomm Atheros, Inc.
  23. * under proprietary terms before Copyright ownership was assigned
  24. * to the Linux Foundation.
  25. */
  26. /**
  27. * @file htt.h
  28. *
  29. * @details the public header file of HTT layer
  30. */
  31. #ifndef _HTT_H_
  32. #define _HTT_H_
  33. #include <htt_deps.h>
  34. #include <htt_common.h>
  35. /*
  36. * Unless explicitly specified to use 64 bits to represent physical addresses
  37. * (or more precisely, bus addresses), default to 32 bits.
  38. */
  39. #ifndef HTT_PADDR64
  40. #define HTT_PADDR64 0
  41. #endif
  42. #ifndef offsetof
  43. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  44. #endif
  45. /*
  46. * HTT version history:
  47. * 1.0 initial numbered version
  48. * 1.1 modifications to STATS messages.
  49. * These modifications are not backwards compatible, but since the
  50. * STATS messages themselves are non-essential (they are for debugging),
  51. * the 1.1 version of the HTT message library as a whole is compatible
  52. * with the 1.0 version.
  53. * 1.2 reset mask IE added to STATS_REQ message
  54. * 1.3 stat config IE added to STATS_REQ message
  55. *----
  56. * 2.0 FW rx PPDU desc added to RX_IND message
  57. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  58. *----
  59. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  60. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  61. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  62. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  63. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  64. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  65. * 3.5 Added flush and fail stats in rx_reorder stats structure
  66. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  67. * 3.7 Made changes to support EOS Mac_core 3.0
  68. * 3.8 Added txq_group information element definition;
  69. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  70. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  71. * Allow buffer addresses in bus-address format to be stored as
  72. * either 32 bits or 64 bits.
  73. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  74. * messages to specify which HTT options to use.
  75. * Initial TLV options cover:
  76. * - whether to use 32 or 64 bits to represent LL bus addresses
  77. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  78. * - how many tx queue groups to use
  79. * 3.11 Expand rx debug stats:
  80. * - Expand the rx_reorder_stats struct with stats about successful and
  81. * failed rx buffer allcoations.
  82. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  83. * the supply, allocation, use, and recycling of rx buffers for the
  84. * "remote ring" of rx buffers in host member in LL systems.
  85. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  86. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  87. * 3.13 Add constants + macros to support 64-bit address format for the
  88. * tx fragments descriptor, the rx ring buffer, and the rx ring
  89. * index shadow register.
  90. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  91. * - Add htt_tx_msdu_desc_ext_t struct def.
  92. * - Add TLV to specify whether the target supports the HTT tx MSDU
  93. * extension descriptor.
  94. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  95. * "extension" bit, to specify whether a HTT tx MSDU extension
  96. * descriptor is present.
  97. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  98. * (This allows the host to obtain key information about the MSDU
  99. * from a memory location already in the cache, rather than taking a
  100. * cache miss for each MSDU by reading the HW rx descs.)
  101. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  102. * whether a copy-engine classification result is appended to TX_FRM.
  103. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  104. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  105. * tx frames in the target after the peer has already been deleted.
  106. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  107. * 3.20 Expand rx_reorder_stats.
  108. * 3.21 Add optional rx channel spec to HL RX_IND.
  109. * 3.22 Expand rx_reorder_stats
  110. * (distinguish duplicates within vs. outside block ack window)
  111. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  112. * The justified rate is calculated by two steps. The first is to multiply
  113. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  114. * by a low pass filter.
  115. * This change allows HL download scheduling to consider the WLAN rate
  116. * that will be used for transmitting the downloaded frames.
  117. * 3.24 Expand rx_reorder_stats
  118. * (add counter for decrypt / MIC errors)
  119. * 3.25 Expand rx_reorder_stats
  120. * (add counter of frames received into both local + remote rings)
  121. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  122. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  123. * 3.27 Add a new interface for flow-control. The following t2h messages have
  124. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  125. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  126. * 3.28 Add a new interface for ring interface change. The following two h2t
  127. * and one t2h messages have been included:
  128. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  129. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  130. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  131. * information elements passed from the host to a Lithium target,
  132. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  133. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  134. * targets).
  135. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  136. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  137. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  138. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  139. * sharing stats
  140. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  141. * 3.34 Add HW_PEER_ID field to PEER_MAP
  142. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  143. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  144. * not yet in use)
  145. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  146. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  147. * 3.38 Add holes_no_filled field to rx_reorder_stats
  148. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  149. * 3.40 Add optional timestamps in the HTT tx completion
  150. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  151. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  152. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  153. * 3.44 Add htt_tx_wbm_completion_v2
  154. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  155. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  156. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  157. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  158. * HTT_T2H_MSG_TYPE_PKTLOG
  159. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  160. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  161. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  162. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  163. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  165. * 3.55 Add initiator / responder flags to RX_DELBA indication
  166. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  167. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  168. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  169. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  170. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  171. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  172. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  173. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  174. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  175. * array to the end of HTT_T2H TX_COMPL_IND msg
  176. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  177. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  178. * for a MSDU.
  179. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  180. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  181. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  182. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  183. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  184. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  185. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  186. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  187. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  188. * htt_tx_data_hdr_information
  189. * 3.73 Add channel pre-calibration data upload and download messages defs for
  190. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  191. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  192. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  193. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  194. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  195. * 3.78 Add htt_ppdu_id def.
  196. * 3.79 Add HTT_NUM_AC_WMM def.
  197. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  198. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  199. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  200. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  201. * 3.84 Add fisa_control_bits_v2 def.
  202. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  203. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  204. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  205. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  206. * 3.89 Add MSDU queue enumerations.
  207. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  208. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  209. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  210. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  211. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  212. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  213. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  214. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  216. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  217. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  218. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  219. * 3.100 Add htt_tx_wbm_completion_v3 def.
  220. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  221. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  222. */
  223. #define HTT_CURRENT_VERSION_MAJOR 3
  224. #define HTT_CURRENT_VERSION_MINOR 102
  225. #define HTT_NUM_TX_FRAG_DESC 1024
  226. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  227. #define HTT_CHECK_SET_VAL(field, val) \
  228. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  229. /* macros to assist in sign-extending fields from HTT messages */
  230. #define HTT_SIGN_BIT_MASK(field) \
  231. ((field ## _M + (1 << field ## _S)) >> 1)
  232. #define HTT_SIGN_BIT(_val, field) \
  233. (_val & HTT_SIGN_BIT_MASK(field))
  234. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  235. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  236. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  237. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  238. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  239. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  240. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  241. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  242. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  243. /*
  244. * TEMPORARY:
  245. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  246. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  247. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  248. * updated.
  249. */
  250. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  251. /*
  252. * TEMPORARY:
  253. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  254. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  255. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  256. * updated.
  257. */
  258. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  259. /*
  260. * htt_dbg_stats_type -
  261. * bit positions for each stats type within a stats type bitmask
  262. * The bitmask contains 24 bits.
  263. */
  264. enum htt_dbg_stats_type {
  265. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  266. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  267. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  268. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  269. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  270. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  271. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  272. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  273. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  274. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  275. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  276. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  277. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  278. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  279. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  280. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  281. /* bits 16-23 currently reserved */
  282. /* keep this last */
  283. HTT_DBG_NUM_STATS
  284. };
  285. /*=== HTT option selection TLVs ===
  286. * Certain HTT messages have alternatives or options.
  287. * For such cases, the host and target need to agree on which option to use.
  288. * Option specification TLVs can be appended to the VERSION_REQ and
  289. * VERSION_CONF messages to select options other than the default.
  290. * These TLVs are entirely optional - if they are not provided, there is a
  291. * well-defined default for each option. If they are provided, they can be
  292. * provided in any order. Each TLV can be present or absent independent of
  293. * the presence / absence of other TLVs.
  294. *
  295. * The HTT option selection TLVs use the following format:
  296. * |31 16|15 8|7 0|
  297. * |---------------------------------+----------------+----------------|
  298. * | value (payload) | length | tag |
  299. * |-------------------------------------------------------------------|
  300. * The value portion need not be only 2 bytes; it can be extended by any
  301. * integer number of 4-byte units. The total length of the TLV, including
  302. * the tag and length fields, must be a multiple of 4 bytes. The length
  303. * field specifies the total TLV size in 4-byte units. Thus, the typical
  304. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  305. * field, would store 0x1 in its length field, to show that the TLV occupies
  306. * a single 4-byte unit.
  307. */
  308. /*--- TLV header format - applies to all HTT option TLVs ---*/
  309. enum HTT_OPTION_TLV_TAGS {
  310. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  311. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  312. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  313. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  314. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  315. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  316. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  317. };
  318. PREPACK struct htt_option_tlv_header_t {
  319. A_UINT8 tag;
  320. A_UINT8 length;
  321. } POSTPACK;
  322. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  323. #define HTT_OPTION_TLV_TAG_S 0
  324. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  325. #define HTT_OPTION_TLV_LENGTH_S 8
  326. /*
  327. * value0 - 16 bit value field stored in word0
  328. * The TLV's value field may be longer than 2 bytes, in which case
  329. * the remainder of the value is stored in word1, word2, etc.
  330. */
  331. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  332. #define HTT_OPTION_TLV_VALUE0_S 16
  333. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  334. do { \
  335. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  336. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  337. } while (0)
  338. #define HTT_OPTION_TLV_TAG_GET(word) \
  339. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  340. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  341. do { \
  342. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  343. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  344. } while (0)
  345. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  346. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  347. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  348. do { \
  349. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  350. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  351. } while (0)
  352. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  353. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  354. /*--- format of specific HTT option TLVs ---*/
  355. /*
  356. * HTT option TLV for specifying LL bus address size
  357. * Some chips require bus addresses used by the target to access buffers
  358. * within the host's memory to be 32 bits; others require bus addresses
  359. * used by the target to access buffers within the host's memory to be
  360. * 64 bits.
  361. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  362. * a suffix to the VERSION_CONF message to specify which bus address format
  363. * the target requires.
  364. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  365. * default to providing bus addresses to the target in 32-bit format.
  366. */
  367. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  368. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  369. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  370. };
  371. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  372. struct htt_option_tlv_header_t hdr;
  373. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  374. } POSTPACK;
  375. /*
  376. * HTT option TLV for specifying whether HL systems should indicate
  377. * over-the-air tx completion for individual frames, or should instead
  378. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  379. * requests an OTA tx completion for a particular tx frame.
  380. * This option does not apply to LL systems, where the TX_COMPL_IND
  381. * is mandatory.
  382. * This option is primarily intended for HL systems in which the tx frame
  383. * downloads over the host --> target bus are as slow as or slower than
  384. * the transmissions over the WLAN PHY. For cases where the bus is faster
  385. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  386. * and consquently will send one TX_COMPL_IND message that covers several
  387. * tx frames. For cases where the WLAN PHY is faster than the bus,
  388. * the target will end up transmitting very short A-MPDUs, and consequently
  389. * sending many TX_COMPL_IND messages, which each cover a very small number
  390. * of tx frames.
  391. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  392. * a suffix to the VERSION_REQ message to request whether the host desires to
  393. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  394. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  395. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  396. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  397. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  398. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  399. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  400. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  401. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  402. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  403. * TLV.
  404. */
  405. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  406. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  407. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  408. };
  409. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  410. struct htt_option_tlv_header_t hdr;
  411. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  412. } POSTPACK;
  413. /*
  414. * HTT option TLV for specifying how many tx queue groups the target
  415. * may establish.
  416. * This TLV specifies the maximum value the target may send in the
  417. * txq_group_id field of any TXQ_GROUP information elements sent by
  418. * the target to the host. This allows the host to pre-allocate an
  419. * appropriate number of tx queue group structs.
  420. *
  421. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  422. * a suffix to the VERSION_REQ message to specify whether the host supports
  423. * tx queue groups at all, and if so if there is any limit on the number of
  424. * tx queue groups that the host supports.
  425. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  426. * a suffix to the VERSION_CONF message. If the host has specified in the
  427. * VER_REQ message a limit on the number of tx queue groups the host can
  428. * supprt, the target shall limit its specification of the maximum tx groups
  429. * to be no larger than this host-specified limit.
  430. *
  431. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  432. * shall preallocate 4 tx queue group structs, and the target shall not
  433. * specify a txq_group_id larger than 3.
  434. */
  435. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  436. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  437. /*
  438. * values 1 through N specify the max number of tx queue groups
  439. * the sender supports
  440. */
  441. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  442. };
  443. /* TEMPORARY backwards-compatibility alias for a typo fix -
  444. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  445. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  446. * to support the old name (with the typo) until all references to the
  447. * old name are replaced with the new name.
  448. */
  449. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  450. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  451. struct htt_option_tlv_header_t hdr;
  452. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  453. } POSTPACK;
  454. /*
  455. * HTT option TLV for specifying whether the target supports an extended
  456. * version of the HTT tx descriptor. If the target provides this TLV
  457. * and specifies in the TLV that the target supports an extended version
  458. * of the HTT tx descriptor, the target must check the "extension" bit in
  459. * the HTT tx descriptor, and if the extension bit is set, to expect a
  460. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  461. * descriptor. Furthermore, the target must provide room for the HTT
  462. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  463. * This option is intended for systems where the host needs to explicitly
  464. * control the transmission parameters such as tx power for individual
  465. * tx frames.
  466. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  467. * as a suffix to the VERSION_CONF message to explicitly specify whether
  468. * the target supports the HTT tx MSDU extension descriptor.
  469. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  470. * by the host as lack of target support for the HTT tx MSDU extension
  471. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  472. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  473. * the HTT tx MSDU extension descriptor.
  474. * The host is not required to provide the HTT tx MSDU extension descriptor
  475. * just because the target supports it; the target must check the
  476. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  477. * extension descriptor is present.
  478. */
  479. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  480. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  481. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  482. };
  483. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  484. struct htt_option_tlv_header_t hdr;
  485. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  486. } POSTPACK;
  487. /*
  488. * For the tcl data command V2 and higher support added a new
  489. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  490. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  491. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  492. * HTT option TLV for specifying which version of the TCL metadata struct
  493. * should be used:
  494. * V1 -> use htt_tx_tcl_metadata struct
  495. * V2 -> use htt_tx_tcl_metadata_v2 struct
  496. * Old FW will only support V1.
  497. * New FW will support V2. New FW will still support V1, at least during
  498. * a transition period.
  499. * Similarly, old host will only support V1, and new host will support V1 + V2.
  500. *
  501. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  502. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  503. * of TCL metadata the host supports. If the host doesn't provide a
  504. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  505. * is implicitly understood that the host only supports V1.
  506. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  507. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  508. * the host shall use. The target shall only select one of the versions
  509. * supported by the host. If the target doesn't provide a
  510. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  511. * is implicitly understood that the V1 TCL metadata shall be used.
  512. */
  513. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  514. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  515. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  516. };
  517. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  518. struct htt_option_tlv_header_t hdr;
  519. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  520. } POSTPACK;
  521. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  522. HTT_OPTION_TLV_VALUE0_SET(word, value)
  523. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  524. HTT_OPTION_TLV_VALUE0_GET(word)
  525. typedef struct {
  526. union {
  527. /* BIT [11 : 0] :- tag
  528. * BIT [23 : 12] :- length
  529. * BIT [31 : 24] :- reserved
  530. */
  531. A_UINT32 tag__length;
  532. /*
  533. * The following struct is not endian-portable.
  534. * It is suitable for use within the target, which is known to be
  535. * little-endian.
  536. * The host should use the above endian-portable macros to access
  537. * the tag and length bitfields in an endian-neutral manner.
  538. */
  539. struct {
  540. A_UINT32 tag : 12, /* BIT [11 : 0] */
  541. length : 12, /* BIT [23 : 12] */
  542. reserved : 8; /* BIT [31 : 24] */
  543. };
  544. };
  545. } htt_tlv_hdr_t;
  546. typedef enum {
  547. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  548. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  549. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  550. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  551. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  552. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  553. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  554. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  555. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  556. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  557. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  558. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  559. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  560. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  561. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  562. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  563. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  564. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  565. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  566. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  567. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  568. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  569. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  570. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  571. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  572. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  573. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  574. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  575. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  576. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  577. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  578. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  579. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  580. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  581. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  582. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  583. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  584. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  585. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  586. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  587. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  588. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  589. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  590. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  591. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  592. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  593. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  594. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  595. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  596. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  597. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  598. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  599. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  600. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  601. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  602. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  603. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  604. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  605. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  606. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  607. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  608. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  609. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  610. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  611. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  612. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  613. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  614. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  615. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  616. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  617. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  618. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  619. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  620. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  621. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  622. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  623. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  624. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  625. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  626. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  627. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  628. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  629. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  630. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  631. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  632. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  633. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  634. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  635. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  636. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  637. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  638. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  639. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  640. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  641. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  642. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  643. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  644. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  645. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  646. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  647. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  648. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  649. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  650. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  651. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  652. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  653. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  654. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  655. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  656. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  657. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  658. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  659. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  660. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv */
  661. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv */
  662. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv */
  663. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv */
  664. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  665. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  666. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  667. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  668. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  669. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  670. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  671. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  672. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  673. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  674. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  675. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  676. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  677. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  678. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  679. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  680. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  681. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  682. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  683. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  684. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  685. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  686. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  687. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  688. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  689. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  690. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  691. HTT_STATS_MAX_TAG,
  692. } htt_tlv_tag_t;
  693. #define HTT_STATS_TLV_TAG_M 0x00000fff
  694. #define HTT_STATS_TLV_TAG_S 0
  695. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  696. #define HTT_STATS_TLV_LENGTH_S 12
  697. #define HTT_STATS_TLV_TAG_GET(_var) \
  698. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  699. HTT_STATS_TLV_TAG_S)
  700. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  701. do { \
  702. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  703. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  704. } while (0)
  705. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  706. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  707. HTT_STATS_TLV_LENGTH_S)
  708. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  709. do { \
  710. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  711. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  712. } while (0)
  713. /*=== host -> target messages ===============================================*/
  714. enum htt_h2t_msg_type {
  715. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  716. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  717. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  718. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  719. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  720. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  721. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  722. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  723. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  724. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  725. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  726. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  727. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  728. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  729. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  730. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  731. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  732. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  733. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  734. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  735. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  736. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  737. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  738. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  739. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  740. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  741. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  742. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  743. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  744. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  745. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  746. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  747. /* keep this last */
  748. HTT_H2T_NUM_MSGS
  749. };
  750. /*
  751. * HTT host to target message type -
  752. * stored in bits 7:0 of the first word of the message
  753. */
  754. #define HTT_H2T_MSG_TYPE_M 0xff
  755. #define HTT_H2T_MSG_TYPE_S 0
  756. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  757. do { \
  758. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  759. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  760. } while (0)
  761. #define HTT_H2T_MSG_TYPE_GET(word) \
  762. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  763. /**
  764. * @brief host -> target version number request message definition
  765. *
  766. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  767. *
  768. *
  769. * |31 24|23 16|15 8|7 0|
  770. * |----------------+----------------+----------------+----------------|
  771. * | reserved | msg type |
  772. * |-------------------------------------------------------------------|
  773. * : option request TLV (optional) |
  774. * :...................................................................:
  775. *
  776. * The VER_REQ message may consist of a single 4-byte word, or may be
  777. * extended with TLVs that specify which HTT options the host is requesting
  778. * from the target.
  779. * The following option TLVs may be appended to the VER_REQ message:
  780. * - HL_SUPPRESS_TX_COMPL_IND
  781. * - HL_MAX_TX_QUEUE_GROUPS
  782. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  783. * may be appended to the VER_REQ message (but only one TLV of each type).
  784. *
  785. * Header fields:
  786. * - MSG_TYPE
  787. * Bits 7:0
  788. * Purpose: identifies this as a version number request message
  789. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  790. */
  791. #define HTT_VER_REQ_BYTES 4
  792. /* TBDXXX: figure out a reasonable number */
  793. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  794. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  795. /**
  796. * @brief HTT tx MSDU descriptor
  797. *
  798. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  799. *
  800. * @details
  801. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  802. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  803. * the target firmware needs for the FW's tx processing, particularly
  804. * for creating the HW msdu descriptor.
  805. * The same HTT tx descriptor is used for HL and LL systems, though
  806. * a few fields within the tx descriptor are used only by LL or
  807. * only by HL.
  808. * The HTT tx descriptor is defined in two manners: by a struct with
  809. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  810. * definitions.
  811. * The target should use the struct def, for simplicitly and clarity,
  812. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  813. * neutral. Specifically, the host shall use the get/set macros built
  814. * around the mask + shift defs.
  815. */
  816. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  817. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  818. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  819. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  820. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  821. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  822. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  823. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  824. #define HTT_TX_VDEV_ID_WORD 0
  825. #define HTT_TX_VDEV_ID_MASK 0x3f
  826. #define HTT_TX_VDEV_ID_SHIFT 16
  827. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  828. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  829. #define HTT_TX_MSDU_LEN_DWORD 1
  830. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  831. /*
  832. * HTT_VAR_PADDR macros
  833. * Allow physical / bus addresses to be either a single 32-bit value,
  834. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  835. */
  836. #define HTT_VAR_PADDR32(var_name) \
  837. A_UINT32 var_name
  838. #define HTT_VAR_PADDR64_LE(var_name) \
  839. struct { \
  840. /* little-endian: lo precedes hi */ \
  841. A_UINT32 lo; \
  842. A_UINT32 hi; \
  843. } var_name
  844. /*
  845. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  846. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  847. * addresses are stored in a XXX-bit field.
  848. * This macro is used to define both htt_tx_msdu_desc32_t and
  849. * htt_tx_msdu_desc64_t structs.
  850. */
  851. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  852. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  853. { \
  854. /* DWORD 0: flags and meta-data */ \
  855. A_UINT32 \
  856. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  857. \
  858. /* pkt_subtype - \
  859. * Detailed specification of the tx frame contents, extending the \
  860. * general specification provided by pkt_type. \
  861. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  862. * pkt_type | pkt_subtype \
  863. * ============================================================== \
  864. * 802.3 | bit 0:3 - Reserved \
  865. * | bit 4: 0x0 - Copy-Engine Classification Results \
  866. * | not appended to the HTT message \
  867. * | 0x1 - Copy-Engine Classification Results \
  868. * | appended to the HTT message in the \
  869. * | format: \
  870. * | [HTT tx desc, frame header, \
  871. * | CE classification results] \
  872. * | The CE classification results begin \
  873. * | at the next 4-byte boundary after \
  874. * | the frame header. \
  875. * ------------+------------------------------------------------- \
  876. * Eth2 | bit 0:3 - Reserved \
  877. * | bit 4: 0x0 - Copy-Engine Classification Results \
  878. * | not appended to the HTT message \
  879. * | 0x1 - Copy-Engine Classification Results \
  880. * | appended to the HTT message. \
  881. * | See the above specification of the \
  882. * | CE classification results location. \
  883. * ------------+------------------------------------------------- \
  884. * native WiFi | bit 0:3 - Reserved \
  885. * | bit 4: 0x0 - Copy-Engine Classification Results \
  886. * | not appended to the HTT message \
  887. * | 0x1 - Copy-Engine Classification Results \
  888. * | appended to the HTT message. \
  889. * | See the above specification of the \
  890. * | CE classification results location. \
  891. * ------------+------------------------------------------------- \
  892. * mgmt | 0x0 - 802.11 MAC header absent \
  893. * | 0x1 - 802.11 MAC header present \
  894. * ------------+------------------------------------------------- \
  895. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  896. * | 0x1 - 802.11 MAC header present \
  897. * | bit 1: 0x0 - allow aggregation \
  898. * | 0x1 - don't allow aggregation \
  899. * | bit 2: 0x0 - perform encryption \
  900. * | 0x1 - don't perform encryption \
  901. * | bit 3: 0x0 - perform tx classification / queuing \
  902. * | 0x1 - don't perform tx classification; \
  903. * | insert the frame into the "misc" \
  904. * | tx queue \
  905. * | bit 4: 0x0 - Copy-Engine Classification Results \
  906. * | not appended to the HTT message \
  907. * | 0x1 - Copy-Engine Classification Results \
  908. * | appended to the HTT message. \
  909. * | See the above specification of the \
  910. * | CE classification results location. \
  911. */ \
  912. pkt_subtype: 5, \
  913. \
  914. /* pkt_type - \
  915. * General specification of the tx frame contents. \
  916. * The htt_pkt_type enum should be used to specify and check the \
  917. * value of this field. \
  918. */ \
  919. pkt_type: 3, \
  920. \
  921. /* vdev_id - \
  922. * ID for the vdev that is sending this tx frame. \
  923. * For certain non-standard packet types, e.g. pkt_type == raw \
  924. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  925. * This field is used primarily for determining where to queue \
  926. * broadcast and multicast frames. \
  927. */ \
  928. vdev_id: 6, \
  929. /* ext_tid - \
  930. * The extended traffic ID. \
  931. * If the TID is unknown, the extended TID is set to \
  932. * HTT_TX_EXT_TID_INVALID. \
  933. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  934. * value of the QoS TID. \
  935. * If the tx frame is non-QoS data, then the extended TID is set to \
  936. * HTT_TX_EXT_TID_NON_QOS. \
  937. * If the tx frame is multicast or broadcast, then the extended TID \
  938. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  939. */ \
  940. ext_tid: 5, \
  941. \
  942. /* postponed - \
  943. * This flag indicates whether the tx frame has been downloaded to \
  944. * the target before but discarded by the target, and now is being \
  945. * downloaded again; or if this is a new frame that is being \
  946. * downloaded for the first time. \
  947. * This flag allows the target to determine the correct order for \
  948. * transmitting new vs. old frames. \
  949. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  950. * This flag only applies to HL systems, since in LL systems, \
  951. * the tx flow control is handled entirely within the target. \
  952. */ \
  953. postponed: 1, \
  954. \
  955. /* extension - \
  956. * This flag indicates whether a HTT tx MSDU extension descriptor \
  957. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  958. * \
  959. * 0x0 - no extension MSDU descriptor is present \
  960. * 0x1 - an extension MSDU descriptor immediately follows the \
  961. * regular MSDU descriptor \
  962. */ \
  963. extension: 1, \
  964. \
  965. /* cksum_offload - \
  966. * This flag indicates whether checksum offload is enabled or not \
  967. * for this frame. Target FW use this flag to turn on HW checksumming \
  968. * 0x0 - No checksum offload \
  969. * 0x1 - L3 header checksum only \
  970. * 0x2 - L4 checksum only \
  971. * 0x3 - L3 header checksum + L4 checksum \
  972. */ \
  973. cksum_offload: 2, \
  974. \
  975. /* tx_comp_req - \
  976. * This flag indicates whether Tx Completion \
  977. * from fw is required or not. \
  978. * This flag is only relevant if tx completion is not \
  979. * universally enabled. \
  980. * For all LL systems, tx completion is mandatory, \
  981. * so this flag will be irrelevant. \
  982. * For HL systems tx completion is optional, but HL systems in which \
  983. * the bus throughput exceeds the WLAN throughput will \
  984. * probably want to always use tx completion, and thus \
  985. * would not check this flag. \
  986. * This flag is required when tx completions are not used universally, \
  987. * but are still required for certain tx frames for which \
  988. * an OTA delivery acknowledgment is needed by the host. \
  989. * In practice, this would be for HL systems in which the \
  990. * bus throughput is less than the WLAN throughput. \
  991. * \
  992. * 0x0 - Tx Completion Indication from Fw not required \
  993. * 0x1 - Tx Completion Indication from Fw is required \
  994. */ \
  995. tx_compl_req: 1; \
  996. \
  997. \
  998. /* DWORD 1: MSDU length and ID */ \
  999. A_UINT32 \
  1000. len: 16, /* MSDU length, in bytes */ \
  1001. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1002. * and this id is used to calculate fragmentation \
  1003. * descriptor pointer inside the target based on \
  1004. * the base address, configured inside the target. \
  1005. */ \
  1006. \
  1007. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1008. /* frags_desc_ptr - \
  1009. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1010. * where the tx frame's fragments reside in memory. \
  1011. * This field only applies to LL systems, since in HL systems the \
  1012. * (degenerate single-fragment) fragmentation descriptor is created \
  1013. * within the target. \
  1014. */ \
  1015. _paddr__frags_desc_ptr_; \
  1016. \
  1017. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1018. /* \
  1019. * Peer ID : Target can use this value to know which peer-id packet \
  1020. * destined to. \
  1021. * It's intended to be specified by host in case of NAWDS. \
  1022. */ \
  1023. A_UINT16 peerid; \
  1024. \
  1025. /* \
  1026. * Channel frequency: This identifies the desired channel \
  1027. * frequency (in mhz) for tx frames. This is used by FW to help \
  1028. * determine when it is safe to transmit or drop frames for \
  1029. * off-channel operation. \
  1030. * The default value of zero indicates to FW that the corresponding \
  1031. * VDEV's home channel (if there is one) is the desired channel \
  1032. * frequency. \
  1033. */ \
  1034. A_UINT16 chanfreq; \
  1035. \
  1036. /* Reason reserved is commented is increasing the htt structure size \
  1037. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1038. * A_UINT32 reserved_dword3_bits0_31; \
  1039. */ \
  1040. } POSTPACK
  1041. /* define a htt_tx_msdu_desc32_t type */
  1042. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1043. /* define a htt_tx_msdu_desc64_t type */
  1044. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1045. /*
  1046. * Make htt_tx_msdu_desc_t be an alias for either
  1047. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1048. */
  1049. #if HTT_PADDR64
  1050. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1051. #else
  1052. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1053. #endif
  1054. /* decriptor information for Management frame*/
  1055. /*
  1056. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1057. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1058. */
  1059. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1060. extern A_UINT32 mgmt_hdr_len;
  1061. PREPACK struct htt_mgmt_tx_desc_t {
  1062. A_UINT32 msg_type;
  1063. #if HTT_PADDR64
  1064. A_UINT64 frag_paddr; /* DMAble address of the data */
  1065. #else
  1066. A_UINT32 frag_paddr; /* DMAble address of the data */
  1067. #endif
  1068. A_UINT32 desc_id; /* returned to host during completion
  1069. * to free the meory*/
  1070. A_UINT32 len; /* Fragment length */
  1071. A_UINT32 vdev_id; /* virtual device ID*/
  1072. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1073. } POSTPACK;
  1074. PREPACK struct htt_mgmt_tx_compl_ind {
  1075. A_UINT32 desc_id;
  1076. A_UINT32 status;
  1077. } POSTPACK;
  1078. /*
  1079. * This SDU header size comes from the summation of the following:
  1080. * 1. Max of:
  1081. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1082. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1083. * b. 802.11 header, for raw frames: 36 bytes
  1084. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1085. * QoS header, HT header)
  1086. * c. 802.3 header, for ethernet frames: 14 bytes
  1087. * (destination address, source address, ethertype / length)
  1088. * 2. Max of:
  1089. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1090. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1091. * 3. 802.1Q VLAN header: 4 bytes
  1092. * 4. LLC/SNAP header: 8 bytes
  1093. */
  1094. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1095. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1096. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1097. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1098. A_COMPILE_TIME_ASSERT(
  1099. htt_encap_hdr_size_max_check_nwifi,
  1100. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1101. A_COMPILE_TIME_ASSERT(
  1102. htt_encap_hdr_size_max_check_enet,
  1103. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1104. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1105. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1106. #define HTT_TX_HDR_SIZE_802_1Q 4
  1107. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1108. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1109. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1110. HTT_TX_HDR_SIZE_802_1Q + \
  1111. HTT_TX_HDR_SIZE_LLC_SNAP)
  1112. #define HTT_HL_TX_FRM_HDR_LEN \
  1113. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1114. #define HTT_LL_TX_FRM_HDR_LEN \
  1115. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1116. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1117. /* dword 0 */
  1118. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1119. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1120. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1121. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1122. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1123. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1124. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1125. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1126. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1127. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1128. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1129. #define HTT_TX_DESC_PKT_TYPE_S 13
  1130. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1131. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1132. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1133. #define HTT_TX_DESC_VDEV_ID_S 16
  1134. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1135. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1136. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1137. #define HTT_TX_DESC_EXT_TID_S 22
  1138. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1139. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1140. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1141. #define HTT_TX_DESC_POSTPONED_S 27
  1142. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1143. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1144. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1145. #define HTT_TX_DESC_EXTENSION_S 28
  1146. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1147. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1148. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1149. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1150. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1151. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1152. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1153. #define HTT_TX_DESC_TX_COMP_S 31
  1154. /* dword 1 */
  1155. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1156. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1157. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1158. #define HTT_TX_DESC_FRM_LEN_S 0
  1159. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1160. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1161. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1162. #define HTT_TX_DESC_FRM_ID_S 16
  1163. /* dword 2 */
  1164. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1165. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1166. /* for systems using 64-bit format for bus addresses */
  1167. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1168. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1169. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1170. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1171. /* for systems using 32-bit format for bus addresses */
  1172. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1173. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1174. /* dword 3 */
  1175. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1176. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1177. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1178. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1179. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1180. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1181. #if HTT_PADDR64
  1182. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1183. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1184. #else
  1185. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1186. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1187. #endif
  1188. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1189. #define HTT_TX_DESC_PEER_ID_S 0
  1190. /*
  1191. * TEMPORARY:
  1192. * The original definitions for the PEER_ID fields contained typos
  1193. * (with _DESC_PADDR appended to this PEER_ID field name).
  1194. * Retain deprecated original names for PEER_ID fields until all code that
  1195. * refers to them has been updated.
  1196. */
  1197. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1198. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1199. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1200. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1201. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1202. HTT_TX_DESC_PEER_ID_M
  1203. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1204. HTT_TX_DESC_PEER_ID_S
  1205. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1206. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1207. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1208. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1209. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1210. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1211. #if HTT_PADDR64
  1212. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1213. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1214. #else
  1215. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1216. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1217. #endif
  1218. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1219. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1220. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1221. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1222. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1223. do { \
  1224. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1225. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1226. } while (0)
  1227. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1228. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1229. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1230. do { \
  1231. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1232. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1233. } while (0)
  1234. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1235. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1236. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1237. do { \
  1238. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1239. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1240. } while (0)
  1241. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1242. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1243. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1244. do { \
  1245. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1246. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1247. } while (0)
  1248. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1249. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1250. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1251. do { \
  1252. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1253. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1254. } while (0)
  1255. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1256. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1257. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1258. do { \
  1259. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1260. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1261. } while (0)
  1262. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1263. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1264. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1265. do { \
  1266. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1267. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1268. } while (0)
  1269. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1270. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1271. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1272. do { \
  1273. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1274. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1275. } while (0)
  1276. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1277. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1278. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1279. do { \
  1280. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1281. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1282. } while (0)
  1283. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1284. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1285. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1286. do { \
  1287. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1288. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1289. } while (0)
  1290. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1291. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1292. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1293. do { \
  1294. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1295. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1296. } while (0)
  1297. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1298. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1299. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1300. do { \
  1301. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1302. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1303. } while (0)
  1304. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1305. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1306. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1307. do { \
  1308. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1309. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1310. } while (0)
  1311. /* enums used in the HTT tx MSDU extension descriptor */
  1312. enum {
  1313. htt_tx_guard_interval_regular = 0,
  1314. htt_tx_guard_interval_short = 1,
  1315. };
  1316. enum {
  1317. htt_tx_preamble_type_ofdm = 0,
  1318. htt_tx_preamble_type_cck = 1,
  1319. htt_tx_preamble_type_ht = 2,
  1320. htt_tx_preamble_type_vht = 3,
  1321. };
  1322. enum {
  1323. htt_tx_bandwidth_5MHz = 0,
  1324. htt_tx_bandwidth_10MHz = 1,
  1325. htt_tx_bandwidth_20MHz = 2,
  1326. htt_tx_bandwidth_40MHz = 3,
  1327. htt_tx_bandwidth_80MHz = 4,
  1328. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1329. };
  1330. /**
  1331. * @brief HTT tx MSDU extension descriptor
  1332. * @details
  1333. * If the target supports HTT tx MSDU extension descriptors, the host has
  1334. * the option of appending the following struct following the regular
  1335. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1336. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1337. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1338. * tx specs for each frame.
  1339. */
  1340. PREPACK struct htt_tx_msdu_desc_ext_t {
  1341. /* DWORD 0: flags */
  1342. A_UINT32
  1343. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1344. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1345. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1346. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1347. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1348. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1349. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1350. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1351. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1352. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1353. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1354. /* DWORD 1: tx power, tx rate, tx BW */
  1355. A_UINT32
  1356. /* pwr -
  1357. * Specify what power the tx frame needs to be transmitted at.
  1358. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1359. * The value needs to be appropriately sign-extended when extracting
  1360. * the value from the message and storing it in a variable that is
  1361. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1362. * automatically handles this sign-extension.)
  1363. * If the transmission uses multiple tx chains, this power spec is
  1364. * the total transmit power, assuming incoherent combination of
  1365. * per-chain power to produce the total power.
  1366. */
  1367. pwr: 8,
  1368. /* mcs_mask -
  1369. * Specify the allowable values for MCS index (modulation and coding)
  1370. * to use for transmitting the frame.
  1371. *
  1372. * For HT / VHT preamble types, this mask directly corresponds to
  1373. * the HT or VHT MCS indices that are allowed. For each bit N set
  1374. * within the mask, MCS index N is allowed for transmitting the frame.
  1375. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1376. * rates versus OFDM rates, so the host has the option of specifying
  1377. * that the target must transmit the frame with CCK or OFDM rates
  1378. * (not HT or VHT), but leaving the decision to the target whether
  1379. * to use CCK or OFDM.
  1380. *
  1381. * For CCK and OFDM, the bits within this mask are interpreted as
  1382. * follows:
  1383. * bit 0 -> CCK 1 Mbps rate is allowed
  1384. * bit 1 -> CCK 2 Mbps rate is allowed
  1385. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1386. * bit 3 -> CCK 11 Mbps rate is allowed
  1387. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1388. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1389. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1390. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1391. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1392. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1393. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1394. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1395. *
  1396. * The MCS index specification needs to be compatible with the
  1397. * bandwidth mask specification. For example, a MCS index == 9
  1398. * specification is inconsistent with a preamble type == VHT,
  1399. * Nss == 1, and channel bandwidth == 20 MHz.
  1400. *
  1401. * Furthermore, the host has only a limited ability to specify to
  1402. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1403. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1404. */
  1405. mcs_mask: 12,
  1406. /* nss_mask -
  1407. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1408. * Each bit in this mask corresponds to a Nss value:
  1409. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1410. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1411. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1412. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1413. * The values in the Nss mask must be suitable for the recipient, e.g.
  1414. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1415. * recipient which only supports 2x2 MIMO.
  1416. */
  1417. nss_mask: 4,
  1418. /* guard_interval -
  1419. * Specify a htt_tx_guard_interval enum value to indicate whether
  1420. * the transmission should use a regular guard interval or a
  1421. * short guard interval.
  1422. */
  1423. guard_interval: 1,
  1424. /* preamble_type_mask -
  1425. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1426. * may choose from for transmitting this frame.
  1427. * The bits in this mask correspond to the values in the
  1428. * htt_tx_preamble_type enum. For example, to allow the target
  1429. * to transmit the frame as either CCK or OFDM, this field would
  1430. * be set to
  1431. * (1 << htt_tx_preamble_type_ofdm) |
  1432. * (1 << htt_tx_preamble_type_cck)
  1433. */
  1434. preamble_type_mask: 4,
  1435. reserved1_31_29: 3; /* unused, set to 0x0 */
  1436. /* DWORD 2: tx chain mask, tx retries */
  1437. A_UINT32
  1438. /* chain_mask - specify which chains to transmit from */
  1439. chain_mask: 4,
  1440. /* retry_limit -
  1441. * Specify the maximum number of transmissions, including the
  1442. * initial transmission, to attempt before giving up if no ack
  1443. * is received.
  1444. * If the tx rate is specified, then all retries shall use the
  1445. * same rate as the initial transmission.
  1446. * If no tx rate is specified, the target can choose whether to
  1447. * retain the original rate during the retransmissions, or to
  1448. * fall back to a more robust rate.
  1449. */
  1450. retry_limit: 4,
  1451. /* bandwidth_mask -
  1452. * Specify what channel widths may be used for the transmission.
  1453. * A value of zero indicates "don't care" - the target may choose
  1454. * the transmission bandwidth.
  1455. * The bits within this mask correspond to the htt_tx_bandwidth
  1456. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1457. * The bandwidth_mask must be consistent with the preamble_type_mask
  1458. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1459. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1460. */
  1461. bandwidth_mask: 6,
  1462. reserved2_31_14: 18; /* unused, set to 0x0 */
  1463. /* DWORD 3: tx expiry time (TSF) LSBs */
  1464. A_UINT32 expire_tsf_lo;
  1465. /* DWORD 4: tx expiry time (TSF) MSBs */
  1466. A_UINT32 expire_tsf_hi;
  1467. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1468. } POSTPACK;
  1469. /* DWORD 0 */
  1470. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1471. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1472. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1473. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1474. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1475. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1476. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1477. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1478. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1479. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1480. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1481. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1482. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1483. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1484. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1485. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1486. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1487. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1488. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1489. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1490. /* DWORD 1 */
  1491. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1492. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1493. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1494. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1495. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1496. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1497. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1498. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1499. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1500. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1501. /* DWORD 2 */
  1502. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1503. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1504. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1505. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1506. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1507. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1508. /* DWORD 0 */
  1509. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1510. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1511. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1512. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1513. do { \
  1514. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1515. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1516. } while (0)
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1518. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1519. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1520. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1521. do { \
  1522. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1523. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1524. } while (0)
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1526. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1527. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1528. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1529. do { \
  1530. HTT_CHECK_SET_VAL( \
  1531. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1532. ((_var) |= ((_val) \
  1533. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1534. } while (0)
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1536. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1537. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1538. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1539. do { \
  1540. HTT_CHECK_SET_VAL( \
  1541. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1542. ((_var) |= ((_val) \
  1543. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1544. } while (0)
  1545. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1546. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1547. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1548. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1549. do { \
  1550. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1551. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1552. } while (0)
  1553. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1554. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1555. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1556. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1557. do { \
  1558. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1559. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1560. } while (0)
  1561. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1562. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1563. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1564. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1565. do { \
  1566. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1567. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1568. } while (0)
  1569. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1570. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1571. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1572. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1573. do { \
  1574. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1575. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1576. } while (0)
  1577. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1578. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1579. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1580. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1581. do { \
  1582. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1583. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1584. } while (0)
  1585. /* DWORD 1 */
  1586. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1587. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1588. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1589. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1590. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1591. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1592. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1593. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1594. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1595. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1596. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1597. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1598. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1599. do { \
  1600. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1601. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1602. } while (0)
  1603. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1604. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1605. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1606. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1607. do { \
  1608. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1609. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1610. } while (0)
  1611. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1612. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1613. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1614. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1615. do { \
  1616. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1617. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1618. } while (0)
  1619. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1620. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1621. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1622. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1623. do { \
  1624. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1625. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1626. } while (0)
  1627. /* DWORD 2 */
  1628. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1629. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1630. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1631. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1632. do { \
  1633. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1634. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1635. } while (0)
  1636. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1637. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1638. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1639. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1640. do { \
  1641. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1642. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1643. } while (0)
  1644. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1645. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1646. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1647. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1648. do { \
  1649. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1650. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1651. } while (0)
  1652. typedef enum {
  1653. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1654. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1655. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1656. } htt_11ax_ltf_subtype_t;
  1657. typedef enum {
  1658. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1659. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1660. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1661. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1662. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1663. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1664. } htt_tx_ext2_preamble_type_t;
  1665. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1666. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1667. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1668. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1669. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1670. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1671. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1672. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1673. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1674. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1675. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1676. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1677. /**
  1678. * @brief HTT tx MSDU extension descriptor v2
  1679. * @details
  1680. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1681. * is received as tcl_exit_base->host_meta_info in firmware.
  1682. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1683. * are already part of tcl_exit_base.
  1684. */
  1685. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1686. /* DWORD 0: flags */
  1687. A_UINT32
  1688. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1689. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1690. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1691. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1692. valid_retries : 1, /* if set, tx retries spec is valid */
  1693. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1694. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1695. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1696. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1697. valid_key_flags : 1, /* if set, key flags is valid */
  1698. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1699. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1700. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1701. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1702. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1703. 1 = ENCRYPT,
  1704. 2 ~ 3 - Reserved */
  1705. /* retry_limit -
  1706. * Specify the maximum number of transmissions, including the
  1707. * initial transmission, to attempt before giving up if no ack
  1708. * is received.
  1709. * If the tx rate is specified, then all retries shall use the
  1710. * same rate as the initial transmission.
  1711. * If no tx rate is specified, the target can choose whether to
  1712. * retain the original rate during the retransmissions, or to
  1713. * fall back to a more robust rate.
  1714. */
  1715. retry_limit : 4,
  1716. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1717. * Valid only for 11ax preamble types HE_SU
  1718. * and HE_EXT_SU
  1719. */
  1720. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1721. * Valid only for 11ax preamble types HE_SU
  1722. * and HE_EXT_SU
  1723. */
  1724. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1725. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1726. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1727. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1728. */
  1729. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1730. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1731. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1732. * Use cases:
  1733. * Any time firmware uses TQM-BYPASS for Data
  1734. * TID, firmware expect host to set this bit.
  1735. */
  1736. /* DWORD 1: tx power, tx rate */
  1737. A_UINT32
  1738. power : 8, /* unit of the power field is 0.5 dbm
  1739. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1740. * signed value ranging from -64dbm to 63.5 dbm
  1741. */
  1742. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1743. * Setting more than one MCS isn't currently
  1744. * supported by the target (but is supported
  1745. * in the interface in case in the future
  1746. * the target supports specifications of
  1747. * a limited set of MCS values.
  1748. */
  1749. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1750. * Setting more than one Nss 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 Nss values.
  1755. */
  1756. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1757. update_peer_cache : 1; /* When set these custom values will be
  1758. * used for all packets, until the next
  1759. * update via this ext header.
  1760. * This is to make sure not all packets
  1761. * need to include this header.
  1762. */
  1763. /* DWORD 2: tx chain mask, tx retries */
  1764. A_UINT32
  1765. /* chain_mask - specify which chains to transmit from */
  1766. chain_mask : 8,
  1767. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1768. * TODO: Update Enum values for key_flags
  1769. */
  1770. /*
  1771. * Channel frequency: This identifies the desired channel
  1772. * frequency (in MHz) for tx frames. This is used by FW to help
  1773. * determine when it is safe to transmit or drop frames for
  1774. * off-channel operation.
  1775. * The default value of zero indicates to FW that the corresponding
  1776. * VDEV's home channel (if there is one) is the desired channel
  1777. * frequency.
  1778. */
  1779. chanfreq : 16;
  1780. /* DWORD 3: tx expiry time (TSF) LSBs */
  1781. A_UINT32 expire_tsf_lo;
  1782. /* DWORD 4: tx expiry time (TSF) MSBs */
  1783. A_UINT32 expire_tsf_hi;
  1784. /* DWORD 5: flags to control routing / processing of the MSDU */
  1785. A_UINT32
  1786. /* learning_frame
  1787. * When this flag is set, this frame will be dropped by FW
  1788. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1789. */
  1790. learning_frame : 1,
  1791. /* send_as_standalone
  1792. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1793. * i.e. with no A-MSDU or A-MPDU aggregation.
  1794. * The scope is extended to other use-cases.
  1795. */
  1796. send_as_standalone : 1,
  1797. /* is_host_opaque_valid
  1798. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1799. * with valid information.
  1800. */
  1801. is_host_opaque_valid : 1,
  1802. rsvd0 : 29;
  1803. /* DWORD 6 : Host opaque cookie for special frames */
  1804. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1805. rsvd1 : 16;
  1806. /*
  1807. * This structure can be expanded further up to 40 bytes
  1808. * by adding further DWORDs as needed.
  1809. */
  1810. } POSTPACK;
  1811. /* DWORD 0 */
  1812. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1813. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1814. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1815. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1816. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1817. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1818. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1819. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1820. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1821. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1822. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1823. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1824. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1825. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1826. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1827. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1828. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1829. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1830. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1831. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1832. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1833. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1834. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1835. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1836. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1837. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1838. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1839. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1840. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1841. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1842. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1843. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1844. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1845. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1846. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1847. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1848. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1849. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1850. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1851. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1852. /* DWORD 1 */
  1853. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1854. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1855. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1856. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1857. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1858. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1859. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1860. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1861. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1862. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1863. /* DWORD 2 */
  1864. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1865. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1866. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1867. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1868. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1869. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1870. /* DWORD 5 */
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1877. /* DWORD 6 */
  1878. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1879. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1880. /* DWORD 0 */
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1882. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1883. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1885. do { \
  1886. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1887. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1888. } while (0)
  1889. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1890. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1891. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1892. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1893. do { \
  1894. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1895. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1896. } while (0)
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1898. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1899. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1900. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1901. do { \
  1902. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1903. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1904. } while (0)
  1905. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1906. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1907. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1908. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1909. do { \
  1910. HTT_CHECK_SET_VAL( \
  1911. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1912. ((_var) |= ((_val) \
  1913. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1914. } while (0)
  1915. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1916. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1917. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1918. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1919. do { \
  1920. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1921. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1922. } while (0)
  1923. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1924. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1925. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1926. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1927. do { \
  1928. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1929. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1930. } while (0)
  1931. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1932. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1933. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1934. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1935. do { \
  1936. HTT_CHECK_SET_VAL( \
  1937. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1938. ((_var) |= ((_val) \
  1939. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1940. } while (0)
  1941. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1942. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1943. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1944. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1945. do { \
  1946. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1947. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1948. } while (0)
  1949. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1950. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1951. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1952. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1953. do { \
  1954. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1955. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1956. } while (0)
  1957. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1958. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1959. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1960. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1961. do { \
  1962. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1963. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1964. } while (0)
  1965. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1966. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1967. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1968. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1969. do { \
  1970. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1971. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1972. } while (0)
  1973. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1974. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1975. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  1976. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  1977. do { \
  1978. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  1979. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  1980. } while (0)
  1981. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  1982. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  1983. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  1984. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1985. do { \
  1986. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  1987. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  1988. } while (0)
  1989. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  1990. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  1991. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  1992. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1993. do { \
  1994. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  1995. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  1996. } while (0)
  1997. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  1998. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  1999. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2000. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2001. do { \
  2002. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2003. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2004. } while (0)
  2005. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2006. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2007. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2008. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2009. do { \
  2010. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2011. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2012. } while (0)
  2013. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2014. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2015. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2016. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2017. do { \
  2018. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2019. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2020. } while (0)
  2021. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2022. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2023. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2024. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2025. do { \
  2026. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2027. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2028. } while (0)
  2029. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2030. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2031. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2032. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2033. do { \
  2034. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2035. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2036. } while (0)
  2037. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2038. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2039. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2040. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2041. do { \
  2042. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2043. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2044. } while (0)
  2045. /* DWORD 1 */
  2046. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2047. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2048. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2049. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2050. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2051. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2052. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2053. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2054. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2055. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2056. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2057. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2058. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2059. do { \
  2060. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2061. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2062. } while (0)
  2063. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2064. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2065. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2066. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2067. do { \
  2068. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2069. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2070. } while (0)
  2071. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2072. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2073. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2074. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2075. do { \
  2076. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2077. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2078. } while (0)
  2079. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2080. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2081. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2082. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2083. do { \
  2084. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2085. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2086. } while (0)
  2087. /* DWORD 2 */
  2088. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2089. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2090. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2091. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2092. do { \
  2093. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2094. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2095. } while (0)
  2096. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2097. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2098. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2099. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2100. do { \
  2101. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2102. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2103. } while (0)
  2104. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2105. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2106. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2107. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2108. do { \
  2109. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2110. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2111. } while (0)
  2112. /* DWORD 5 */
  2113. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2114. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2115. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2116. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2117. do { \
  2118. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2119. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2120. } while (0)
  2121. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2122. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2123. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2124. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2125. do { \
  2126. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2127. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2128. } while (0)
  2129. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2130. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2131. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2132. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2133. do { \
  2134. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2135. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2136. } while (0)
  2137. /* DWORD 6 */
  2138. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2139. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2140. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2141. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2142. do { \
  2143. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2144. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2145. } while (0)
  2146. typedef enum {
  2147. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2148. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2149. } htt_tcl_metadata_type;
  2150. /**
  2151. * @brief HTT TCL command number format
  2152. * @details
  2153. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2154. * available to firmware as tcl_exit_base->tcl_status_number.
  2155. * For regular / multicast packets host will send vdev and mac id and for
  2156. * NAWDS packets, host will send peer id.
  2157. * A_UINT32 is used to avoid endianness conversion problems.
  2158. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2159. */
  2160. typedef struct {
  2161. A_UINT32
  2162. type: 1, /* vdev_id based or peer_id based */
  2163. rsvd: 31;
  2164. } htt_tx_tcl_vdev_or_peer_t;
  2165. typedef struct {
  2166. A_UINT32
  2167. type: 1, /* vdev_id based or peer_id based */
  2168. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2169. vdev_id: 8,
  2170. pdev_id: 2,
  2171. host_inspected:1,
  2172. rsvd: 19;
  2173. } htt_tx_tcl_vdev_metadata;
  2174. typedef struct {
  2175. A_UINT32
  2176. type: 1, /* vdev_id based or peer_id based */
  2177. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2178. peer_id: 14,
  2179. rsvd: 16;
  2180. } htt_tx_tcl_peer_metadata;
  2181. PREPACK struct htt_tx_tcl_metadata {
  2182. union {
  2183. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2184. htt_tx_tcl_vdev_metadata vdev_meta;
  2185. htt_tx_tcl_peer_metadata peer_meta;
  2186. };
  2187. } POSTPACK;
  2188. /* DWORD 0 */
  2189. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2190. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2191. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2192. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2193. /* VDEV metadata */
  2194. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2195. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2196. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2197. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2198. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2199. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2200. /* PEER metadata */
  2201. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2202. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2203. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2204. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2205. HTT_TX_TCL_METADATA_TYPE_S)
  2206. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2207. do { \
  2208. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2209. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2210. } while (0)
  2211. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2212. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2213. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2214. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2215. do { \
  2216. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2217. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2218. } while (0)
  2219. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2220. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2221. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2222. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2223. do { \
  2224. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2225. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2226. } while (0)
  2227. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2228. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2229. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2230. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2231. do { \
  2232. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2233. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2234. } while (0)
  2235. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2236. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2237. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2238. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2239. do { \
  2240. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2241. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2242. } while (0)
  2243. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2244. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2245. HTT_TX_TCL_METADATA_PEER_ID_S)
  2246. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2247. do { \
  2248. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2249. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2250. } while (0)
  2251. /*------------------------------------------------------------------
  2252. * V2 Version of TCL Data Command
  2253. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2254. * MLO global_seq all flavours of TCL Data Cmd.
  2255. *-----------------------------------------------------------------*/
  2256. typedef enum {
  2257. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2258. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2259. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2260. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2261. } htt_tcl_metadata_type_v2;
  2262. /**
  2263. * @brief HTT TCL command number format
  2264. * @details
  2265. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2266. * available to firmware as tcl_exit_base->tcl_status_number.
  2267. * A_UINT32 is used to avoid endianness conversion problems.
  2268. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2269. */
  2270. typedef struct {
  2271. A_UINT32
  2272. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2273. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2274. vdev_id: 8,
  2275. pdev_id: 2,
  2276. host_inspected:1,
  2277. rsvd: 2,
  2278. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2279. } htt_tx_tcl_vdev_metadata_v2;
  2280. typedef struct {
  2281. A_UINT32
  2282. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2283. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2284. peer_id: 13,
  2285. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2286. } htt_tx_tcl_peer_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. svc_class_id: 8,
  2292. rsvd: 5,
  2293. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2294. } htt_tx_tcl_svc_class_id_metadata;
  2295. typedef struct {
  2296. A_UINT32
  2297. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2298. host_inspected: 1,
  2299. global_seq_no: 12,
  2300. rsvd: 1,
  2301. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2302. } htt_tx_tcl_global_seq_metadata;
  2303. PREPACK struct htt_tx_tcl_metadata_v2 {
  2304. union {
  2305. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2306. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2307. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2308. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2309. };
  2310. } POSTPACK;
  2311. /* DWORD 0 */
  2312. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2313. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2314. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2315. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2316. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2317. /* VDEV V2 metadata */
  2318. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2319. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2320. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2321. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2322. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2323. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2324. /* PEER V2 metadata */
  2325. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2326. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2327. /* SVC_CLASS_ID metadata */
  2328. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2329. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2330. /* Global Seq no metadata */
  2331. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2332. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2333. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2334. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2335. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2336. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2337. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2338. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2339. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2340. do { \
  2341. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2342. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2343. } while (0)
  2344. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2345. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2346. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2347. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2348. do { \
  2349. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2350. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2351. } while (0)
  2352. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2353. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2354. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2355. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2356. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2357. do { \
  2358. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2359. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2360. } while (0)
  2361. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2362. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2363. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2364. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2365. do { \
  2366. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2367. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2368. } while (0)
  2369. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2370. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2371. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2372. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2373. do { \
  2374. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2375. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2376. } while (0)
  2377. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2378. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2379. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2380. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2381. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2382. do { \
  2383. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2384. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2385. } while (0)
  2386. /*----- Get and Set V2 type field in Service Class fields ----*/
  2387. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2388. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2389. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2390. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2391. do { \
  2392. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2393. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2394. } while (0)
  2395. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2396. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2397. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2398. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2399. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2400. do { \
  2401. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2402. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2403. } while (0)
  2404. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2405. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2406. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2407. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2408. do { \
  2409. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2410. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2411. } while (0)
  2412. /*------------------------------------------------------------------
  2413. * End V2 Version of TCL Data Command
  2414. *-----------------------------------------------------------------*/
  2415. typedef enum {
  2416. HTT_TX_FW2WBM_TX_STATUS_OK,
  2417. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2418. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2419. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2420. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2421. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2422. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2423. HTT_TX_FW2WBM_TX_STATUS_MAX
  2424. } htt_tx_fw2wbm_tx_status_t;
  2425. typedef enum {
  2426. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2427. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2428. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2429. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2430. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2431. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2432. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2433. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2434. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2435. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2436. } htt_tx_fw2wbm_reinject_reason_t;
  2437. /**
  2438. * @brief HTT TX WBM Completion from firmware to host
  2439. * @details
  2440. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2441. * DWORD 3 and 4 for software based completions (Exception frames and
  2442. * TQM bypass frames)
  2443. * For software based completions, wbm_release_ring->release_source_module will
  2444. * be set to release_source_fw
  2445. */
  2446. PREPACK struct htt_tx_wbm_completion {
  2447. A_UINT32
  2448. sch_cmd_id: 24,
  2449. exception_frame: 1, /* If set, this packet was queued via exception path */
  2450. rsvd0_31_25: 7;
  2451. A_UINT32
  2452. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2453. * reception of an ACK or BA, this field indicates
  2454. * the RSSI of the received ACK or BA frame.
  2455. * When the frame is removed as result of a direct
  2456. * remove command from the SW, this field is set
  2457. * to 0x0 (which is never a valid value when real
  2458. * RSSI is available).
  2459. * Units: dB w.r.t noise floor
  2460. */
  2461. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2462. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2463. rsvd1_31_16: 16;
  2464. } POSTPACK;
  2465. /* DWORD 0 */
  2466. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2467. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2468. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2469. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2470. /* DWORD 1 */
  2471. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2472. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2473. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2474. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2475. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2476. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2477. /* DWORD 0 */
  2478. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2479. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2480. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2481. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2482. do { \
  2483. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2484. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2485. } while (0)
  2486. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2487. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2488. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2489. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2490. do { \
  2491. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2492. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2493. } while (0)
  2494. /* DWORD 1 */
  2495. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2496. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2497. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2498. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2499. do { \
  2500. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2501. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2502. } while (0)
  2503. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2504. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2505. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2506. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2507. do { \
  2508. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2509. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2510. } while (0)
  2511. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2512. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2513. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2514. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2515. do { \
  2516. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2517. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2518. } while (0)
  2519. /**
  2520. * @brief HTT TX WBM Completion from firmware to host
  2521. * @details
  2522. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2523. * (WBM) offload HW.
  2524. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2525. * For software based completions, release_source_module will
  2526. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2527. * struct wbm_release_ring and then switch to this after looking at
  2528. * release_source_module.
  2529. */
  2530. PREPACK struct htt_tx_wbm_completion_v2 {
  2531. A_UINT32
  2532. used_by_hw0; /* Refer to struct wbm_release_ring */
  2533. A_UINT32
  2534. used_by_hw1; /* Refer to struct wbm_release_ring */
  2535. A_UINT32
  2536. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2537. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2538. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2539. exception_frame: 1,
  2540. rsvd0: 12, /* For future use */
  2541. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2542. rsvd1: 1; /* For future use */
  2543. A_UINT32
  2544. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2545. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2546. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2547. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2548. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2549. */
  2550. A_UINT32
  2551. data1: 32;
  2552. A_UINT32
  2553. data2: 32;
  2554. A_UINT32
  2555. used_by_hw3; /* Refer to struct wbm_release_ring */
  2556. } POSTPACK;
  2557. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2558. /* DWORD 3 */
  2559. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2560. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2561. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2562. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2563. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2564. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2565. /* DWORD 3 */
  2566. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2567. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2568. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2569. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2570. do { \
  2571. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2572. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2573. } while (0)
  2574. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2575. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2576. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2577. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2578. do { \
  2579. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2580. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2581. } while (0)
  2582. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2583. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2584. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2585. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2586. do { \
  2587. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2588. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2589. } while (0)
  2590. /**
  2591. * @brief HTT TX WBM Completion from firmware to host (V3)
  2592. * @details
  2593. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2594. * (WBM) offload HW.
  2595. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2596. * For software based completions, release_source_module will
  2597. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2598. * struct wbm_release_ring and then switch to this after looking at
  2599. * release_source_module.
  2600. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2601. * by new generations of targets.
  2602. */
  2603. PREPACK struct htt_tx_wbm_completion_v3 {
  2604. A_UINT32
  2605. used_by_hw0; /* Refer to struct wbm_release_ring */
  2606. A_UINT32
  2607. used_by_hw1; /* Refer to struct wbm_release_ring */
  2608. A_UINT32
  2609. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2610. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2611. used_by_hw3: 15;
  2612. A_UINT32
  2613. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2614. exception_frame: 1,
  2615. rsvd0: 27; /* For future use */
  2616. A_UINT32
  2617. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2618. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2619. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2620. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2621. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2622. */
  2623. A_UINT32
  2624. data1: 32;
  2625. A_UINT32
  2626. data2: 32;
  2627. A_UINT32
  2628. rsvd1: 20,
  2629. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2630. } POSTPACK;
  2631. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2632. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2633. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2634. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2635. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2636. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2637. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2638. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2639. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2640. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2641. do { \
  2642. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2643. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2644. } while (0)
  2645. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2646. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2647. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2648. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2649. do { \
  2650. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2651. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2652. } while (0)
  2653. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2654. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2655. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2656. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2657. do { \
  2658. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2659. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2660. } while (0)
  2661. typedef enum {
  2662. TX_FRAME_TYPE_UNDEFINED = 0,
  2663. TX_FRAME_TYPE_EAPOL = 1,
  2664. } htt_tx_wbm_status_frame_type;
  2665. /**
  2666. * @brief HTT TX WBM transmit status from firmware to host
  2667. * @details
  2668. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2669. * (WBM) offload HW.
  2670. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2671. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2672. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2673. */
  2674. PREPACK struct htt_tx_wbm_transmit_status {
  2675. A_UINT32
  2676. sch_cmd_id: 24,
  2677. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2678. * reception of an ACK or BA, this field indicates
  2679. * the RSSI of the received ACK or BA frame.
  2680. * When the frame is removed as result of a direct
  2681. * remove command from the SW, this field is set
  2682. * to 0x0 (which is never a valid value when real
  2683. * RSSI is available).
  2684. * Units: dB w.r.t noise floor
  2685. */
  2686. A_UINT32
  2687. sw_peer_id: 16,
  2688. tid_num: 5,
  2689. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2690. * and tid_num fields contain valid data.
  2691. * If this "valid" flag is not set, the
  2692. * sw_peer_id and tid_num fields must be ignored.
  2693. */
  2694. mcast: 1,
  2695. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2696. * contains valid data.
  2697. */
  2698. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2699. reserved: 4;
  2700. A_UINT32
  2701. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2702. * packets in the wbm completion path
  2703. */
  2704. } POSTPACK;
  2705. /* DWORD 4 */
  2706. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2707. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2708. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2709. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2710. /* DWORD 5 */
  2711. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2712. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2713. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2714. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2715. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2716. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2717. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2718. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2719. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2720. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2721. /* DWORD 4 */
  2722. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2723. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2724. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2725. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2726. do { \
  2727. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2728. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2729. } while (0)
  2730. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2731. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2732. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2733. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2734. do { \
  2735. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2736. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2737. } while (0)
  2738. /* DWORD 5 */
  2739. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2740. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2741. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2742. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2743. do { \
  2744. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2745. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2746. } while (0)
  2747. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2748. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2749. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2750. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2751. do { \
  2752. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2753. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2754. } while (0)
  2755. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2756. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2757. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2758. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2759. do { \
  2760. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2761. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2762. } while (0)
  2763. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2764. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2765. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2766. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2767. do { \
  2768. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2769. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2770. } while (0)
  2771. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2772. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2773. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2774. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2775. do { \
  2776. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2777. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2778. } while (0)
  2779. /**
  2780. * @brief HTT TX WBM reinject status from firmware to host
  2781. * @details
  2782. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2783. * (WBM) offload HW.
  2784. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2785. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2786. */
  2787. PREPACK struct htt_tx_wbm_reinject_status {
  2788. A_UINT32
  2789. reserved0: 32;
  2790. A_UINT32
  2791. reserved1: 32;
  2792. A_UINT32
  2793. reserved2: 32;
  2794. } POSTPACK;
  2795. /**
  2796. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2797. * @details
  2798. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2799. * (WBM) offload HW.
  2800. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2801. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2802. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2803. * STA side.
  2804. */
  2805. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2806. A_UINT32
  2807. mec_sa_addr_31_0;
  2808. A_UINT32
  2809. mec_sa_addr_47_32: 16,
  2810. sa_ast_index: 16;
  2811. A_UINT32
  2812. vdev_id: 8,
  2813. reserved0: 24;
  2814. } POSTPACK;
  2815. /* DWORD 4 - mec_sa_addr_31_0 */
  2816. /* DWORD 5 */
  2817. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2818. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2819. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2820. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2821. /* DWORD 6 */
  2822. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2823. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2824. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2825. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2826. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2827. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2828. do { \
  2829. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2830. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2831. } while (0)
  2832. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2833. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2834. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2835. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2836. do { \
  2837. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2838. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2839. } while (0)
  2840. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2841. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2842. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2843. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2844. do { \
  2845. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2846. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2847. } while (0)
  2848. typedef enum {
  2849. TX_FLOW_PRIORITY_BE,
  2850. TX_FLOW_PRIORITY_HIGH,
  2851. TX_FLOW_PRIORITY_LOW,
  2852. } htt_tx_flow_priority_t;
  2853. typedef enum {
  2854. TX_FLOW_LATENCY_SENSITIVE,
  2855. TX_FLOW_LATENCY_INSENSITIVE,
  2856. } htt_tx_flow_latency_t;
  2857. typedef enum {
  2858. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2859. TX_FLOW_INTERACTIVE_TRAFFIC,
  2860. TX_FLOW_PERIODIC_TRAFFIC,
  2861. TX_FLOW_BURSTY_TRAFFIC,
  2862. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2863. } htt_tx_flow_traffic_pattern_t;
  2864. /**
  2865. * @brief HTT TX Flow search metadata format
  2866. * @details
  2867. * Host will set this metadata in flow table's flow search entry along with
  2868. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2869. * firmware and TQM ring if the flow search entry wins.
  2870. * This metadata is available to firmware in that first MSDU's
  2871. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2872. * to one of the available flows for specific tid and returns the tqm flow
  2873. * pointer as part of htt_tx_map_flow_info message.
  2874. */
  2875. PREPACK struct htt_tx_flow_metadata {
  2876. A_UINT32
  2877. rsvd0_1_0: 2,
  2878. tid: 4,
  2879. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2880. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2881. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2882. * Else choose final tid based on latency, priority.
  2883. */
  2884. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2885. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2886. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2887. } POSTPACK;
  2888. /* DWORD 0 */
  2889. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2890. #define HTT_TX_FLOW_METADATA_TID_S 2
  2891. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2892. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2893. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2894. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2895. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2896. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2897. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2898. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2899. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2900. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2901. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2902. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2903. /* DWORD 0 */
  2904. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2905. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2906. HTT_TX_FLOW_METADATA_TID_S)
  2907. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2908. do { \
  2909. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2910. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2911. } while (0)
  2912. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2913. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2914. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2915. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2916. do { \
  2917. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2918. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2919. } while (0)
  2920. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2921. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2922. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2923. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2924. do { \
  2925. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2926. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2927. } while (0)
  2928. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2929. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2930. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2931. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2932. do { \
  2933. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2934. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2935. } while (0)
  2936. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2937. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2938. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2939. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2940. do { \
  2941. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2942. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2943. } while (0)
  2944. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2945. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2946. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2947. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2948. do { \
  2949. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2950. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2951. } while (0)
  2952. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2953. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2954. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2955. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2956. do { \
  2957. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2958. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2959. } while (0)
  2960. /**
  2961. * @brief host -> target ADD WDS Entry
  2962. *
  2963. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2964. *
  2965. * @brief host -> target DELETE WDS Entry
  2966. *
  2967. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2968. *
  2969. * @details
  2970. * HTT wds entry from source port learning
  2971. * Host will learn wds entries from rx and send this message to firmware
  2972. * to enable firmware to configure/delete AST entries for wds clients.
  2973. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2974. * and when SA's entry is deleted, firmware removes this AST entry
  2975. *
  2976. * The message would appear as follows:
  2977. *
  2978. * |31 30|29 |17 16|15 8|7 0|
  2979. * |----------------+----------------+----------------+----------------|
  2980. * | rsvd0 |PDVID| vdev_id | msg_type |
  2981. * |-------------------------------------------------------------------|
  2982. * | sa_addr_31_0 |
  2983. * |-------------------------------------------------------------------|
  2984. * | | ta_peer_id | sa_addr_47_32 |
  2985. * |-------------------------------------------------------------------|
  2986. * Where PDVID = pdev_id
  2987. *
  2988. * The message is interpreted as follows:
  2989. *
  2990. * dword0 - b'0:7 - msg_type: This will be set to
  2991. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  2992. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  2993. *
  2994. * dword0 - b'8:15 - vdev_id
  2995. *
  2996. * dword0 - b'16:17 - pdev_id
  2997. *
  2998. * dword0 - b'18:31 - rsvd10: Reserved for future use
  2999. *
  3000. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3001. *
  3002. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3003. *
  3004. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3005. */
  3006. PREPACK struct htt_wds_entry {
  3007. A_UINT32
  3008. msg_type: 8,
  3009. vdev_id: 8,
  3010. pdev_id: 2,
  3011. rsvd0: 14;
  3012. A_UINT32 sa_addr_31_0;
  3013. A_UINT32
  3014. sa_addr_47_32: 16,
  3015. ta_peer_id: 14,
  3016. rsvd2: 2;
  3017. } POSTPACK;
  3018. /* DWORD 0 */
  3019. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3020. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3021. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3022. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3023. /* DWORD 2 */
  3024. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3025. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3026. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3027. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3028. /* DWORD 0 */
  3029. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3030. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3031. HTT_WDS_ENTRY_VDEV_ID_S)
  3032. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3033. do { \
  3034. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3035. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3036. } while (0)
  3037. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3038. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3039. HTT_WDS_ENTRY_PDEV_ID_S)
  3040. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3041. do { \
  3042. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3043. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3044. } while (0)
  3045. /* DWORD 2 */
  3046. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3047. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3048. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3049. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3050. do { \
  3051. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3052. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3053. } while (0)
  3054. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3055. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3056. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3057. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3058. do { \
  3059. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3060. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3061. } while (0)
  3062. /**
  3063. * @brief MAC DMA rx ring setup specification
  3064. *
  3065. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3066. *
  3067. * @details
  3068. * To allow for dynamic rx ring reconfiguration and to avoid race
  3069. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3070. * it uses. Instead, it sends this message to the target, indicating how
  3071. * the rx ring used by the host should be set up and maintained.
  3072. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3073. * specifications.
  3074. *
  3075. * |31 16|15 8|7 0|
  3076. * |---------------------------------------------------------------|
  3077. * header: | reserved | num rings | msg type |
  3078. * |---------------------------------------------------------------|
  3079. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3080. #if HTT_PADDR64
  3081. * | FW_IDX shadow register physical address (bits 63:32) |
  3082. #endif
  3083. * |---------------------------------------------------------------|
  3084. * | rx ring base physical address (bits 31:0) |
  3085. #if HTT_PADDR64
  3086. * | rx ring base physical address (bits 63:32) |
  3087. #endif
  3088. * |---------------------------------------------------------------|
  3089. * | rx ring buffer size | rx ring length |
  3090. * |---------------------------------------------------------------|
  3091. * | FW_IDX initial value | enabled flags |
  3092. * |---------------------------------------------------------------|
  3093. * | MSDU payload offset | 802.11 header offset |
  3094. * |---------------------------------------------------------------|
  3095. * | PPDU end offset | PPDU start offset |
  3096. * |---------------------------------------------------------------|
  3097. * | MPDU end offset | MPDU start offset |
  3098. * |---------------------------------------------------------------|
  3099. * | MSDU end offset | MSDU start offset |
  3100. * |---------------------------------------------------------------|
  3101. * | frag info offset | rx attention offset |
  3102. * |---------------------------------------------------------------|
  3103. * payload 2, if present, has the same format as payload 1
  3104. * Header fields:
  3105. * - MSG_TYPE
  3106. * Bits 7:0
  3107. * Purpose: identifies this as an rx ring configuration message
  3108. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3109. * - NUM_RINGS
  3110. * Bits 15:8
  3111. * Purpose: indicates whether the host is setting up one rx ring or two
  3112. * Value: 1 or 2
  3113. * Payload:
  3114. * for systems using 64-bit format for bus addresses:
  3115. * - IDX_SHADOW_REG_PADDR_LO
  3116. * Bits 31:0
  3117. * Value: lower 4 bytes of physical address of the host's
  3118. * FW_IDX shadow register
  3119. * - IDX_SHADOW_REG_PADDR_HI
  3120. * Bits 31:0
  3121. * Value: upper 4 bytes of physical address of the host's
  3122. * FW_IDX shadow register
  3123. * - RING_BASE_PADDR_LO
  3124. * Bits 31:0
  3125. * Value: lower 4 bytes of physical address of the host's rx ring
  3126. * - RING_BASE_PADDR_HI
  3127. * Bits 31:0
  3128. * Value: uppper 4 bytes of physical address of the host's rx ring
  3129. * for systems using 32-bit format for bus addresses:
  3130. * - IDX_SHADOW_REG_PADDR
  3131. * Bits 31:0
  3132. * Value: physical address of the host's FW_IDX shadow register
  3133. * - RING_BASE_PADDR
  3134. * Bits 31:0
  3135. * Value: physical address of the host's rx ring
  3136. * - RING_LEN
  3137. * Bits 15:0
  3138. * Value: number of elements in the rx ring
  3139. * - RING_BUF_SZ
  3140. * Bits 31:16
  3141. * Value: size of the buffers referenced by the rx ring, in byte units
  3142. * - ENABLED_FLAGS
  3143. * Bits 15:0
  3144. * Value: 1-bit flags to show whether different rx fields are enabled
  3145. * bit 0: 802.11 header enabled (1) or disabled (0)
  3146. * bit 1: MSDU payload enabled (1) or disabled (0)
  3147. * bit 2: PPDU start enabled (1) or disabled (0)
  3148. * bit 3: PPDU end enabled (1) or disabled (0)
  3149. * bit 4: MPDU start enabled (1) or disabled (0)
  3150. * bit 5: MPDU end enabled (1) or disabled (0)
  3151. * bit 6: MSDU start enabled (1) or disabled (0)
  3152. * bit 7: MSDU end enabled (1) or disabled (0)
  3153. * bit 8: rx attention enabled (1) or disabled (0)
  3154. * bit 9: frag info enabled (1) or disabled (0)
  3155. * bit 10: unicast rx enabled (1) or disabled (0)
  3156. * bit 11: multicast rx enabled (1) or disabled (0)
  3157. * bit 12: ctrl rx enabled (1) or disabled (0)
  3158. * bit 13: mgmt rx enabled (1) or disabled (0)
  3159. * bit 14: null rx enabled (1) or disabled (0)
  3160. * bit 15: phy data rx enabled (1) or disabled (0)
  3161. * - IDX_INIT_VAL
  3162. * Bits 31:16
  3163. * Purpose: Specify the initial value for the FW_IDX.
  3164. * Value: the number of buffers initially present in the host's rx ring
  3165. * - OFFSET_802_11_HDR
  3166. * Bits 15:0
  3167. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3168. * - OFFSET_MSDU_PAYLOAD
  3169. * Bits 31:16
  3170. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3171. * - OFFSET_PPDU_START
  3172. * Bits 15:0
  3173. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3174. * - OFFSET_PPDU_END
  3175. * Bits 31:16
  3176. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3177. * - OFFSET_MPDU_START
  3178. * Bits 15:0
  3179. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3180. * - OFFSET_MPDU_END
  3181. * Bits 31:16
  3182. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3183. * - OFFSET_MSDU_START
  3184. * Bits 15:0
  3185. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3186. * - OFFSET_MSDU_END
  3187. * Bits 31:16
  3188. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3189. * - OFFSET_RX_ATTN
  3190. * Bits 15:0
  3191. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3192. * - OFFSET_FRAG_INFO
  3193. * Bits 31:16
  3194. * Value: offset in QUAD-bytes of frag info table
  3195. */
  3196. /* header fields */
  3197. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3198. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3199. /* payload fields */
  3200. /* for systems using a 64-bit format for bus addresses */
  3201. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3202. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3203. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3204. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3205. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3206. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3207. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3208. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3209. /* for systems using a 32-bit format for bus addresses */
  3210. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3211. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3212. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3213. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3214. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3215. #define HTT_RX_RING_CFG_LEN_S 0
  3216. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3217. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3218. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3219. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3220. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3221. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3222. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3223. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3224. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3225. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3226. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3227. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3228. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3229. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3230. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3231. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3232. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3233. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3234. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3235. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3236. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3237. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3238. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3239. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3240. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3241. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3242. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3243. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3244. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3245. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3246. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3247. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3248. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3249. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3250. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3251. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3252. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3253. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3254. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3255. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3256. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3257. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3258. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3259. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3260. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3261. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3262. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3263. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3264. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3265. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3266. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3267. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3268. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3269. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3270. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3271. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3272. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3273. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3274. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3275. #if HTT_PADDR64
  3276. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3277. #else
  3278. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3279. #endif
  3280. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3281. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3282. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3283. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3284. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3285. do { \
  3286. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3287. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3288. } while (0)
  3289. /* degenerate case for 32-bit fields */
  3290. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3291. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3292. ((_var) = (_val))
  3293. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3294. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3295. ((_var) = (_val))
  3296. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3297. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3298. ((_var) = (_val))
  3299. /* degenerate case for 32-bit fields */
  3300. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3301. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3302. ((_var) = (_val))
  3303. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3304. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3305. ((_var) = (_val))
  3306. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3307. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3308. ((_var) = (_val))
  3309. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3310. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3311. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3312. do { \
  3313. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3314. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3315. } while (0)
  3316. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3317. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3318. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3319. do { \
  3320. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3321. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3322. } while (0)
  3323. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3324. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3325. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3326. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3327. do { \
  3328. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3329. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3330. } while (0)
  3331. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3332. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3333. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3334. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3335. do { \
  3336. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3337. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3338. } while (0)
  3339. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3340. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3341. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3342. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3343. do { \
  3344. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3345. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3346. } while (0)
  3347. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3348. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3349. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3350. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3351. do { \
  3352. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3353. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3354. } while (0)
  3355. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3356. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3357. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3358. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3359. do { \
  3360. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3361. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3362. } while (0)
  3363. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3364. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3365. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3366. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3367. do { \
  3368. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3369. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3370. } while (0)
  3371. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3372. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3373. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3374. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3375. do { \
  3376. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3377. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3378. } while (0)
  3379. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3380. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3381. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3382. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3383. do { \
  3384. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3385. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3386. } while (0)
  3387. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3388. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3389. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3390. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3391. do { \
  3392. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3393. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3394. } while (0)
  3395. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3396. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3397. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3398. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3399. do { \
  3400. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3401. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3402. } while (0)
  3403. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3404. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3405. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3406. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3407. do { \
  3408. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3409. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3410. } while (0)
  3411. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3412. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3413. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3414. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3415. do { \
  3416. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3417. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3418. } while (0)
  3419. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3420. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3421. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3422. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3423. do { \
  3424. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3425. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3426. } while (0)
  3427. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3428. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3429. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3430. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3431. do { \
  3432. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3433. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3434. } while (0)
  3435. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3436. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3437. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3438. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3439. do { \
  3440. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3441. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3442. } while (0)
  3443. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3444. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3445. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3446. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3447. do { \
  3448. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3449. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3450. } while (0)
  3451. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3452. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3453. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3454. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3455. do { \
  3456. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3457. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3458. } while (0)
  3459. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3460. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3461. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3462. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3463. do { \
  3464. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3465. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3466. } while (0)
  3467. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3468. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3469. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3470. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3471. do { \
  3472. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3473. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3474. } while (0)
  3475. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3476. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3477. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3478. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3479. do { \
  3480. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3481. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3482. } while (0)
  3483. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3484. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3485. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3486. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3487. do { \
  3488. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3489. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3490. } while (0)
  3491. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3492. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3493. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3494. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3495. do { \
  3496. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3497. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3498. } while (0)
  3499. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3500. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3501. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3502. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3503. do { \
  3504. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3505. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3506. } while (0)
  3507. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3508. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3509. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3510. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3511. do { \
  3512. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3513. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3514. } while (0)
  3515. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3516. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3517. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3518. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3519. do { \
  3520. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3521. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3522. } while (0)
  3523. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3524. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3525. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3526. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3527. do { \
  3528. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3529. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3530. } while (0)
  3531. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3532. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3533. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3534. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3535. do { \
  3536. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3537. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3538. } while (0)
  3539. /**
  3540. * @brief host -> target FW statistics retrieve
  3541. *
  3542. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3543. *
  3544. * @details
  3545. * The following field definitions describe the format of the HTT host
  3546. * to target FW stats retrieve message. The message specifies the type of
  3547. * stats host wants to retrieve.
  3548. *
  3549. * |31 24|23 16|15 8|7 0|
  3550. * |-----------------------------------------------------------|
  3551. * | stats types request bitmask | msg type |
  3552. * |-----------------------------------------------------------|
  3553. * | stats types reset bitmask | reserved |
  3554. * |-----------------------------------------------------------|
  3555. * | stats type | config value |
  3556. * |-----------------------------------------------------------|
  3557. * | cookie LSBs |
  3558. * |-----------------------------------------------------------|
  3559. * | cookie MSBs |
  3560. * |-----------------------------------------------------------|
  3561. * Header fields:
  3562. * - MSG_TYPE
  3563. * Bits 7:0
  3564. * Purpose: identifies this is a stats upload request message
  3565. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3566. * - UPLOAD_TYPES
  3567. * Bits 31:8
  3568. * Purpose: identifies which types of FW statistics to upload
  3569. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3570. * - RESET_TYPES
  3571. * Bits 31:8
  3572. * Purpose: identifies which types of FW statistics to reset
  3573. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3574. * - CFG_VAL
  3575. * Bits 23:0
  3576. * Purpose: give an opaque configuration value to the specified stats type
  3577. * Value: stats-type specific configuration value
  3578. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3579. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3580. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3581. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3582. * - CFG_STAT_TYPE
  3583. * Bits 31:24
  3584. * Purpose: specify which stats type (if any) the config value applies to
  3585. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3586. * a valid configuration specification
  3587. * - COOKIE_LSBS
  3588. * Bits 31:0
  3589. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3590. * message with its preceding host->target stats request message.
  3591. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3592. * - COOKIE_MSBS
  3593. * Bits 31:0
  3594. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3595. * message with its preceding host->target stats request message.
  3596. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3597. */
  3598. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3599. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3600. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3601. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3602. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3603. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3604. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3605. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3606. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3607. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3608. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3609. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3610. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3611. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3612. do { \
  3613. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3614. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3615. } while (0)
  3616. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3617. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3618. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3619. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3620. do { \
  3621. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3622. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3623. } while (0)
  3624. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3625. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3626. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3627. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3628. do { \
  3629. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3630. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3631. } while (0)
  3632. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3633. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3634. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3635. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3636. do { \
  3637. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3638. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3639. } while (0)
  3640. /**
  3641. * @brief host -> target HTT out-of-band sync request
  3642. *
  3643. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3644. *
  3645. * @details
  3646. * The HTT SYNC tells the target to suspend processing of subsequent
  3647. * HTT host-to-target messages until some other target agent locally
  3648. * informs the target HTT FW that the current sync counter is equal to
  3649. * or greater than (in a modulo sense) the sync counter specified in
  3650. * the SYNC message.
  3651. * This allows other host-target components to synchronize their operation
  3652. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3653. * security key has been downloaded to and activated by the target.
  3654. * In the absence of any explicit synchronization counter value
  3655. * specification, the target HTT FW will use zero as the default current
  3656. * sync value.
  3657. *
  3658. * |31 24|23 16|15 8|7 0|
  3659. * |-----------------------------------------------------------|
  3660. * | reserved | sync count | msg type |
  3661. * |-----------------------------------------------------------|
  3662. * Header fields:
  3663. * - MSG_TYPE
  3664. * Bits 7:0
  3665. * Purpose: identifies this as a sync message
  3666. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3667. * - SYNC_COUNT
  3668. * Bits 15:8
  3669. * Purpose: specifies what sync value the HTT FW will wait for from
  3670. * an out-of-band specification to resume its operation
  3671. * Value: in-band sync counter value to compare against the out-of-band
  3672. * counter spec.
  3673. * The HTT target FW will suspend its host->target message processing
  3674. * as long as
  3675. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3676. */
  3677. #define HTT_H2T_SYNC_MSG_SZ 4
  3678. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3679. #define HTT_H2T_SYNC_COUNT_S 8
  3680. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3681. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3682. HTT_H2T_SYNC_COUNT_S)
  3683. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3684. do { \
  3685. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3686. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3687. } while (0)
  3688. /**
  3689. * @brief host -> target HTT aggregation configuration
  3690. *
  3691. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3692. */
  3693. #define HTT_AGGR_CFG_MSG_SZ 4
  3694. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3695. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3696. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3697. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3698. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3699. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3700. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3701. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3702. do { \
  3703. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3704. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3705. } while (0)
  3706. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3707. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3708. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3709. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3710. do { \
  3711. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3712. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3713. } while (0)
  3714. /**
  3715. * @brief host -> target HTT configure max amsdu info per vdev
  3716. *
  3717. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3718. *
  3719. * @details
  3720. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3721. *
  3722. * |31 21|20 16|15 8|7 0|
  3723. * |-----------------------------------------------------------|
  3724. * | reserved | vdev id | max amsdu | msg type |
  3725. * |-----------------------------------------------------------|
  3726. * Header fields:
  3727. * - MSG_TYPE
  3728. * Bits 7:0
  3729. * Purpose: identifies this as a aggr cfg ex message
  3730. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3731. * - MAX_NUM_AMSDU_SUBFRM
  3732. * Bits 15:8
  3733. * Purpose: max MSDUs per A-MSDU
  3734. * - VDEV_ID
  3735. * Bits 20:16
  3736. * Purpose: ID of the vdev to which this limit is applied
  3737. */
  3738. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3739. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3740. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3741. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3742. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3743. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3744. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3745. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3746. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3747. do { \
  3748. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3749. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3750. } while (0)
  3751. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3752. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3753. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3754. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3755. do { \
  3756. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3757. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3758. } while (0)
  3759. /**
  3760. * @brief HTT WDI_IPA Config Message
  3761. *
  3762. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3763. *
  3764. * @details
  3765. * The HTT WDI_IPA config message is created/sent by host at driver
  3766. * init time. It contains information about data structures used on
  3767. * WDI_IPA TX and RX path.
  3768. * TX CE ring is used for pushing packet metadata from IPA uC
  3769. * to WLAN FW
  3770. * TX Completion ring is used for generating TX completions from
  3771. * WLAN FW to IPA uC
  3772. * RX Indication ring is used for indicating RX packets from FW
  3773. * to IPA uC
  3774. * RX Ring2 is used as either completion ring or as second
  3775. * indication ring. when Ring2 is used as completion ring, IPA uC
  3776. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3777. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3778. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3779. * indicated in RX Indication ring. Please see WDI_IPA specification
  3780. * for more details.
  3781. * |31 24|23 16|15 8|7 0|
  3782. * |----------------+----------------+----------------+----------------|
  3783. * | tx pkt pool size | Rsvd | msg_type |
  3784. * |-------------------------------------------------------------------|
  3785. * | tx comp ring base (bits 31:0) |
  3786. #if HTT_PADDR64
  3787. * | tx comp ring base (bits 63:32) |
  3788. #endif
  3789. * |-------------------------------------------------------------------|
  3790. * | tx comp ring size |
  3791. * |-------------------------------------------------------------------|
  3792. * | tx comp WR_IDX physical address (bits 31:0) |
  3793. #if HTT_PADDR64
  3794. * | tx comp WR_IDX physical address (bits 63:32) |
  3795. #endif
  3796. * |-------------------------------------------------------------------|
  3797. * | tx CE WR_IDX physical address (bits 31:0) |
  3798. #if HTT_PADDR64
  3799. * | tx CE WR_IDX physical address (bits 63:32) |
  3800. #endif
  3801. * |-------------------------------------------------------------------|
  3802. * | rx indication ring base (bits 31:0) |
  3803. #if HTT_PADDR64
  3804. * | rx indication ring base (bits 63:32) |
  3805. #endif
  3806. * |-------------------------------------------------------------------|
  3807. * | rx indication ring size |
  3808. * |-------------------------------------------------------------------|
  3809. * | rx ind RD_IDX physical address (bits 31:0) |
  3810. #if HTT_PADDR64
  3811. * | rx ind RD_IDX physical address (bits 63:32) |
  3812. #endif
  3813. * |-------------------------------------------------------------------|
  3814. * | rx ind WR_IDX physical address (bits 31:0) |
  3815. #if HTT_PADDR64
  3816. * | rx ind WR_IDX physical address (bits 63:32) |
  3817. #endif
  3818. * |-------------------------------------------------------------------|
  3819. * |-------------------------------------------------------------------|
  3820. * | rx ring2 base (bits 31:0) |
  3821. #if HTT_PADDR64
  3822. * | rx ring2 base (bits 63:32) |
  3823. #endif
  3824. * |-------------------------------------------------------------------|
  3825. * | rx ring2 size |
  3826. * |-------------------------------------------------------------------|
  3827. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3828. #if HTT_PADDR64
  3829. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3830. #endif
  3831. * |-------------------------------------------------------------------|
  3832. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3833. #if HTT_PADDR64
  3834. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3835. #endif
  3836. * |-------------------------------------------------------------------|
  3837. *
  3838. * Header fields:
  3839. * Header fields:
  3840. * - MSG_TYPE
  3841. * Bits 7:0
  3842. * Purpose: Identifies this as WDI_IPA config message
  3843. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3844. * - TX_PKT_POOL_SIZE
  3845. * Bits 15:0
  3846. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3847. * WDI_IPA TX path
  3848. * For systems using 32-bit format for bus addresses:
  3849. * - TX_COMP_RING_BASE_ADDR
  3850. * Bits 31:0
  3851. * Purpose: TX Completion Ring base address in DDR
  3852. * - TX_COMP_RING_SIZE
  3853. * Bits 31:0
  3854. * Purpose: TX Completion Ring size (must be power of 2)
  3855. * - TX_COMP_WR_IDX_ADDR
  3856. * Bits 31:0
  3857. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3858. * updates the Write Index for WDI_IPA TX completion ring
  3859. * - TX_CE_WR_IDX_ADDR
  3860. * Bits 31:0
  3861. * Purpose: DDR address where IPA uC
  3862. * updates the WR Index for TX CE ring
  3863. * (needed for fusion platforms)
  3864. * - RX_IND_RING_BASE_ADDR
  3865. * Bits 31:0
  3866. * Purpose: RX Indication Ring base address in DDR
  3867. * - RX_IND_RING_SIZE
  3868. * Bits 31:0
  3869. * Purpose: RX Indication Ring size
  3870. * - RX_IND_RD_IDX_ADDR
  3871. * Bits 31:0
  3872. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3873. * RX indication ring
  3874. * - RX_IND_WR_IDX_ADDR
  3875. * Bits 31:0
  3876. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3877. * updates the Write Index for WDI_IPA RX indication ring
  3878. * - RX_RING2_BASE_ADDR
  3879. * Bits 31:0
  3880. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3881. * - RX_RING2_SIZE
  3882. * Bits 31:0
  3883. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3884. * - RX_RING2_RD_IDX_ADDR
  3885. * Bits 31:0
  3886. * Purpose: If Second RX ring is Indication ring, DDR address where
  3887. * IPA uC updates the Read Index for Ring2.
  3888. * If Second RX ring is completion ring, this is NOT used
  3889. * - RX_RING2_WR_IDX_ADDR
  3890. * Bits 31:0
  3891. * Purpose: If Second RX ring is Indication ring, DDR address where
  3892. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3893. * If second RX ring is completion ring, DDR address where
  3894. * IPA uC updates the Write Index for Ring 2.
  3895. * For systems using 64-bit format for bus addresses:
  3896. * - TX_COMP_RING_BASE_ADDR_LO
  3897. * Bits 31:0
  3898. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3899. * - TX_COMP_RING_BASE_ADDR_HI
  3900. * Bits 31:0
  3901. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3902. * - TX_COMP_RING_SIZE
  3903. * Bits 31:0
  3904. * Purpose: TX Completion Ring size (must be power of 2)
  3905. * - TX_COMP_WR_IDX_ADDR_LO
  3906. * Bits 31:0
  3907. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3908. * Lower 4 bytes of DDR address where WIFI FW
  3909. * updates the Write Index for WDI_IPA TX completion ring
  3910. * - TX_COMP_WR_IDX_ADDR_HI
  3911. * Bits 31:0
  3912. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3913. * Higher 4 bytes of DDR address where WIFI FW
  3914. * updates the Write Index for WDI_IPA TX completion ring
  3915. * - TX_CE_WR_IDX_ADDR_LO
  3916. * Bits 31:0
  3917. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3918. * updates the WR Index for TX CE ring
  3919. * (needed for fusion platforms)
  3920. * - TX_CE_WR_IDX_ADDR_HI
  3921. * Bits 31:0
  3922. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3923. * updates the WR Index for TX CE ring
  3924. * (needed for fusion platforms)
  3925. * - RX_IND_RING_BASE_ADDR_LO
  3926. * Bits 31:0
  3927. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3928. * - RX_IND_RING_BASE_ADDR_HI
  3929. * Bits 31:0
  3930. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3931. * - RX_IND_RING_SIZE
  3932. * Bits 31:0
  3933. * Purpose: RX Indication Ring size
  3934. * - RX_IND_RD_IDX_ADDR_LO
  3935. * Bits 31:0
  3936. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3937. * for WDI_IPA RX indication ring
  3938. * - RX_IND_RD_IDX_ADDR_HI
  3939. * Bits 31:0
  3940. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3941. * for WDI_IPA RX indication ring
  3942. * - RX_IND_WR_IDX_ADDR_LO
  3943. * Bits 31:0
  3944. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3945. * Lower 4 bytes of DDR address where WIFI FW
  3946. * updates the Write Index for WDI_IPA RX indication ring
  3947. * - RX_IND_WR_IDX_ADDR_HI
  3948. * Bits 31:0
  3949. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3950. * Higher 4 bytes of DDR address where WIFI FW
  3951. * updates the Write Index for WDI_IPA RX indication ring
  3952. * - RX_RING2_BASE_ADDR_LO
  3953. * Bits 31:0
  3954. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3955. * - RX_RING2_BASE_ADDR_HI
  3956. * Bits 31:0
  3957. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3958. * - RX_RING2_SIZE
  3959. * Bits 31:0
  3960. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3961. * - RX_RING2_RD_IDX_ADDR_LO
  3962. * Bits 31:0
  3963. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3964. * DDR address where IPA uC updates the Read Index for Ring2.
  3965. * If Second RX ring is completion ring, this is NOT used
  3966. * - RX_RING2_RD_IDX_ADDR_HI
  3967. * Bits 31:0
  3968. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3969. * DDR address where IPA uC updates the Read Index for Ring2.
  3970. * If Second RX ring is completion ring, this is NOT used
  3971. * - RX_RING2_WR_IDX_ADDR_LO
  3972. * Bits 31:0
  3973. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3974. * DDR address where WIFI FW updates the Write Index
  3975. * for WDI_IPA RX ring2
  3976. * If second RX ring is completion ring, lower 4 bytes of
  3977. * DDR address where IPA uC updates the Write Index for Ring 2.
  3978. * - RX_RING2_WR_IDX_ADDR_HI
  3979. * Bits 31:0
  3980. * Purpose: If Second RX ring is Indication ring, higher 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, higher 4 bytes of
  3984. * DDR address where IPA uC updates the Write Index for Ring 2.
  3985. */
  3986. #if HTT_PADDR64
  3987. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  3988. #else
  3989. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  3990. #endif
  3991. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  3992. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  3993. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  3994. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  3995. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  3996. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  3997. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  3998. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  3999. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4000. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4001. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4002. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4003. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4004. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4005. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4006. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4007. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4008. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4009. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4010. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4011. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4012. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4013. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4014. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4015. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4016. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4017. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4018. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4019. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4020. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4021. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4022. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4023. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4024. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4025. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4026. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4027. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4028. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4029. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4030. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4031. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4032. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4033. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4034. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4035. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4036. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4037. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4038. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4039. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4040. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4041. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4042. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4043. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4044. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4045. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4046. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4047. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4048. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4049. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4051. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4053. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4054. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4055. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4056. do { \
  4057. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4058. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4059. } while (0)
  4060. /* for systems using 32-bit format for bus addr */
  4061. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4062. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4063. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4064. do { \
  4065. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4066. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4067. } while (0)
  4068. /* for systems using 64-bit format for bus addr */
  4069. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4070. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4071. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4072. do { \
  4073. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4074. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4075. } while (0)
  4076. /* for systems using 64-bit format for bus addr */
  4077. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4078. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4079. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4080. do { \
  4081. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4082. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4083. } while (0)
  4084. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4085. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4086. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4087. do { \
  4088. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4089. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4090. } while (0)
  4091. /* for systems using 32-bit format for bus addr */
  4092. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4093. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4094. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4095. do { \
  4096. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4097. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4098. } while (0)
  4099. /* for systems using 64-bit format for bus addr */
  4100. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4101. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4102. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4103. do { \
  4104. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4105. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4106. } while (0)
  4107. /* for systems using 64-bit format for bus addr */
  4108. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4109. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4110. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4111. do { \
  4112. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4113. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4114. } while (0)
  4115. /* for systems using 32-bit format for bus addr */
  4116. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4117. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4118. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4119. do { \
  4120. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4121. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4122. } while (0)
  4123. /* for systems using 64-bit format for bus addr */
  4124. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4125. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4126. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4127. do { \
  4128. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4129. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4130. } while (0)
  4131. /* for systems using 64-bit format for bus addr */
  4132. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4133. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4134. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4135. do { \
  4136. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4137. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4138. } while (0)
  4139. /* for systems using 32-bit format for bus addr */
  4140. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4141. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4142. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4143. do { \
  4144. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4145. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4146. } while (0)
  4147. /* for systems using 64-bit format for bus addr */
  4148. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4149. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4150. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4151. do { \
  4152. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4153. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4154. } while (0)
  4155. /* for systems using 64-bit format for bus addr */
  4156. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4157. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4158. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4159. do { \
  4160. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4161. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4162. } while (0)
  4163. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4164. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4165. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4166. do { \
  4167. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4168. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4169. } while (0)
  4170. /* for systems using 32-bit format for bus addr */
  4171. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4172. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4173. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4174. do { \
  4175. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4176. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4177. } while (0)
  4178. /* for systems using 64-bit format for bus addr */
  4179. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4180. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4181. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4182. do { \
  4183. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4184. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4185. } while (0)
  4186. /* for systems using 64-bit format for bus addr */
  4187. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4188. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4189. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4190. do { \
  4191. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4192. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4193. } while (0)
  4194. /* for systems using 32-bit format for bus addr */
  4195. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4196. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4197. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4198. do { \
  4199. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4200. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4201. } while (0)
  4202. /* for systems using 64-bit format for bus addr */
  4203. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4204. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4205. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4206. do { \
  4207. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4208. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4209. } while (0)
  4210. /* for systems using 64-bit format for bus addr */
  4211. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4212. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4213. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4214. do { \
  4215. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4216. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4217. } while (0)
  4218. /* for systems using 32-bit format for bus addr */
  4219. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4220. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4221. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4222. do { \
  4223. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4224. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4225. } while (0)
  4226. /* for systems using 64-bit format for bus addr */
  4227. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4228. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4229. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4230. do { \
  4231. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4232. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4233. } while (0)
  4234. /* for systems using 64-bit format for bus addr */
  4235. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4236. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4237. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4238. do { \
  4239. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4240. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4241. } while (0)
  4242. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4243. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4244. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4245. do { \
  4246. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4247. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4248. } while (0)
  4249. /* for systems using 32-bit format for bus addr */
  4250. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4251. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4252. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4253. do { \
  4254. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4255. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4256. } while (0)
  4257. /* for systems using 64-bit format for bus addr */
  4258. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4259. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4260. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4261. do { \
  4262. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4263. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4264. } while (0)
  4265. /* for systems using 64-bit format for bus addr */
  4266. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4267. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4268. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4269. do { \
  4270. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4271. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4272. } while (0)
  4273. /* for systems using 32-bit format for bus addr */
  4274. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4275. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4276. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4277. do { \
  4278. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4279. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4280. } while (0)
  4281. /* for systems using 64-bit format for bus addr */
  4282. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4283. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4284. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4285. do { \
  4286. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4287. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4288. } while (0)
  4289. /* for systems using 64-bit format for bus addr */
  4290. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4291. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4292. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4293. do { \
  4294. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4295. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4296. } while (0)
  4297. /*
  4298. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4299. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4300. * addresses are stored in a XXX-bit field.
  4301. * This macro is used to define both htt_wdi_ipa_config32_t and
  4302. * htt_wdi_ipa_config64_t structs.
  4303. */
  4304. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4305. _paddr__tx_comp_ring_base_addr_, \
  4306. _paddr__tx_comp_wr_idx_addr_, \
  4307. _paddr__tx_ce_wr_idx_addr_, \
  4308. _paddr__rx_ind_ring_base_addr_, \
  4309. _paddr__rx_ind_rd_idx_addr_, \
  4310. _paddr__rx_ind_wr_idx_addr_, \
  4311. _paddr__rx_ring2_base_addr_,\
  4312. _paddr__rx_ring2_rd_idx_addr_,\
  4313. _paddr__rx_ring2_wr_idx_addr_) \
  4314. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4315. { \
  4316. /* DWORD 0: flags and meta-data */ \
  4317. A_UINT32 \
  4318. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4319. reserved: 8, \
  4320. tx_pkt_pool_size: 16;\
  4321. /* DWORD 1 */\
  4322. _paddr__tx_comp_ring_base_addr_;\
  4323. /* DWORD 2 (or 3)*/\
  4324. A_UINT32 tx_comp_ring_size;\
  4325. /* DWORD 3 (or 4)*/\
  4326. _paddr__tx_comp_wr_idx_addr_;\
  4327. /* DWORD 4 (or 6)*/\
  4328. _paddr__tx_ce_wr_idx_addr_;\
  4329. /* DWORD 5 (or 8)*/\
  4330. _paddr__rx_ind_ring_base_addr_;\
  4331. /* DWORD 6 (or 10)*/\
  4332. A_UINT32 rx_ind_ring_size;\
  4333. /* DWORD 7 (or 11)*/\
  4334. _paddr__rx_ind_rd_idx_addr_;\
  4335. /* DWORD 8 (or 13)*/\
  4336. _paddr__rx_ind_wr_idx_addr_;\
  4337. /* DWORD 9 (or 15)*/\
  4338. _paddr__rx_ring2_base_addr_;\
  4339. /* DWORD 10 (or 17) */\
  4340. A_UINT32 rx_ring2_size;\
  4341. /* DWORD 11 (or 18) */\
  4342. _paddr__rx_ring2_rd_idx_addr_;\
  4343. /* DWORD 12 (or 20) */\
  4344. _paddr__rx_ring2_wr_idx_addr_;\
  4345. } POSTPACK
  4346. /* define a htt_wdi_ipa_config32_t type */
  4347. 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));
  4348. /* define a htt_wdi_ipa_config64_t type */
  4349. 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));
  4350. #if HTT_PADDR64
  4351. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4352. #else
  4353. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4354. #endif
  4355. enum htt_wdi_ipa_op_code {
  4356. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4357. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4358. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4359. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4360. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4361. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4362. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4363. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4364. /* keep this last */
  4365. HTT_WDI_IPA_OPCODE_MAX
  4366. };
  4367. /**
  4368. * @brief HTT WDI_IPA Operation Request Message
  4369. *
  4370. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4371. *
  4372. * @details
  4373. * HTT WDI_IPA Operation Request message is sent by host
  4374. * to either suspend or resume WDI_IPA TX or RX path.
  4375. * |31 24|23 16|15 8|7 0|
  4376. * |----------------+----------------+----------------+----------------|
  4377. * | op_code | Rsvd | msg_type |
  4378. * |-------------------------------------------------------------------|
  4379. *
  4380. * Header fields:
  4381. * - MSG_TYPE
  4382. * Bits 7:0
  4383. * Purpose: Identifies this as WDI_IPA Operation Request message
  4384. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4385. * - OP_CODE
  4386. * Bits 31:16
  4387. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4388. * value: = enum htt_wdi_ipa_op_code
  4389. */
  4390. PREPACK struct htt_wdi_ipa_op_request_t
  4391. {
  4392. /* DWORD 0: flags and meta-data */
  4393. A_UINT32
  4394. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4395. reserved: 8,
  4396. op_code: 16;
  4397. } POSTPACK;
  4398. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4399. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4400. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4401. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4402. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4403. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4404. do { \
  4405. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4406. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4407. } while (0)
  4408. /*
  4409. * @brief host -> target HTT_MSI_SETUP message
  4410. *
  4411. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4412. *
  4413. * @details
  4414. * After target is booted up, host can send MSI setup message so that
  4415. * target sets up HW registers based on setup message.
  4416. *
  4417. * The message would appear as follows:
  4418. * |31 24|23 16|15|14 8|7 0|
  4419. * |---------------+-----------------+-----------------+-----------------|
  4420. * | reserved | msi_type | pdev_id | msg_type |
  4421. * |---------------------------------------------------------------------|
  4422. * | msi_addr_lo |
  4423. * |---------------------------------------------------------------------|
  4424. * | msi_addr_hi |
  4425. * |---------------------------------------------------------------------|
  4426. * | msi_data |
  4427. * |---------------------------------------------------------------------|
  4428. *
  4429. * The message is interpreted as follows:
  4430. * dword0 - b'0:7 - msg_type: This will be set to
  4431. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4432. * b'8:15 - pdev_id:
  4433. * 0 (for rings at SOC/UMAC level),
  4434. * 1/2/3 mac id (for rings at LMAC level)
  4435. * b'16:23 - msi_type: identify which msi registers need to be setup
  4436. * more details can be got from enum htt_msi_setup_type
  4437. * b'24:31 - reserved
  4438. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4439. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4440. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4441. */
  4442. PREPACK struct htt_msi_setup_t {
  4443. A_UINT32 msg_type: 8,
  4444. pdev_id: 8,
  4445. msi_type: 8,
  4446. reserved: 8;
  4447. A_UINT32 msi_addr_lo;
  4448. A_UINT32 msi_addr_hi;
  4449. A_UINT32 msi_data;
  4450. } POSTPACK;
  4451. enum htt_msi_setup_type {
  4452. HTT_PPDU_END_MSI_SETUP_TYPE,
  4453. /* Insert new types here*/
  4454. };
  4455. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4456. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4457. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4458. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4459. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4460. HTT_MSI_SETUP_PDEV_ID_S)
  4461. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4462. do { \
  4463. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4464. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4465. } while (0)
  4466. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4467. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4468. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4469. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4470. HTT_MSI_SETUP_MSI_TYPE_S)
  4471. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4472. do { \
  4473. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4474. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4475. } while (0)
  4476. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4477. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4478. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4479. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4480. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4481. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4482. do { \
  4483. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4484. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4485. } while (0)
  4486. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4487. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4488. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4489. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4490. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4491. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4492. do { \
  4493. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4494. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4495. } while (0)
  4496. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4497. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4498. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4499. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4500. HTT_MSI_SETUP_MSI_DATA_S)
  4501. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4502. do { \
  4503. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4504. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4505. } while (0)
  4506. /*
  4507. * @brief host -> target HTT_SRING_SETUP message
  4508. *
  4509. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4510. *
  4511. * @details
  4512. * After target is booted up, Host can send SRING setup message for
  4513. * each host facing LMAC SRING. Target setups up HW registers based
  4514. * on setup message and confirms back to Host if response_required is set.
  4515. * Host should wait for confirmation message before sending new SRING
  4516. * setup message
  4517. *
  4518. * The message would appear as follows:
  4519. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4520. * |--------------- +-----------------+-----------------+-----------------|
  4521. * | ring_type | ring_id | pdev_id | msg_type |
  4522. * |----------------------------------------------------------------------|
  4523. * | ring_base_addr_lo |
  4524. * |----------------------------------------------------------------------|
  4525. * | ring_base_addr_hi |
  4526. * |----------------------------------------------------------------------|
  4527. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4528. * |----------------------------------------------------------------------|
  4529. * | ring_head_offset32_remote_addr_lo |
  4530. * |----------------------------------------------------------------------|
  4531. * | ring_head_offset32_remote_addr_hi |
  4532. * |----------------------------------------------------------------------|
  4533. * | ring_tail_offset32_remote_addr_lo |
  4534. * |----------------------------------------------------------------------|
  4535. * | ring_tail_offset32_remote_addr_hi |
  4536. * |----------------------------------------------------------------------|
  4537. * | ring_msi_addr_lo |
  4538. * |----------------------------------------------------------------------|
  4539. * | ring_msi_addr_hi |
  4540. * |----------------------------------------------------------------------|
  4541. * | ring_msi_data |
  4542. * |----------------------------------------------------------------------|
  4543. * | intr_timer_th |IM| intr_batch_counter_th |
  4544. * |----------------------------------------------------------------------|
  4545. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4546. * |----------------------------------------------------------------------|
  4547. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4548. * |----------------------------------------------------------------------|
  4549. * Where
  4550. * IM = sw_intr_mode
  4551. * RR = response_required
  4552. * PTCF = prefetch_timer_cfg
  4553. * IP = IPA drop flag
  4554. *
  4555. * The message is interpreted as follows:
  4556. * dword0 - b'0:7 - msg_type: This will be set to
  4557. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4558. * b'8:15 - pdev_id:
  4559. * 0 (for rings at SOC/UMAC level),
  4560. * 1/2/3 mac id (for rings at LMAC level)
  4561. * b'16:23 - ring_id: identify which ring is to setup,
  4562. * more details can be got from enum htt_srng_ring_id
  4563. * b'24:31 - ring_type: identify type of host rings,
  4564. * more details can be got from enum htt_srng_ring_type
  4565. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4566. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4567. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4568. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4569. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4570. * SW_TO_HW_RING.
  4571. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4572. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4573. * Lower 32 bits of memory address of the remote variable
  4574. * storing the 4-byte word offset that identifies the head
  4575. * element within the ring.
  4576. * (The head offset variable has type A_UINT32.)
  4577. * Valid for HW_TO_SW and SW_TO_SW rings.
  4578. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4579. * Upper 32 bits of memory address of the remote variable
  4580. * storing the 4-byte word offset that identifies the head
  4581. * element within the ring.
  4582. * (The head offset variable has type A_UINT32.)
  4583. * Valid for HW_TO_SW and SW_TO_SW rings.
  4584. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4585. * Lower 32 bits of memory address of the remote variable
  4586. * storing the 4-byte word offset that identifies the tail
  4587. * element within the ring.
  4588. * (The tail offset variable has type A_UINT32.)
  4589. * Valid for HW_TO_SW and SW_TO_SW rings.
  4590. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4591. * Upper 32 bits of memory address of the remote variable
  4592. * storing the 4-byte word offset that identifies the tail
  4593. * element within the ring.
  4594. * (The tail offset variable has type A_UINT32.)
  4595. * Valid for HW_TO_SW and SW_TO_SW rings.
  4596. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4597. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4598. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4599. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4600. * dword10 - b'0:31 - ring_msi_data: MSI data
  4601. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4602. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4603. * dword11 - b'0:14 - intr_batch_counter_th:
  4604. * batch counter threshold is in units of 4-byte words.
  4605. * HW internally maintains and increments batch count.
  4606. * (see SRING spec for detail description).
  4607. * When batch count reaches threshold value, an interrupt
  4608. * is generated by HW.
  4609. * b'15 - sw_intr_mode:
  4610. * This configuration shall be static.
  4611. * Only programmed at power up.
  4612. * 0: generate pulse style sw interrupts
  4613. * 1: generate level style sw interrupts
  4614. * b'16:31 - intr_timer_th:
  4615. * The timer init value when timer is idle or is
  4616. * initialized to start downcounting.
  4617. * In 8us units (to cover a range of 0 to 524 ms)
  4618. * dword12 - b'0:15 - intr_low_threshold:
  4619. * Used only by Consumer ring to generate ring_sw_int_p.
  4620. * Ring entries low threshold water mark, that is used
  4621. * in combination with the interrupt timer as well as
  4622. * the the clearing of the level interrupt.
  4623. * b'16:18 - prefetch_timer_cfg:
  4624. * Used only by Consumer ring to set timer mode to
  4625. * support Application prefetch handling.
  4626. * The external tail offset/pointer will be updated
  4627. * at following intervals:
  4628. * 3'b000: (Prefetch feature disabled; used only for debug)
  4629. * 3'b001: 1 usec
  4630. * 3'b010: 4 usec
  4631. * 3'b011: 8 usec (default)
  4632. * 3'b100: 16 usec
  4633. * Others: Reserverd
  4634. * b'19 - response_required:
  4635. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4636. * b'20 - ipa_drop_flag:
  4637. Indicates that host will config ipa drop threshold percentage
  4638. * b'21:31 - reserved: reserved for future use
  4639. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4640. * b'8:15 - ipa drop high threshold percentage:
  4641. * b'16:31 - Reserved
  4642. */
  4643. PREPACK struct htt_sring_setup_t {
  4644. A_UINT32 msg_type: 8,
  4645. pdev_id: 8,
  4646. ring_id: 8,
  4647. ring_type: 8;
  4648. A_UINT32 ring_base_addr_lo;
  4649. A_UINT32 ring_base_addr_hi;
  4650. A_UINT32 ring_size: 16,
  4651. ring_entry_size: 8,
  4652. ring_misc_cfg_flag: 8;
  4653. A_UINT32 ring_head_offset32_remote_addr_lo;
  4654. A_UINT32 ring_head_offset32_remote_addr_hi;
  4655. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4656. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4657. A_UINT32 ring_msi_addr_lo;
  4658. A_UINT32 ring_msi_addr_hi;
  4659. A_UINT32 ring_msi_data;
  4660. A_UINT32 intr_batch_counter_th: 15,
  4661. sw_intr_mode: 1,
  4662. intr_timer_th: 16;
  4663. A_UINT32 intr_low_threshold: 16,
  4664. prefetch_timer_cfg: 3,
  4665. response_required: 1,
  4666. ipa_drop_flag: 1,
  4667. reserved1: 11;
  4668. A_UINT32 ipa_drop_low_threshold: 8,
  4669. ipa_drop_high_threshold: 8,
  4670. reserved: 16;
  4671. } POSTPACK;
  4672. enum htt_srng_ring_type {
  4673. HTT_HW_TO_SW_RING = 0,
  4674. HTT_SW_TO_HW_RING,
  4675. HTT_SW_TO_SW_RING,
  4676. /* Insert new ring types above this line */
  4677. };
  4678. enum htt_srng_ring_id {
  4679. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4680. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4681. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4682. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4683. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4684. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4685. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4686. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4687. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4688. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4689. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4690. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4691. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4692. /* Add Other SRING which can't be directly configured by host software above this line */
  4693. };
  4694. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4695. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4696. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4697. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4698. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4699. HTT_SRING_SETUP_PDEV_ID_S)
  4700. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4701. do { \
  4702. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4703. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4704. } while (0)
  4705. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4706. #define HTT_SRING_SETUP_RING_ID_S 16
  4707. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4708. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4709. HTT_SRING_SETUP_RING_ID_S)
  4710. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4711. do { \
  4712. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4713. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4714. } while (0)
  4715. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4716. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4717. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4718. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4719. HTT_SRING_SETUP_RING_TYPE_S)
  4720. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4721. do { \
  4722. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4723. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4724. } while (0)
  4725. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4726. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4727. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4728. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4729. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4730. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4731. do { \
  4732. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4733. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4734. } while (0)
  4735. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4736. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4737. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4738. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4739. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4740. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4741. do { \
  4742. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4743. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4744. } while (0)
  4745. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4746. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4747. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4748. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4749. HTT_SRING_SETUP_RING_SIZE_S)
  4750. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4751. do { \
  4752. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4753. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4754. } while (0)
  4755. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4756. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4757. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4758. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4759. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4760. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4761. do { \
  4762. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4763. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4764. } while (0)
  4765. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4766. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4767. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4768. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4769. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4770. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4771. do { \
  4772. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4773. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4774. } while (0)
  4775. /* This control bit is applicable to only Producer, which updates Ring ID field
  4776. * of each descriptor before pushing into the ring.
  4777. * 0: updates ring_id(default)
  4778. * 1: ring_id updating disabled */
  4779. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4780. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4781. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4782. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4783. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4784. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4785. do { \
  4786. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4787. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4788. } while (0)
  4789. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4790. * of each descriptor before pushing into the ring.
  4791. * 0: updates Loopcnt(default)
  4792. * 1: Loopcnt updating disabled */
  4793. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4794. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4795. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4796. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4797. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4798. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4799. do { \
  4800. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4801. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4802. } while (0)
  4803. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4804. * into security_id port of GXI/AXI. */
  4805. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4806. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4807. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4808. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4809. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4810. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4811. do { \
  4812. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4813. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4814. } while (0)
  4815. /* During MSI write operation, SRNG drives value of this register bit into
  4816. * swap bit of GXI/AXI. */
  4817. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4818. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4819. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4820. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4821. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4822. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4823. do { \
  4824. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4825. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4826. } while (0)
  4827. /* During Pointer write operation, SRNG drives value of this register bit into
  4828. * swap bit of GXI/AXI. */
  4829. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4830. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4831. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4832. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4833. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4834. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4835. do { \
  4836. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4837. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4838. } while (0)
  4839. /* During any data or TLV write operation, SRNG drives value of this register
  4840. * bit into swap bit of GXI/AXI. */
  4841. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4842. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4843. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4844. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4845. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4846. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4847. do { \
  4848. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4849. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4850. } while (0)
  4851. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4852. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4853. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4854. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4855. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4856. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4857. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4858. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4859. do { \
  4860. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4861. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4862. } while (0)
  4863. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4864. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4865. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4866. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4867. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4868. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4869. do { \
  4870. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4871. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4872. } while (0)
  4873. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4874. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4875. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4876. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4877. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4878. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4879. do { \
  4880. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4881. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4882. } while (0)
  4883. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4884. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4885. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4886. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4887. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4888. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4889. do { \
  4890. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4891. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4892. } while (0)
  4893. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4894. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4895. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4896. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4897. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4898. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4899. do { \
  4900. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4901. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4902. } while (0)
  4903. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4904. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4905. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4906. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4907. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4908. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4909. do { \
  4910. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4911. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4912. } while (0)
  4913. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4914. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4915. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4916. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4917. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4918. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4919. do { \
  4920. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4921. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4922. } while (0)
  4923. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4924. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4925. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4926. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4927. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4928. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4929. do { \
  4930. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4931. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4932. } while (0)
  4933. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4934. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4935. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4936. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4937. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4938. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4939. do { \
  4940. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4941. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4942. } while (0)
  4943. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4944. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4945. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4946. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4947. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4948. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4949. do { \
  4950. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4951. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4952. } while (0)
  4953. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4954. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4955. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4956. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4957. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4958. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4959. do { \
  4960. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4961. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4962. } while (0)
  4963. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4964. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4965. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4966. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4967. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4968. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4969. do { \
  4970. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4971. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4972. } while (0)
  4973. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4974. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4975. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  4976. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  4977. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  4978. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  4979. do { \
  4980. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  4981. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  4982. } while (0)
  4983. /**
  4984. * @brief host -> target RX ring selection config message
  4985. *
  4986. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  4987. *
  4988. * @details
  4989. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  4990. * configure RXDMA rings.
  4991. * The configuration is per ring based and includes both packet subtypes
  4992. * and PPDU/MPDU TLVs.
  4993. *
  4994. * The message would appear as follows:
  4995. *
  4996. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  4997. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  4998. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  4999. * |-------------------------------------------------------------------|
  5000. * | rsvd2 | ring_buffer_size |
  5001. * |-------------------------------------------------------------------|
  5002. * | packet_type_enable_flags_0 |
  5003. * |-------------------------------------------------------------------|
  5004. * | packet_type_enable_flags_1 |
  5005. * |-------------------------------------------------------------------|
  5006. * | packet_type_enable_flags_2 |
  5007. * |-------------------------------------------------------------------|
  5008. * | packet_type_enable_flags_3 |
  5009. * |-------------------------------------------------------------------|
  5010. * | tlv_filter_in_flags |
  5011. * |-------------------------------------------------------------------|
  5012. * | rx_header_offset | rx_packet_offset |
  5013. * |-------------------------------------------------------------------|
  5014. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5015. * |-------------------------------------------------------------------|
  5016. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5017. * |-------------------------------------------------------------------|
  5018. * | rsvd3 | rx_attention_offset |
  5019. * |-------------------------------------------------------------------|
  5020. * | rsvd4 | mo| fp| rx_drop_threshold |
  5021. * | |ndp|ndp| |
  5022. * |-------------------------------------------------------------------|
  5023. * Where:
  5024. * PS = pkt_swap
  5025. * SS = status_swap
  5026. * OV = rx_offsets_valid
  5027. * DT = drop_thresh_valid
  5028. * The message is interpreted as follows:
  5029. * dword0 - b'0:7 - msg_type: This will be set to
  5030. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5031. * b'8:15 - pdev_id:
  5032. * 0 (for rings at SOC/UMAC level),
  5033. * 1/2/3 mac id (for rings at LMAC level)
  5034. * b'16:23 - ring_id : Identify the ring to configure.
  5035. * More details can be got from enum htt_srng_ring_id
  5036. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5037. * BUF_RING_CFG_0 defs within HW .h files,
  5038. * e.g. wmac_top_reg_seq_hwioreg.h
  5039. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5040. * BUF_RING_CFG_0 defs within HW .h files,
  5041. * e.g. wmac_top_reg_seq_hwioreg.h
  5042. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5043. * configuration fields are valid
  5044. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5045. * rx_drop_threshold field is valid
  5046. * b'28:31 - rsvd1: reserved for future use
  5047. * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
  5048. * in byte units.
  5049. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5050. * - b'16:31 - rsvd2: Reserved for future use
  5051. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5052. * Enable MGMT packet from 0b0000 to 0b1001
  5053. * bits from low to high: FP, MD, MO - 3 bits
  5054. * FP: Filter_Pass
  5055. * MD: Monitor_Direct
  5056. * MO: Monitor_Other
  5057. * 10 mgmt subtypes * 3 bits -> 30 bits
  5058. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5059. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5060. * Enable MGMT packet from 0b1010 to 0b1111
  5061. * bits from low to high: FP, MD, MO - 3 bits
  5062. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5063. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5064. * Enable CTRL packet from 0b0000 to 0b1001
  5065. * bits from low to high: FP, MD, MO - 3 bits
  5066. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5067. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5068. * Enable CTRL packet from 0b1010 to 0b1111,
  5069. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5070. * bits from low to high: FP, MD, MO - 3 bits
  5071. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5072. * dword6 - b'0:31 - tlv_filter_in_flags:
  5073. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5074. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5075. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5076. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5077. * A value of 0 will be considered as ignore this config.
  5078. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5079. * e.g. wmac_top_reg_seq_hwioreg.h
  5080. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5081. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5082. * A value of 0 will be considered as ignore this config.
  5083. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5084. * e.g. wmac_top_reg_seq_hwioreg.h
  5085. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5086. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5087. * A value of 0 will be considered as ignore this config.
  5088. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5089. * e.g. wmac_top_reg_seq_hwioreg.h
  5090. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5091. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5092. * A value of 0 will be considered as ignore this config.
  5093. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5094. * e.g. wmac_top_reg_seq_hwioreg.h
  5095. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5096. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5097. * A value of 0 will be considered as ignore this config.
  5098. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5099. * e.g. wmac_top_reg_seq_hwioreg.h
  5100. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5101. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5102. * A value of 0 will be considered as ignore this config.
  5103. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5104. * e.g. wmac_top_reg_seq_hwioreg.h
  5105. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5106. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5107. * A value of 0 will be considered as ignore this config.
  5108. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5109. * e.g. wmac_top_reg_seq_hwioreg.h
  5110. * - b'16:31 - rsvd3 for future use
  5111. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5112. * to source rings. Consumer drops packets if the available
  5113. * words in the ring falls below the configured threshold
  5114. * value.
  5115. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5116. * by host. 1 -> subscribed
  5117. * - b`11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5118. * by host. 1 -> subscribed
  5119. */
  5120. PREPACK struct htt_rx_ring_selection_cfg_t {
  5121. A_UINT32 msg_type: 8,
  5122. pdev_id: 8,
  5123. ring_id: 8,
  5124. status_swap: 1,
  5125. pkt_swap: 1,
  5126. rx_offsets_valid: 1,
  5127. drop_thresh_valid: 1,
  5128. rsvd1: 4;
  5129. A_UINT32 ring_buffer_size: 16,
  5130. rsvd2: 16;
  5131. A_UINT32 packet_type_enable_flags_0;
  5132. A_UINT32 packet_type_enable_flags_1;
  5133. A_UINT32 packet_type_enable_flags_2;
  5134. A_UINT32 packet_type_enable_flags_3;
  5135. A_UINT32 tlv_filter_in_flags;
  5136. A_UINT32 rx_packet_offset: 16,
  5137. rx_header_offset: 16;
  5138. A_UINT32 rx_mpdu_end_offset: 16,
  5139. rx_mpdu_start_offset: 16;
  5140. A_UINT32 rx_msdu_end_offset: 16,
  5141. rx_msdu_start_offset: 16;
  5142. A_UINT32 rx_attn_offset: 16,
  5143. rsvd3: 16;
  5144. A_UINT32 rx_drop_threshold: 10,
  5145. fp_ndp: 1,
  5146. mo_ndp: 1,
  5147. rsvd4: 20;
  5148. } POSTPACK;
  5149. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5150. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5151. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5152. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5153. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5154. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5155. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5156. do { \
  5157. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5158. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5159. } while (0)
  5160. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5161. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5162. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5163. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5164. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5165. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5166. do { \
  5167. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5168. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5169. } while (0)
  5170. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5171. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5172. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5173. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5174. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5175. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5176. do { \
  5177. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5178. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5179. } while (0)
  5180. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5181. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5182. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5183. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5184. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5185. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5186. do { \
  5187. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5188. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5189. } while (0)
  5190. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5191. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5192. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5193. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5194. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5195. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5196. do { \
  5197. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5198. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5199. } while (0)
  5200. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5201. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5202. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5203. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5204. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5205. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5206. do { \
  5207. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5208. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5209. } while (0)
  5210. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5211. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5212. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5213. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5214. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5215. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5216. do { \
  5217. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5218. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5219. } while (0)
  5220. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5221. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5222. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5223. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5224. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5225. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5226. do { \
  5227. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5228. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5229. } while (0)
  5230. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5231. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5232. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5233. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5234. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5235. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5236. do { \
  5237. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5238. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5239. } while (0)
  5240. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5241. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5242. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5243. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5244. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5245. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5246. do { \
  5247. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5248. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5249. } while (0)
  5250. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5251. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5252. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5253. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5254. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5255. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5256. do { \
  5257. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5258. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5259. } while (0)
  5260. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5261. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5262. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5263. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5264. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5265. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5266. do { \
  5267. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5268. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5269. } while (0)
  5270. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5271. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5272. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5273. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5274. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5275. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5276. do { \
  5277. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5278. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5279. } while (0)
  5280. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5281. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5282. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5283. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5284. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5285. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5286. do { \
  5287. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5288. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5289. } while (0)
  5290. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5291. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5292. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5293. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5294. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5295. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5296. do { \
  5297. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5298. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5299. } while (0)
  5300. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5301. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5302. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5303. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5304. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5305. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5306. do { \
  5307. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5308. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5309. } while (0)
  5310. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5311. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5312. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5313. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5314. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5315. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5316. do { \
  5317. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5318. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5319. } while (0)
  5320. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5321. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5322. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5323. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5324. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5325. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5326. do { \
  5327. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5328. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5329. } while (0)
  5330. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5331. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5332. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5333. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5334. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5335. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5336. do { \
  5337. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5338. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5339. } while (0)
  5340. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5341. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5342. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5343. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5344. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5345. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5346. do { \
  5347. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5348. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5349. } while (0)
  5350. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5351. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5352. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5353. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5354. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5355. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5356. do { \
  5357. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5358. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5359. } while (0)
  5360. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5361. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5362. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5363. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5364. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5365. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5366. do { \
  5367. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5368. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5369. } while (0)
  5370. /*
  5371. * Subtype based MGMT frames enable bits.
  5372. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5373. */
  5374. /* association request */
  5375. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5376. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5377. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5378. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5379. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5380. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5381. /* association response */
  5382. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5383. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5384. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5385. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5386. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5387. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5388. /* Reassociation request */
  5389. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5390. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5391. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5392. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5393. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5394. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5395. /* Reassociation response */
  5396. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5397. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5398. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5399. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5400. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5401. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5402. /* Probe request */
  5403. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5404. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5405. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5406. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5407. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5408. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5409. /* Probe response */
  5410. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5411. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5412. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5413. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5414. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5415. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5416. /* Timing Advertisement */
  5417. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5418. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5419. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5420. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5422. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5423. /* Reserved */
  5424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5427. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5430. /* Beacon */
  5431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5432. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5433. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5437. /* ATIM */
  5438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5440. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5442. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5443. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5444. /* Disassociation */
  5445. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5446. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5447. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5448. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5449. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5450. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5451. /* Authentication */
  5452. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5454. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5456. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5457. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5458. /* Deauthentication */
  5459. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5460. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5461. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5462. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5463. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5464. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5465. /* Action */
  5466. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5467. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5469. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5470. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5471. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5472. /* Action No Ack */
  5473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5476. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5477. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5479. /* Reserved */
  5480. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5481. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5482. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5486. /*
  5487. * Subtype based CTRL frames enable bits.
  5488. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5489. */
  5490. /* Reserved */
  5491. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5492. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5493. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5494. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5495. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5496. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5497. /* Reserved */
  5498. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5499. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5500. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5501. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5502. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5503. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5504. /* Reserved */
  5505. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5506. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5507. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5508. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5509. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5510. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5511. /* Reserved */
  5512. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5513. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5514. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5515. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5516. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5517. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5518. /* Reserved */
  5519. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5520. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5521. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5522. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5523. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5524. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5525. /* Reserved */
  5526. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5527. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5528. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5529. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5530. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5531. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5532. /* Reserved */
  5533. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5534. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5535. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5536. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5537. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5538. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5539. /* Control Wrapper */
  5540. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5541. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5542. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5543. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5544. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5545. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5546. /* Block Ack Request */
  5547. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5548. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5549. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5550. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5551. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5552. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5553. /* Block Ack*/
  5554. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5555. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5556. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5557. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5558. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5559. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5560. /* PS-POLL */
  5561. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5562. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5563. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5564. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5565. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5566. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5567. /* RTS */
  5568. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5569. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5570. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5571. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5572. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5573. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5574. /* CTS */
  5575. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5576. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5577. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5578. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5579. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5580. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5581. /* ACK */
  5582. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5583. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5588. /* CF-END */
  5589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5590. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5592. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5593. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5594. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5595. /* CF-END + CF-ACK */
  5596. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5597. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5598. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5599. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5600. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5601. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5602. /* Multicast data */
  5603. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5604. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5605. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5606. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5607. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5608. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5609. /* Unicast data */
  5610. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5611. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5612. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5613. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5614. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5615. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5616. /* NULL data */
  5617. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5618. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5619. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5620. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5621. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5622. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5623. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5624. do { \
  5625. HTT_CHECK_SET_VAL(httsym, value); \
  5626. (word) |= (value) << httsym##_S; \
  5627. } while (0)
  5628. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5629. (((word) & httsym##_M) >> httsym##_S)
  5630. #define htt_rx_ring_pkt_enable_subtype_set( \
  5631. word, flag, mode, type, subtype, val) \
  5632. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5633. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5634. #define htt_rx_ring_pkt_enable_subtype_get( \
  5635. word, flag, mode, type, subtype) \
  5636. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5637. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5638. /* Definition to filter in TLVs */
  5639. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5640. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5641. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5642. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5643. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5644. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5645. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  5646. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  5647. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  5648. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  5649. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  5650. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  5651. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  5652. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  5653. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  5654. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  5655. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  5656. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  5657. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  5658. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  5659. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  5660. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  5661. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  5662. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  5663. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  5664. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  5665. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  5666. do { \
  5667. HTT_CHECK_SET_VAL(httsym, enable); \
  5668. (word) |= (enable) << httsym##_S; \
  5669. } while (0)
  5670. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  5671. (((word) & httsym##_M) >> httsym##_S)
  5672. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  5673. HTT_RX_RING_TLV_ENABLE_SET( \
  5674. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  5675. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  5676. HTT_RX_RING_TLV_ENABLE_GET( \
  5677. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  5678. /**
  5679. * @brief host -> target TX monitor config message
  5680. *
  5681. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  5682. *
  5683. * @details
  5684. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  5685. * configure RXDMA rings.
  5686. * The configuration is per ring based and includes both packet types
  5687. * and PPDU/MPDU TLVs.
  5688. *
  5689. * The message would appear as follows:
  5690. *
  5691. * |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|
  5692. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5693. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  5694. * |-----------+--------+--------+-----+------------------------------------|
  5695. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  5696. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  5697. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  5698. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  5699. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  5700. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  5701. * |------------------------------------------------------------------------|
  5702. * | tlv_filter_mask_in0 |
  5703. * |------------------------------------------------------------------------|
  5704. * | tlv_filter_mask_in1 |
  5705. * |------------------------------------------------------------------------|
  5706. * | tlv_filter_mask_in2 |
  5707. * |------------------------------------------------------------------------|
  5708. * | tlv_filter_mask_in3 |
  5709. * |-----------------+-----------------+---------------------+--------------|
  5710. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  5711. * |------------------------------------------------------------------------|
  5712. * | pcu_ppdu_setup_word_mask |
  5713. * |--------------------+--+--+--+-----+---------------------+--------------|
  5714. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  5715. * |------------------------------------------------------------------------|
  5716. *
  5717. * Where:
  5718. * PS = pkt_swap
  5719. * SS = status_swap
  5720. * The message is interpreted as follows:
  5721. * dword0 - b'0:7 - msg_type: This will be set to
  5722. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  5723. * b'8:15 - pdev_id:
  5724. * 0 (for rings at SOC level),
  5725. * 1/2/3 mac id (for rings at LMAC level)
  5726. * b'16:23 - ring_id : Identify the ring to configure.
  5727. * More details can be got from enum htt_srng_ring_id
  5728. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5729. * BUF_RING_CFG_0 defs within HW .h files,
  5730. * e.g. wmac_top_reg_seq_hwioreg.h
  5731. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5732. * BUF_RING_CFG_0 defs within HW .h files,
  5733. * e.g. wmac_top_reg_seq_hwioreg.h
  5734. * b'26:31 - rsvd1: reserved for future use
  5735. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5736. * in byte units.
  5737. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5738. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  5739. * 64, 128, 256.
  5740. * If all 3 bits are set config length is > 256.
  5741. * if val is '0', then ignore this field.
  5742. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  5743. * 64, 128, 256.
  5744. * If all 3 bits are set config length is > 256.
  5745. * if val is '0', then ignore this field.
  5746. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  5747. * 64, 128, 256.
  5748. * If all 3 bits are set config length is > 256.
  5749. * If val is '0', then ignore this field.
  5750. * - b'25:31 - rsvd2: Reserved for future use
  5751. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  5752. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  5753. * If packet_type_enable_flags is '1' for MGMT type,
  5754. * monitor will ignore this bit and allow this TLV.
  5755. * If packet_type_enable_flags is '0' for MGMT type,
  5756. * monitor will use this bit to enable/disable logging
  5757. * of this TLV.
  5758. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  5759. * If packet_type_enable_flags is '1' for CTRL type,
  5760. * monitor will ignore this bit and allow this TLV.
  5761. * If packet_type_enable_flags is '0' for CTRL type,
  5762. * monitor will use this bit to enable/disable logging
  5763. * of this TLV.
  5764. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  5765. * If packet_type_enable_flags is '1' for DATA type,
  5766. * monitor will ignore this bit and allow this TLV.
  5767. * If packet_type_enable_flags is '0' for DATA type,
  5768. * monitor will use this bit to enable/disable logging
  5769. * of this TLV.
  5770. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  5771. * If packet_type_enable_flags is '1' for MGMT type,
  5772. * monitor will ignore this bit and allow this TLV.
  5773. * If packet_type_enable_flags is '0' for MGMT type,
  5774. * monitor will use this bit to enable/disable logging
  5775. * of this TLV.
  5776. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  5777. * If packet_type_enable_flags is '1' for CTRL type,
  5778. * monitor will ignore this bit and allow this TLV.
  5779. * If packet_type_enable_flags is '0' for CTRL type,
  5780. * monitor will use this bit to enable/disable logging
  5781. * of this TLV.
  5782. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  5783. * If packet_type_enable_flags is '1' for DATA type,
  5784. * monitor will ignore this bit and allow this TLV.
  5785. * If packet_type_enable_flags is '0' for DATA type,
  5786. * monitor will use this bit to enable/disable logging
  5787. * of this TLV.
  5788. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  5789. * If packet_type_enable_flags is '1' for MGMT type,
  5790. * monitor will ignore this bit and allow this TLV.
  5791. * If packet_type_enable_flags is '0' for MGMT type,
  5792. * monitor will use this bit to enable/disable logging
  5793. * of this TLV.
  5794. * If filter_in_TX_MPDU_START = 1 it is recommended
  5795. * to set this bit.
  5796. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  5797. * If packet_type_enable_flags is '1' for CTRL type,
  5798. * monitor will ignore this bit and allow this TLV.
  5799. * If packet_type_enable_flags is '0' for CTRL type,
  5800. * monitor will use this bit to enable/disable logging
  5801. * of this TLV.
  5802. * If filter_in_TX_MPDU_START = 1 it is recommended
  5803. * to set this bit.
  5804. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  5805. * If packet_type_enable_flags is '1' for DATA type,
  5806. * monitor will ignore this bit and allow this TLV.
  5807. * If packet_type_enable_flags is '0' for DATA type,
  5808. * monitor will use this bit to enable/disable logging
  5809. * of this TLV.
  5810. * If filter_in_TX_MPDU_START = 1 it is recommended
  5811. * to set this bit.
  5812. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  5813. * If packet_type_enable_flags is '1' for MGMT type,
  5814. * monitor will ignore this bit and allow this TLV.
  5815. * If packet_type_enable_flags is '0' for MGMT type,
  5816. * monitor will use this bit to enable/disable logging
  5817. * of this TLV.
  5818. * If filter_in_TX_MSDU_START = 1 it is recommended
  5819. * to set this bit.
  5820. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  5821. * If packet_type_enable_flags is '1' for CTRL type,
  5822. * monitor will ignore this bit and allow this TLV.
  5823. * If packet_type_enable_flags is '0' for CTRL type,
  5824. * monitor will use this bit to enable/disable logging
  5825. * of this TLV.
  5826. * If filter_in_TX_MSDU_START = 1 it is recommended
  5827. * to set this bit.
  5828. * b'14 - filter_in_tx_msdu_end_data(MSED)
  5829. * If packet_type_enable_flags is '1' for DATA type,
  5830. * monitor will ignore this bit and allow this TLV.
  5831. * If packet_type_enable_flags is '0' for DATA type,
  5832. * monitor will use this bit to enable/disable logging
  5833. * of this TLV.
  5834. * If filter_in_TX_MSDU_START = 1 it is recommended
  5835. * to set this bit.
  5836. * b'15:31 - rsvd3: Reserved for future use
  5837. * dword3 - b'0:31 - tlv_filter_mask_in0:
  5838. * dword4 - b'0:31 - tlv_filter_mask_in1:
  5839. * dword5 - b'0:31 - tlv_filter_mask_in2:
  5840. * dword6 - b'0:31 - tlv_filter_mask_in3:
  5841. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  5842. * - b'8:15 - tx_peer_entry_word_mask:
  5843. * - b'16:23 - tx_queue_ext_word_mask:
  5844. * - b'24:31 - tx_msdu_start_word_mask:
  5845. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  5846. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  5847. * - b'8:15 - rxpcu_user_setup_word_mask:
  5848. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  5849. * MGMT, CTRL, DATA
  5850. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  5851. * 0 -> MSDU level logging is enabled
  5852. * (valid only if bit is set in
  5853. * pkt_type_enable_msdu_or_mpdu_logging)
  5854. * 1 -> MPDU level logging is enabled
  5855. * (valid only if bit is set in
  5856. * pkt_type_enable_msdu_or_mpdu_logging)
  5857. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  5858. * 0 -> MSDU level logging is enabled
  5859. * (valid only if bit is set in
  5860. * pkt_type_enable_msdu_or_mpdu_logging)
  5861. * 1 -> MPDU level logging is enabled
  5862. * (valid only if bit is set in
  5863. * pkt_type_enable_msdu_or_mpdu_logging)
  5864. * - b'21 - dma_mpdu_data(D) : For DATA
  5865. * 0 -> MSDU level logging is enabled
  5866. * (valid only if bit is set in
  5867. * pkt_type_enable_msdu_or_mpdu_logging)
  5868. * 1 -> MPDU level logging is enabled
  5869. * (valid only if bit is set in
  5870. * pkt_type_enable_msdu_or_mpdu_logging)
  5871. * - b'22:31 - rsvd4 for future use
  5872. */
  5873. PREPACK struct htt_tx_monitor_cfg_t {
  5874. A_UINT32 msg_type: 8,
  5875. pdev_id: 8,
  5876. ring_id: 8,
  5877. status_swap: 1,
  5878. pkt_swap: 1,
  5879. rsvd1: 6;
  5880. A_UINT32 ring_buffer_size: 16,
  5881. config_length_mgmt: 3,
  5882. config_length_ctrl: 3,
  5883. config_length_data: 3,
  5884. rsvd2: 7;
  5885. A_UINT32 pkt_type_enable_flags: 3,
  5886. filter_in_tx_mpdu_start_mgmt: 1,
  5887. filter_in_tx_mpdu_start_ctrl: 1,
  5888. filter_in_tx_mpdu_start_data: 1,
  5889. filter_in_tx_msdu_start_mgmt: 1,
  5890. filter_in_tx_msdu_start_ctrl: 1,
  5891. filter_in_tx_msdu_start_data: 1,
  5892. filter_in_tx_mpdu_end_mgmt: 1,
  5893. filter_in_tx_mpdu_end_ctrl: 1,
  5894. filter_in_tx_mpdu_end_data: 1,
  5895. filter_in_tx_msdu_end_mgmt: 1,
  5896. filter_in_tx_msdu_end_ctrl: 1,
  5897. filter_in_tx_msdu_end_data: 1,
  5898. rsvd3: 17;
  5899. A_UINT32 tlv_filter_mask_in0;
  5900. A_UINT32 tlv_filter_mask_in1;
  5901. A_UINT32 tlv_filter_mask_in2;
  5902. A_UINT32 tlv_filter_mask_in3;
  5903. A_UINT32 tx_fes_setup_word_mask: 8,
  5904. tx_peer_entry_word_mask: 8,
  5905. tx_queue_ext_word_mask: 8,
  5906. tx_msdu_start_word_mask: 8;
  5907. A_UINT32 pcu_ppdu_setup_word_mask;
  5908. A_UINT32 tx_mpdu_start_word_mask: 8,
  5909. rxpcu_user_setup_word_mask: 8,
  5910. pkt_type_enable_msdu_or_mpdu_logging: 3,
  5911. dma_mpdu_mgmt: 1,
  5912. dma_mpdu_ctrl: 1,
  5913. dma_mpdu_data: 1,
  5914. rsvd4: 10;
  5915. } POSTPACK;
  5916. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  5917. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  5918. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  5919. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  5920. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  5921. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  5922. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  5923. do { \
  5924. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  5925. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  5926. } while (0)
  5927. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  5928. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  5929. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  5930. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  5931. HTT_TX_MONITOR_CFG_RING_ID_S)
  5932. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  5933. do { \
  5934. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  5935. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  5936. } while (0)
  5937. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  5938. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  5939. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  5940. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  5941. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  5942. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  5943. do { \
  5944. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  5945. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  5946. } while (0)
  5947. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  5948. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  5949. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  5950. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  5951. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  5952. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  5953. do { \
  5954. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  5955. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  5956. } while (0)
  5957. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5958. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  5959. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  5960. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  5961. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  5962. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5963. do { \
  5964. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  5965. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  5966. } while (0)
  5967. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5968. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  5969. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5970. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5971. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  5972. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5973. do { \
  5974. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  5975. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  5976. } while (0)
  5977. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5978. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  5979. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5980. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5981. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  5982. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5983. do { \
  5984. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  5985. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  5986. } while (0)
  5987. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5988. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  5989. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5990. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  5991. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  5992. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5993. do { \
  5994. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  5995. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  5996. } while (0)
  5997. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  5998. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  5999. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6000. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6001. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6002. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6003. do { \
  6004. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6005. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6006. } while (0)
  6007. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6008. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6009. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6010. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6011. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6012. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6013. do { \
  6014. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6015. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6016. } while (0)
  6017. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6018. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6019. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6020. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6021. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6022. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6023. do { \
  6024. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6025. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6026. } while (0
  6027. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6028. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6029. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6030. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6031. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6032. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6033. do { \
  6034. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6035. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6036. } while (0)
  6037. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6038. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6039. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6040. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6041. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6042. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6043. do { \
  6044. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6045. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6046. } while (0)
  6047. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6048. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6049. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6050. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6051. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6052. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6053. do { \
  6054. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6055. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6056. } while (0
  6057. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6058. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6059. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6060. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6061. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6062. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6063. do { \
  6064. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6065. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6066. } while (0)
  6067. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6068. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6069. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6070. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6071. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6072. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6073. do { \
  6074. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6075. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6076. } while (0)
  6077. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6078. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6079. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6080. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6081. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6082. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6083. do { \
  6084. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6085. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6086. } while (0
  6087. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6088. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6089. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6090. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6091. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6092. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6093. do { \
  6094. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6095. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6096. } while (0)
  6097. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6098. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6099. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6100. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6101. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6102. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6103. do { \
  6104. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6105. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6106. } while (0)
  6107. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6108. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6109. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6110. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6111. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6112. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6113. do { \
  6114. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6115. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6116. } while (0
  6117. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6118. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6119. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6120. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6121. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6122. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6123. do { \
  6124. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6125. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6126. } while (0)
  6127. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6128. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6129. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6130. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6131. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6132. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6133. do { \
  6134. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6135. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6136. } while (0)
  6137. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6138. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6139. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6140. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6141. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6142. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6143. do { \
  6144. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6145. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6146. } while (0)
  6147. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6148. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6149. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6150. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6151. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6152. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6153. do { \
  6154. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6155. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6156. } while (0)
  6157. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6158. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6159. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6160. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6161. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6162. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6163. do { \
  6164. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6165. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6166. } while (0)
  6167. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6168. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6169. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6170. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6171. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6172. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6173. do { \
  6174. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6175. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6176. } while (0)
  6177. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6178. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6179. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6180. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6181. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6182. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6183. do { \
  6184. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6185. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6186. } while (0)
  6187. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6188. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6189. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6190. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6191. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6192. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6193. do { \
  6194. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6195. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6196. } while (0)
  6197. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6198. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6199. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6200. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6201. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6202. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6203. do { \
  6204. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6205. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6206. } while (0)
  6207. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6208. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6209. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6210. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6211. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6212. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6213. do { \
  6214. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6215. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6216. } while (0)
  6217. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6218. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6219. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6220. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6221. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6222. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6223. do { \
  6224. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6225. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6226. } while (0)
  6227. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6228. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6229. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6230. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6231. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6232. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6233. do { \
  6234. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6235. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6236. } while (0)
  6237. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6238. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6239. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6240. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6241. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6242. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6243. do { \
  6244. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6245. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6246. } while (0)
  6247. /*
  6248. * pkt_type_enable_flags
  6249. */
  6250. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6251. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6252. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6253. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6254. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6255. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6256. /*
  6257. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6258. */
  6259. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6260. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6261. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6262. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6263. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6264. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6265. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6266. do { \
  6267. HTT_CHECK_SET_VAL(httsym, value); \
  6268. (word) |= (value) << httsym##_S; \
  6269. } while (0)
  6270. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6271. (((word) & httsym##_M) >> httsym##_S)
  6272. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6273. * type -> MGMT, CTRL, DATA*/
  6274. #define htt_tx_ring_pkt_type_set( \
  6275. word, mode, type, val) \
  6276. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6277. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6278. #define htt_tx_ring_pkt_type_get( \
  6279. word, mode, type) \
  6280. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6281. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6282. /* Definition to filter in TLVs */
  6283. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6284. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6285. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6286. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6287. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6288. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6289. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6290. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6291. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6292. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6293. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6294. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6295. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6296. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6297. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6298. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6299. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6300. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6301. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6302. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6303. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6304. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6305. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6306. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6307. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6308. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6309. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6310. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6311. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6312. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6313. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6314. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6315. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6316. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6317. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6318. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6319. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6320. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6321. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6322. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6323. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6324. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6325. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6326. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6327. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6328. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6329. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6330. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6331. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6332. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6333. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6334. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6335. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6336. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6337. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6338. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6339. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6340. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6341. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6342. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6343. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6344. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6345. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6346. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6347. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6348. do { \
  6349. HTT_CHECK_SET_VAL(httsym, enable); \
  6350. (word) |= (enable) << httsym##_S; \
  6351. } while (0)
  6352. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6353. (((word) & httsym##_M) >> httsym##_S)
  6354. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6355. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6356. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6357. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6358. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6359. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6360. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6361. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6362. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6363. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6364. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6365. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6366. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6367. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6368. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6369. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6370. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6371. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6372. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6373. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6374. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6375. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6376. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6377. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6378. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6379. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6380. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6381. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6382. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6383. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6384. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6385. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6386. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6387. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6388. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6389. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6390. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6391. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6392. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6393. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6394. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6395. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6396. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6397. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6398. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6399. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6400. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6401. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6402. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6403. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6404. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6405. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6406. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6407. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6408. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6409. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6410. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6411. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6412. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6413. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6414. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6415. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6416. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6417. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6418. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6419. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6420. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6421. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6422. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6423. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6424. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6425. do { \
  6426. HTT_CHECK_SET_VAL(httsym, enable); \
  6427. (word) |= (enable) << httsym##_S; \
  6428. } while (0)
  6429. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6430. (((word) & httsym##_M) >> httsym##_S)
  6431. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6432. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6433. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6434. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6435. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6436. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6437. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6438. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6439. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6440. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6441. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6442. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6443. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6444. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6445. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6446. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6447. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6448. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6449. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6450. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6451. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6452. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6453. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6454. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6455. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6456. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6457. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6458. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6459. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6460. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6461. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6462. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6463. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6464. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6465. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6466. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6467. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6468. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6469. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6470. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6471. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6472. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6473. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6474. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6475. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6476. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6477. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6478. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6479. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6480. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6481. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6482. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6483. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6484. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6485. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6486. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6487. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6488. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6489. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6490. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6491. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6492. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6493. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6494. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6495. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6496. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6497. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6498. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6499. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6500. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6501. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6502. do { \
  6503. HTT_CHECK_SET_VAL(httsym, enable); \
  6504. (word) |= (enable) << httsym##_S; \
  6505. } while (0)
  6506. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6507. (((word) & httsym##_M) >> httsym##_S)
  6508. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6509. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6510. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6511. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6512. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6513. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6514. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6515. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6516. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6517. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6518. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6519. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6520. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6521. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6522. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6523. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6524. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6525. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6526. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6527. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6528. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6529. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6530. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6531. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6532. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6533. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6534. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6535. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6536. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6537. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6538. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6539. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6540. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6541. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6542. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6543. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6544. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6545. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6546. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6547. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6548. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6549. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6550. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6551. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6552. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6553. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6554. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6555. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6556. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6557. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6558. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6559. do { \
  6560. HTT_CHECK_SET_VAL(httsym, enable); \
  6561. (word) |= (enable) << httsym##_S; \
  6562. } while (0)
  6563. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6564. (((word) & httsym##_M) >> httsym##_S)
  6565. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6566. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6567. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6568. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6569. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6570. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6571. /**
  6572. * @brief host --> target Receive Flow Steering configuration message definition
  6573. *
  6574. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6575. *
  6576. * host --> target Receive Flow Steering configuration message definition.
  6577. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6578. * The reason for this is we want RFS to be configured and ready before MAC
  6579. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6580. *
  6581. * |31 24|23 16|15 9|8|7 0|
  6582. * |----------------+----------------+----------------+----------------|
  6583. * | reserved |E| msg type |
  6584. * |-------------------------------------------------------------------|
  6585. * Where E = RFS enable flag
  6586. *
  6587. * The RFS_CONFIG message consists of a single 4-byte word.
  6588. *
  6589. * Header fields:
  6590. * - MSG_TYPE
  6591. * Bits 7:0
  6592. * Purpose: identifies this as a RFS config msg
  6593. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6594. * - RFS_CONFIG
  6595. * Bit 8
  6596. * Purpose: Tells target whether to enable (1) or disable (0)
  6597. * flow steering feature when sending rx indication messages to host
  6598. */
  6599. #define HTT_H2T_RFS_CONFIG_M 0x100
  6600. #define HTT_H2T_RFS_CONFIG_S 8
  6601. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6602. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6603. HTT_H2T_RFS_CONFIG_S)
  6604. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6605. do { \
  6606. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6607. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6608. } while (0)
  6609. #define HTT_RFS_CFG_REQ_BYTES 4
  6610. /**
  6611. * @brief host -> target FW extended statistics retrieve
  6612. *
  6613. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6614. *
  6615. * @details
  6616. * The following field definitions describe the format of the HTT host
  6617. * to target FW extended stats retrieve message.
  6618. * The message specifies the type of stats the host wants to retrieve.
  6619. *
  6620. * |31 24|23 16|15 8|7 0|
  6621. * |-----------------------------------------------------------|
  6622. * | reserved | stats type | pdev_mask | msg type |
  6623. * |-----------------------------------------------------------|
  6624. * | config param [0] |
  6625. * |-----------------------------------------------------------|
  6626. * | config param [1] |
  6627. * |-----------------------------------------------------------|
  6628. * | config param [2] |
  6629. * |-----------------------------------------------------------|
  6630. * | config param [3] |
  6631. * |-----------------------------------------------------------|
  6632. * | reserved |
  6633. * |-----------------------------------------------------------|
  6634. * | cookie LSBs |
  6635. * |-----------------------------------------------------------|
  6636. * | cookie MSBs |
  6637. * |-----------------------------------------------------------|
  6638. * Header fields:
  6639. * - MSG_TYPE
  6640. * Bits 7:0
  6641. * Purpose: identifies this is a extended stats upload request message
  6642. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  6643. * - PDEV_MASK
  6644. * Bits 8:15
  6645. * Purpose: identifies the mask of PDEVs to retrieve stats from
  6646. * Value: This is a overloaded field, refer to usage and interpretation of
  6647. * PDEV in interface document.
  6648. * Bit 8 : Reserved for SOC stats
  6649. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6650. * Indicates MACID_MASK in DBS
  6651. * - STATS_TYPE
  6652. * Bits 23:16
  6653. * Purpose: identifies which FW statistics to upload
  6654. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  6655. * - Reserved
  6656. * Bits 31:24
  6657. * - CONFIG_PARAM [0]
  6658. * Bits 31:0
  6659. * Purpose: give an opaque configuration value to the specified stats type
  6660. * Value: stats-type specific configuration value
  6661. * Refer to htt_stats.h for interpretation for each stats sub_type
  6662. * - CONFIG_PARAM [1]
  6663. * Bits 31:0
  6664. * Purpose: give an opaque configuration value to the specified stats type
  6665. * Value: stats-type specific configuration value
  6666. * Refer to htt_stats.h for interpretation for each stats sub_type
  6667. * - CONFIG_PARAM [2]
  6668. * Bits 31:0
  6669. * Purpose: give an opaque configuration value to the specified stats type
  6670. * Value: stats-type specific configuration value
  6671. * Refer to htt_stats.h for interpretation for each stats sub_type
  6672. * - CONFIG_PARAM [3]
  6673. * Bits 31:0
  6674. * Purpose: give an opaque configuration value to the specified stats type
  6675. * Value: stats-type specific configuration value
  6676. * Refer to htt_stats.h for interpretation for each stats sub_type
  6677. * - Reserved [31:0] for future use.
  6678. * - COOKIE_LSBS
  6679. * Bits 31:0
  6680. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6681. * message with its preceding host->target stats request message.
  6682. * Value: LSBs of the opaque cookie specified by the host-side requestor
  6683. * - COOKIE_MSBS
  6684. * Bits 31:0
  6685. * Purpose: Provide a mechanism to match a target->host stats confirmation
  6686. * message with its preceding host->target stats request message.
  6687. * Value: MSBs of the opaque cookie specified by the host-side requestor
  6688. */
  6689. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  6690. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  6691. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  6692. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  6693. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  6694. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  6695. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  6696. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  6697. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  6698. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  6699. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  6700. do { \
  6701. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  6702. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  6703. } while (0)
  6704. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  6705. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  6706. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  6707. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  6708. do { \
  6709. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  6710. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  6711. } while (0)
  6712. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  6713. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  6714. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  6715. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  6716. do { \
  6717. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  6718. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  6719. } while (0)
  6720. /**
  6721. * @brief host -> target FW PPDU_STATS request message
  6722. *
  6723. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  6724. *
  6725. * @details
  6726. * The following field definitions describe the format of the HTT host
  6727. * to target FW for PPDU_STATS_CFG msg.
  6728. * The message allows the host to configure the PPDU_STATS_IND messages
  6729. * produced by the target.
  6730. *
  6731. * |31 24|23 16|15 8|7 0|
  6732. * |-----------------------------------------------------------|
  6733. * | REQ bit mask | pdev_mask | msg type |
  6734. * |-----------------------------------------------------------|
  6735. * Header fields:
  6736. * - MSG_TYPE
  6737. * Bits 7:0
  6738. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  6739. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  6740. * - PDEV_MASK
  6741. * Bits 8:15
  6742. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  6743. * Value: This is a overloaded field, refer to usage and interpretation of
  6744. * PDEV in interface document.
  6745. * Bit 8 : Reserved for SOC stats
  6746. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  6747. * Indicates MACID_MASK in DBS
  6748. * - REQ_TLV_BIT_MASK
  6749. * Bits 16:31
  6750. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  6751. * needs to be included in the target's PPDU_STATS_IND messages.
  6752. * Value: refer htt_ppdu_stats_tlv_tag_t
  6753. *
  6754. */
  6755. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  6756. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  6757. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  6758. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  6759. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  6760. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  6761. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  6762. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  6763. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  6764. do { \
  6765. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  6766. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  6767. } while (0)
  6768. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  6769. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  6770. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  6771. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  6772. do { \
  6773. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  6774. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  6775. } while (0)
  6776. /**
  6777. * @brief Host-->target HTT RX FSE setup message
  6778. *
  6779. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  6780. *
  6781. * @details
  6782. * Through this message, the host will provide details of the flow tables
  6783. * in host DDR along with hash keys.
  6784. * This message can be sent per SOC or per PDEV, which is differentiated
  6785. * by pdev id values.
  6786. * The host will allocate flow search table and sends table size,
  6787. * physical DMA address of flow table, and hash keys to firmware to
  6788. * program into the RXOLE FSE HW block.
  6789. *
  6790. * The following field definitions describe the format of the RX FSE setup
  6791. * message sent from the host to target
  6792. *
  6793. * Header fields:
  6794. * dword0 - b'7:0 - msg_type: This will be set to
  6795. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  6796. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6797. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6798. * pdev's LMAC ring.
  6799. * b'31:16 - reserved : Reserved for future use
  6800. * dword1 - b'19:0 - number of records: This field indicates the number of
  6801. * entries in the flow table. For example: 8k number of
  6802. * records is equivalent to
  6803. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  6804. * b'27:20 - max search: This field specifies the skid length to FSE
  6805. * parser HW module whenever match is not found at the
  6806. * exact index pointed by hash.
  6807. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  6808. * Refer htt_ip_da_sa_prefix below for more details.
  6809. * b'31:30 - reserved: Reserved for future use
  6810. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  6811. * table allocated by host in DDR
  6812. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  6813. * table allocated by host in DDR
  6814. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  6815. * entry hashing
  6816. *
  6817. *
  6818. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  6819. * |---------------------------------------------------------------|
  6820. * | reserved | pdev_id | MSG_TYPE |
  6821. * |---------------------------------------------------------------|
  6822. * |resvd|IPDSA| max_search | Number of records |
  6823. * |---------------------------------------------------------------|
  6824. * | base address lo |
  6825. * |---------------------------------------------------------------|
  6826. * | base address high |
  6827. * |---------------------------------------------------------------|
  6828. * | toeplitz key 31_0 |
  6829. * |---------------------------------------------------------------|
  6830. * | toeplitz key 63_32 |
  6831. * |---------------------------------------------------------------|
  6832. * | toeplitz key 95_64 |
  6833. * |---------------------------------------------------------------|
  6834. * | toeplitz key 127_96 |
  6835. * |---------------------------------------------------------------|
  6836. * | toeplitz key 159_128 |
  6837. * |---------------------------------------------------------------|
  6838. * | toeplitz key 191_160 |
  6839. * |---------------------------------------------------------------|
  6840. * | toeplitz key 223_192 |
  6841. * |---------------------------------------------------------------|
  6842. * | toeplitz key 255_224 |
  6843. * |---------------------------------------------------------------|
  6844. * | toeplitz key 287_256 |
  6845. * |---------------------------------------------------------------|
  6846. * | reserved | toeplitz key 314_288(26:0 bits) |
  6847. * |---------------------------------------------------------------|
  6848. * where:
  6849. * IPDSA = ip_da_sa
  6850. */
  6851. /**
  6852. * @brief: htt_ip_da_sa_prefix
  6853. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  6854. * IPv6 addresses beginning with 0x20010db8 are reserved for
  6855. * documentation per RFC3849
  6856. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  6857. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  6858. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  6859. */
  6860. enum htt_ip_da_sa_prefix {
  6861. HTT_RX_IPV6_20010db8,
  6862. HTT_RX_IPV4_MAPPED_IPV6,
  6863. HTT_RX_IPV4_COMPATIBLE_IPV6,
  6864. HTT_RX_IPV6_64FF9B,
  6865. };
  6866. /**
  6867. * @brief Host-->target HTT RX FISA configure and enable
  6868. *
  6869. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  6870. *
  6871. * @details
  6872. * The host will send this command down to configure and enable the FISA
  6873. * operational params.
  6874. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  6875. * register.
  6876. * Should configure both the MACs.
  6877. *
  6878. * dword0 - b'7:0 - msg_type:
  6879. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  6880. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  6881. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  6882. * pdev's LMAC ring.
  6883. * b'31:16 - reserved : Reserved for future use
  6884. *
  6885. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  6886. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  6887. * packets. 1 flow search will be skipped
  6888. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  6889. * tcp,udp packets
  6890. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  6891. * calculation
  6892. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  6893. * calculation
  6894. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  6895. * calculation
  6896. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  6897. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  6898. * length
  6899. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  6900. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  6901. * length
  6902. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  6903. * num jump
  6904. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  6905. * num jump
  6906. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  6907. * data type switch has happend for MPDU Sequence num jump
  6908. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  6909. * for MPDU Sequence num jump
  6910. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  6911. * for decrypt errors
  6912. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  6913. * while aggregating a msdu
  6914. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  6915. * The aggregation is done until (number of MSDUs aggregated
  6916. * < LIMIT + 1)
  6917. * b'31:18 - Reserved
  6918. *
  6919. * fisa_control_value - 32bit value FW can write to register
  6920. *
  6921. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  6922. * Threshold value for FISA timeout (units are microseconds).
  6923. * When the global timestamp exceeds this threshold, FISA
  6924. * aggregation will be restarted.
  6925. * A value of 0 means timeout is disabled.
  6926. * Compare the threshold register with timestamp field in
  6927. * flow entry to generate timeout for the flow.
  6928. *
  6929. * |31 18 |17 16|15 8|7 0|
  6930. * |-------------------------------------------------------------|
  6931. * | reserved | pdev_mask | msg type |
  6932. * |-------------------------------------------------------------|
  6933. * | reserved | FISA_CTRL |
  6934. * |-------------------------------------------------------------|
  6935. * | FISA_TIMEOUT_THRESH |
  6936. * |-------------------------------------------------------------|
  6937. */
  6938. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  6939. A_UINT32 msg_type:8,
  6940. pdev_id:8,
  6941. reserved0:16;
  6942. /**
  6943. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  6944. * [17:0]
  6945. */
  6946. union {
  6947. /*
  6948. * fisa_control_bits structure is deprecated.
  6949. * Please use fisa_control_bits_v2 going forward.
  6950. */
  6951. struct {
  6952. A_UINT32 fisa_enable: 1,
  6953. ipsec_skip_search: 1,
  6954. nontcp_skip_search: 1,
  6955. add_ipv4_fixed_hdr_len: 1,
  6956. add_ipv6_fixed_hdr_len: 1,
  6957. add_tcp_fixed_hdr_len: 1,
  6958. add_udp_hdr_len: 1,
  6959. chksum_cum_ip_len_en: 1,
  6960. disable_tid_check: 1,
  6961. disable_ta_check: 1,
  6962. disable_qos_check: 1,
  6963. disable_raw_check: 1,
  6964. disable_decrypt_err_check: 1,
  6965. disable_msdu_drop_check: 1,
  6966. fisa_aggr_limit: 4,
  6967. reserved: 14;
  6968. } fisa_control_bits;
  6969. struct {
  6970. A_UINT32 fisa_enable: 1,
  6971. fisa_aggr_limit: 4,
  6972. reserved: 27;
  6973. } fisa_control_bits_v2;
  6974. A_UINT32 fisa_control_value;
  6975. } u_fisa_control;
  6976. /**
  6977. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  6978. * timeout threshold for aggregation. Unit in usec.
  6979. * [31:0]
  6980. */
  6981. A_UINT32 fisa_timeout_threshold;
  6982. } POSTPACK;
  6983. /* DWord 0: pdev-ID */
  6984. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  6985. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  6986. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  6987. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  6988. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  6989. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  6990. do { \
  6991. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  6992. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  6993. } while (0)
  6994. /* Dword 1: fisa_control_value fisa config */
  6995. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  6996. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  6997. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  6998. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  6999. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7000. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7001. do { \
  7002. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7003. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7004. } while (0)
  7005. /* Dword 1: fisa_control_value ipsec_skip_search */
  7006. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7007. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7008. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7009. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7010. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7011. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7012. do { \
  7013. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7014. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7015. } while (0)
  7016. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7017. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7018. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7019. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7020. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7021. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7022. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7023. do { \
  7024. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7025. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7026. } while (0)
  7027. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7028. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7029. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7030. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7031. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7032. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7033. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7034. do { \
  7035. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7036. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7037. } while (0)
  7038. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7039. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7040. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7041. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7042. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7043. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7044. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7045. do { \
  7046. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7047. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7048. } while (0)
  7049. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7050. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7051. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7052. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7053. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7054. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7055. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7056. do { \
  7057. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7058. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7059. } while (0)
  7060. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7061. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7062. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7063. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7064. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7065. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7066. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7067. do { \
  7068. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7069. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7070. } while (0)
  7071. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7072. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7073. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7074. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7075. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7076. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7077. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7078. do { \
  7079. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7080. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7081. } while (0)
  7082. /* Dword 1: fisa_control_value disable_tid_check */
  7083. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7084. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7085. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7086. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7087. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7088. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7089. do { \
  7090. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7091. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7092. } while (0)
  7093. /* Dword 1: fisa_control_value disable_ta_check */
  7094. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7095. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7096. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7097. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7098. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7099. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7100. do { \
  7101. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7102. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7103. } while (0)
  7104. /* Dword 1: fisa_control_value disable_qos_check */
  7105. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7106. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7107. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7108. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7109. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7110. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7111. do { \
  7112. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7113. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7114. } while (0)
  7115. /* Dword 1: fisa_control_value disable_raw_check */
  7116. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7117. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7118. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7119. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7120. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7121. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7122. do { \
  7123. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7124. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7125. } while (0)
  7126. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7127. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7128. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7129. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7130. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7131. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7132. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7133. do { \
  7134. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7135. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7136. } while (0)
  7137. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7138. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7139. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7140. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7141. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7142. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7143. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7144. do { \
  7145. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7146. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7147. } while (0)
  7148. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7149. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7150. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7151. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7152. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7153. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7154. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7155. do { \
  7156. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7157. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7158. } while (0)
  7159. /* Dword 1: fisa_control_value fisa config */
  7160. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7161. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7162. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7163. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7164. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7165. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7166. do { \
  7167. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7168. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7169. } while (0)
  7170. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7171. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7172. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7173. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7174. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7175. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7176. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7177. do { \
  7178. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7179. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7180. } while (0)
  7181. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7182. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7183. pdev_id:8,
  7184. reserved0:16;
  7185. A_UINT32 num_records:20,
  7186. max_search:8,
  7187. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7188. reserved1:2;
  7189. A_UINT32 base_addr_lo;
  7190. A_UINT32 base_addr_hi;
  7191. A_UINT32 toeplitz31_0;
  7192. A_UINT32 toeplitz63_32;
  7193. A_UINT32 toeplitz95_64;
  7194. A_UINT32 toeplitz127_96;
  7195. A_UINT32 toeplitz159_128;
  7196. A_UINT32 toeplitz191_160;
  7197. A_UINT32 toeplitz223_192;
  7198. A_UINT32 toeplitz255_224;
  7199. A_UINT32 toeplitz287_256;
  7200. A_UINT32 toeplitz314_288:27,
  7201. reserved2:5;
  7202. } POSTPACK;
  7203. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7204. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7205. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7206. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7207. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7208. /* DWORD 0: Pdev ID */
  7209. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7210. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7211. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7212. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7213. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7214. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7215. do { \
  7216. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7217. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7218. } while (0)
  7219. /* DWORD 1:num of records */
  7220. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7221. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7222. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7223. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7224. HTT_RX_FSE_SETUP_NUM_REC_S)
  7225. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7226. do { \
  7227. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7228. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7229. } while (0)
  7230. /* DWORD 1:max_search */
  7231. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7232. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7233. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7234. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7235. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7236. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7237. do { \
  7238. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7239. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7240. } while (0)
  7241. /* DWORD 1:ip_da_sa prefix */
  7242. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7243. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7244. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7245. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7246. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7247. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7248. do { \
  7249. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7250. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7251. } while (0)
  7252. /* DWORD 2: Base Address LO */
  7253. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7254. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7255. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7256. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7257. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7258. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7259. do { \
  7260. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7261. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7262. } while (0)
  7263. /* DWORD 3: Base Address High */
  7264. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7265. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7266. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7267. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7268. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7269. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7270. do { \
  7271. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7272. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7273. } while (0)
  7274. /* DWORD 4-12: Hash Value */
  7275. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7276. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7277. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7278. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7279. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7280. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7281. do { \
  7282. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7283. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7284. } while (0)
  7285. /* DWORD 13: Hash Value 314:288 bits */
  7286. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7287. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7288. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7289. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7290. do { \
  7291. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7292. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7293. } while (0)
  7294. /**
  7295. * @brief Host-->target HTT RX FSE operation message
  7296. *
  7297. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7298. *
  7299. * @details
  7300. * The host will send this Flow Search Engine (FSE) operation message for
  7301. * every flow add/delete operation.
  7302. * The FSE operation includes FSE full cache invalidation or individual entry
  7303. * invalidation.
  7304. * This message can be sent per SOC or per PDEV which is differentiated
  7305. * by pdev id values.
  7306. *
  7307. * |31 16|15 8|7 1|0|
  7308. * |-------------------------------------------------------------|
  7309. * | reserved | pdev_id | MSG_TYPE |
  7310. * |-------------------------------------------------------------|
  7311. * | reserved | operation |I|
  7312. * |-------------------------------------------------------------|
  7313. * | ip_src_addr_31_0 |
  7314. * |-------------------------------------------------------------|
  7315. * | ip_src_addr_63_32 |
  7316. * |-------------------------------------------------------------|
  7317. * | ip_src_addr_95_64 |
  7318. * |-------------------------------------------------------------|
  7319. * | ip_src_addr_127_96 |
  7320. * |-------------------------------------------------------------|
  7321. * | ip_dst_addr_31_0 |
  7322. * |-------------------------------------------------------------|
  7323. * | ip_dst_addr_63_32 |
  7324. * |-------------------------------------------------------------|
  7325. * | ip_dst_addr_95_64 |
  7326. * |-------------------------------------------------------------|
  7327. * | ip_dst_addr_127_96 |
  7328. * |-------------------------------------------------------------|
  7329. * | l4_dst_port | l4_src_port |
  7330. * | (32-bit SPI incase of IPsec) |
  7331. * |-------------------------------------------------------------|
  7332. * | reserved | l4_proto |
  7333. * |-------------------------------------------------------------|
  7334. *
  7335. * where I is 1-bit ipsec_valid.
  7336. *
  7337. * The following field definitions describe the format of the RX FSE operation
  7338. * message sent from the host to target for every add/delete flow entry to flow
  7339. * table.
  7340. *
  7341. * Header fields:
  7342. * dword0 - b'7:0 - msg_type: This will be set to
  7343. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7344. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7345. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7346. * specified pdev's LMAC ring.
  7347. * b'31:16 - reserved : Reserved for future use
  7348. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7349. * (Internet Protocol Security).
  7350. * IPsec describes the framework for providing security at
  7351. * IP layer. IPsec is defined for both versions of IP:
  7352. * IPV4 and IPV6.
  7353. * Please refer to htt_rx_flow_proto enumeration below for
  7354. * more info.
  7355. * ipsec_valid = 1 for IPSEC packets
  7356. * ipsec_valid = 0 for IP Packets
  7357. * b'7:1 - operation: This indicates types of FSE operation.
  7358. * Refer to htt_rx_fse_operation enumeration:
  7359. * 0 - No Cache Invalidation required
  7360. * 1 - Cache invalidate only one entry given by IP
  7361. * src/dest address at DWORD[2:9]
  7362. * 2 - Complete FSE Cache Invalidation
  7363. * 3 - FSE Disable
  7364. * 4 - FSE Enable
  7365. * b'31:8 - reserved: Reserved for future use
  7366. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7367. * for per flow addition/deletion
  7368. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7369. * and the subsequent 3 A_UINT32 will be padding bytes.
  7370. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7371. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7372. * from 0 to 65535 but only 0 to 1023 are designated as
  7373. * well-known ports. Refer to [RFC1700] for more details.
  7374. * This field is valid only if
  7375. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7376. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7377. * range from 0 to 65535 but only 0 to 1023 are designated
  7378. * as well-known ports. Refer to [RFC1700] for more details.
  7379. * This field is valid only if
  7380. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7381. * - SPI (31:0): Security Parameters Index is an
  7382. * identification tag added to the header while using IPsec
  7383. * for tunneling the IP traffici.
  7384. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7385. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7386. * Assigned Internet Protocol Numbers.
  7387. * l4_proto numbers for standard protocol like UDP/TCP
  7388. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7389. * l4_proto = 17 for UDP etc.
  7390. * b'31:8 - reserved: Reserved for future use.
  7391. *
  7392. */
  7393. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7394. A_UINT32 msg_type:8,
  7395. pdev_id:8,
  7396. reserved0:16;
  7397. A_UINT32 ipsec_valid:1,
  7398. operation:7,
  7399. reserved1:24;
  7400. A_UINT32 ip_src_addr_31_0;
  7401. A_UINT32 ip_src_addr_63_32;
  7402. A_UINT32 ip_src_addr_95_64;
  7403. A_UINT32 ip_src_addr_127_96;
  7404. A_UINT32 ip_dest_addr_31_0;
  7405. A_UINT32 ip_dest_addr_63_32;
  7406. A_UINT32 ip_dest_addr_95_64;
  7407. A_UINT32 ip_dest_addr_127_96;
  7408. union {
  7409. A_UINT32 spi;
  7410. struct {
  7411. A_UINT32 l4_src_port:16,
  7412. l4_dest_port:16;
  7413. } ip;
  7414. } u;
  7415. A_UINT32 l4_proto:8,
  7416. reserved:24;
  7417. } POSTPACK;
  7418. /**
  7419. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7420. *
  7421. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7422. *
  7423. * @details
  7424. * The host will send this Full monitor mode register configuration message.
  7425. * This message can be sent per SOC or per PDEV which is differentiated
  7426. * by pdev id values.
  7427. *
  7428. * |31 16|15 11|10 8|7 3|2|1|0|
  7429. * |-------------------------------------------------------------|
  7430. * | reserved | pdev_id | MSG_TYPE |
  7431. * |-------------------------------------------------------------|
  7432. * | reserved |Release Ring |N|Z|E|
  7433. * |-------------------------------------------------------------|
  7434. *
  7435. * where E is 1-bit full monitor mode enable/disable.
  7436. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7437. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7438. *
  7439. * The following field definitions describe the format of the full monitor
  7440. * mode configuration message sent from the host to target for each pdev.
  7441. *
  7442. * Header fields:
  7443. * dword0 - b'7:0 - msg_type: This will be set to
  7444. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7445. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7446. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7447. * specified pdev's LMAC ring.
  7448. * b'31:16 - reserved : Reserved for future use.
  7449. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7450. * monitor mode rxdma register is to be enabled or disabled.
  7451. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7452. * additional descriptors at ppdu end for zero mpdus
  7453. * enabled or disabled.
  7454. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7455. * additional descriptors at ppdu end for non zero mpdus
  7456. * enabled or disabled.
  7457. * b'10:3 - release_ring: This indicates the destination ring
  7458. * selection for the descriptor at the end of PPDU
  7459. * 0 - REO ring select
  7460. * 1 - FW ring select
  7461. * 2 - SW ring select
  7462. * 3 - Release ring select
  7463. * Refer to htt_rx_full_mon_release_ring.
  7464. * b'31:11 - reserved for future use
  7465. */
  7466. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7467. A_UINT32 msg_type:8,
  7468. pdev_id:8,
  7469. reserved0:16;
  7470. A_UINT32 full_monitor_mode_enable:1,
  7471. addnl_descs_zero_mpdus_end:1,
  7472. addnl_descs_non_zero_mpdus_end:1,
  7473. release_ring:8,
  7474. reserved1:21;
  7475. } POSTPACK;
  7476. /**
  7477. * Enumeration for full monitor mode destination ring select
  7478. * 0 - REO destination ring select
  7479. * 1 - FW destination ring select
  7480. * 2 - SW destination ring select
  7481. * 3 - Release destination ring select
  7482. */
  7483. enum htt_rx_full_mon_release_ring {
  7484. HTT_RX_MON_RING_REO,
  7485. HTT_RX_MON_RING_FW,
  7486. HTT_RX_MON_RING_SW,
  7487. HTT_RX_MON_RING_RELEASE,
  7488. };
  7489. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7490. /* DWORD 0: Pdev ID */
  7491. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7492. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7493. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7494. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7495. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7496. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7497. do { \
  7498. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7499. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7500. } while (0)
  7501. /* DWORD 1:ENABLE */
  7502. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7503. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7504. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7505. do { \
  7506. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7507. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7508. } while (0)
  7509. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7510. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7511. /* DWORD 1:ZERO_MPDU */
  7512. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7513. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7514. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7515. do { \
  7516. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7517. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7518. } while (0)
  7519. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7520. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7521. /* DWORD 1:NON_ZERO_MPDU */
  7522. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7523. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7524. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7525. do { \
  7526. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7527. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7528. } while (0)
  7529. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7530. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7531. /* DWORD 1:RELEASE_RINGS */
  7532. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7533. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7534. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7535. do { \
  7536. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7537. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7538. } while (0)
  7539. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7540. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7541. /**
  7542. * Enumeration for IP Protocol or IPSEC Protocol
  7543. * IPsec describes the framework for providing security at IP layer.
  7544. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7545. */
  7546. enum htt_rx_flow_proto {
  7547. HTT_RX_FLOW_IP_PROTO,
  7548. HTT_RX_FLOW_IPSEC_PROTO,
  7549. };
  7550. /**
  7551. * Enumeration for FSE Cache Invalidation
  7552. * 0 - No Cache Invalidation required
  7553. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  7554. * 2 - Complete FSE Cache Invalidation
  7555. * 3 - FSE Disable
  7556. * 4 - FSE Enable
  7557. */
  7558. enum htt_rx_fse_operation {
  7559. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  7560. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  7561. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  7562. HTT_RX_FSE_DISABLE,
  7563. HTT_RX_FSE_ENABLE,
  7564. };
  7565. /* DWORD 0: Pdev ID */
  7566. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  7567. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  7568. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  7569. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  7570. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  7571. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  7572. do { \
  7573. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  7574. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  7575. } while (0)
  7576. /* DWORD 1:IP PROTO or IPSEC */
  7577. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  7578. #define HTT_RX_FSE_IPSEC_VALID_S 0
  7579. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  7580. do { \
  7581. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  7582. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  7583. } while (0)
  7584. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  7585. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  7586. /* DWORD 1:FSE Operation */
  7587. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  7588. #define HTT_RX_FSE_OPERATION_S 1
  7589. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  7590. do { \
  7591. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  7592. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  7593. } while (0)
  7594. #define HTT_RX_FSE_OPERATION_GET(word) \
  7595. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  7596. /* DWORD 2-9:IP Address */
  7597. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  7598. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  7599. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  7600. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  7601. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  7602. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  7603. do { \
  7604. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  7605. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  7606. } while (0)
  7607. /* DWORD 10:Source Port Number */
  7608. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  7609. #define HTT_RX_FSE_SOURCEPORT_S 0
  7610. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  7611. do { \
  7612. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  7613. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  7614. } while (0)
  7615. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  7616. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  7617. /* DWORD 11:Destination Port Number */
  7618. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  7619. #define HTT_RX_FSE_DESTPORT_S 16
  7620. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  7621. do { \
  7622. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  7623. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  7624. } while (0)
  7625. #define HTT_RX_FSE_DESTPORT_GET(word) \
  7626. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  7627. /* DWORD 10-11:SPI (In case of IPSEC) */
  7628. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  7629. #define HTT_RX_FSE_OPERATION_SPI_S 0
  7630. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  7631. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  7632. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  7633. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  7634. do { \
  7635. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  7636. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  7637. } while (0)
  7638. /* DWORD 12:L4 PROTO */
  7639. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  7640. #define HTT_RX_FSE_L4_PROTO_S 0
  7641. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  7642. do { \
  7643. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  7644. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  7645. } while (0)
  7646. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  7647. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  7648. /**
  7649. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  7650. *
  7651. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  7652. *
  7653. * |31 24|23 |15 8|7 2|1|0|
  7654. * |----------------+----------------+----------------+----------------|
  7655. * | reserved | pdev_id | msg_type |
  7656. * |---------------------------------+----------------+----------------|
  7657. * | reserved |E|F|
  7658. * |---------------------------------+----------------+----------------|
  7659. * Where E = Configure the target to provide the 3-tuple hash value in
  7660. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  7661. * F = Configure the target to provide the 3-tuple hash value in
  7662. * flow_id_toeplitz field of rx_msdu_start tlv
  7663. *
  7664. * The following field definitions describe the format of the 3 tuple hash value
  7665. * message sent from the host to target as part of initialization sequence.
  7666. *
  7667. * Header fields:
  7668. * dword0 - b'7:0 - msg_type: This will be set to
  7669. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  7670. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7671. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7672. * specified pdev's LMAC ring.
  7673. * b'31:16 - reserved : Reserved for future use
  7674. * dword1 - b'0 - flow_id_toeplitz_field_enable
  7675. * b'1 - toeplitz_hash_2_or_4_field_enable
  7676. * b'31:2 - reserved : Reserved for future use
  7677. * ---------+------+----------------------------------------------------------
  7678. * bit1 | bit0 | Functionality
  7679. * ---------+------+----------------------------------------------------------
  7680. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  7681. * | | in flow_id_toeplitz field
  7682. * ---------+------+----------------------------------------------------------
  7683. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  7684. * | | in toeplitz_hash_2_or_4 field
  7685. * ---------+------+----------------------------------------------------------
  7686. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  7687. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  7688. * ---------+------+----------------------------------------------------------
  7689. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  7690. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  7691. * | | toeplitz_hash_2_or_4 field
  7692. *----------------------------------------------------------------------------
  7693. */
  7694. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  7695. A_UINT32 msg_type :8,
  7696. pdev_id :8,
  7697. reserved0 :16;
  7698. A_UINT32 flow_id_toeplitz_field_enable :1,
  7699. toeplitz_hash_2_or_4_field_enable :1,
  7700. reserved1 :30;
  7701. } POSTPACK;
  7702. /* DWORD0 : pdev_id configuration Macros */
  7703. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  7704. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  7705. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  7706. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  7707. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  7708. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  7709. do { \
  7710. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  7711. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  7712. } while (0)
  7713. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  7714. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  7715. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  7716. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  7717. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  7718. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  7719. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  7720. do { \
  7721. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  7722. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  7723. } while (0)
  7724. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  7725. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  7726. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  7727. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  7728. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  7729. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  7730. do { \
  7731. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  7732. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  7733. } while (0)
  7734. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  7735. /**
  7736. * @brief host --> target Host PA Address Size
  7737. *
  7738. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  7739. *
  7740. * @details
  7741. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  7742. * provide the physical start address and size of each of the memory
  7743. * areas within host DDR that the target FW may need to access.
  7744. *
  7745. * For example, the host can use this message to allow the target FW
  7746. * to set up access to the host's pools of TQM link descriptors.
  7747. * The message would appear as follows:
  7748. *
  7749. * |31 24|23 16|15 8|7 0|
  7750. * |----------------+----------------+----------------+----------------|
  7751. * | reserved | num_entries | msg_type |
  7752. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7753. * | mem area 0 size |
  7754. * |----------------+----------------+----------------+----------------|
  7755. * | mem area 0 physical_address_lo |
  7756. * |----------------+----------------+----------------+----------------|
  7757. * | mem area 0 physical_address_hi |
  7758. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7759. * | mem area 1 size |
  7760. * |----------------+----------------+----------------+----------------|
  7761. * | mem area 1 physical_address_lo |
  7762. * |----------------+----------------+----------------+----------------|
  7763. * | mem area 1 physical_address_hi |
  7764. * |----------------+----------------+----------------+----------------|
  7765. * ...
  7766. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  7767. * | mem area N size |
  7768. * |----------------+----------------+----------------+----------------|
  7769. * | mem area N physical_address_lo |
  7770. * |----------------+----------------+----------------+----------------|
  7771. * | mem area N physical_address_hi |
  7772. * |----------------+----------------+----------------+----------------|
  7773. *
  7774. * The message is interpreted as follows:
  7775. * dword0 - b'0:7 - msg_type: This will be set to
  7776. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  7777. * b'8:15 - number_entries: Indicated the number of host memory
  7778. * areas specified within the remainder of the message
  7779. * b'16:31 - reserved.
  7780. * dword1 - b'0:31 - memory area 0 size in bytes
  7781. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  7782. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  7783. * and similar for memory area 1 through memory area N.
  7784. */
  7785. PREPACK struct htt_h2t_host_paddr_size {
  7786. A_UINT32 msg_type: 8,
  7787. num_entries: 8,
  7788. reserved: 16;
  7789. } POSTPACK;
  7790. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  7791. A_UINT32 size;
  7792. A_UINT32 physical_address_lo;
  7793. A_UINT32 physical_address_hi;
  7794. } POSTPACK;
  7795. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  7796. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  7797. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  7798. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  7799. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  7800. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  7801. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  7802. do { \
  7803. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  7804. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  7805. } while (0)
  7806. /**
  7807. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  7808. *
  7809. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  7810. *
  7811. * @details
  7812. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  7813. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  7814. *
  7815. * The message would appear as follows:
  7816. *
  7817. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  7818. * |---------------------------------+---+---+----------+-+-----------|
  7819. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  7820. * |---------------------+---+---+---+---+---+----------+-+-----------|
  7821. *
  7822. *
  7823. * The message is interpreted as follows:
  7824. * dword0 - b'0:7 - msg_type: This will be set to
  7825. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  7826. * b'8 - override bit to drive MSDUs to PPE ring
  7827. * b'9:13 - REO destination ring indication
  7828. * b'14 - Multi buffer msdu override enable bit
  7829. * b'15 - Intra BSS override
  7830. * b'16 - Decap raw override
  7831. * b'17 - Decap Native wifi override
  7832. * b'18 - IP frag override
  7833. * b'19:31 - reserved
  7834. */
  7835. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  7836. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  7837. override: 1,
  7838. reo_destination_indication: 5,
  7839. multi_buffer_msdu_override_en: 1,
  7840. intra_bss_override: 1,
  7841. decap_raw_override: 1,
  7842. decap_nwifi_override: 1,
  7843. ip_frag_override: 1,
  7844. reserved: 13;
  7845. } POSTPACK;
  7846. /* DWORD 0: Override */
  7847. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  7848. #define HTT_PPE_CFG_OVERRIDE_S 8
  7849. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  7850. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  7851. HTT_PPE_CFG_OVERRIDE_S)
  7852. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  7853. do { \
  7854. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  7855. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  7856. } while (0)
  7857. /* DWORD 0: REO Destination Indication*/
  7858. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  7859. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  7860. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  7861. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  7862. HTT_PPE_CFG_REO_DEST_IND_S)
  7863. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  7864. do { \
  7865. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  7866. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  7867. } while (0)
  7868. /* DWORD 0: Multi buffer MSDU override */
  7869. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  7870. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  7871. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  7872. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  7873. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  7874. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  7875. do { \
  7876. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  7877. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  7878. } while (0)
  7879. /* DWORD 0: Intra BSS override */
  7880. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  7881. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  7882. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  7883. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  7884. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  7885. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  7886. do { \
  7887. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  7888. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  7889. } while (0)
  7890. /* DWORD 0: Decap RAW override */
  7891. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  7892. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  7893. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  7894. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  7895. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  7896. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  7897. do { \
  7898. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  7899. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  7900. } while (0)
  7901. /* DWORD 0: Decap NWIFI override */
  7902. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  7903. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  7904. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  7905. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  7906. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  7907. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  7908. do { \
  7909. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  7910. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  7911. } while (0)
  7912. /* DWORD 0: IP frag override */
  7913. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  7914. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  7915. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  7916. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  7917. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  7918. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  7919. do { \
  7920. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  7921. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  7922. } while (0)
  7923. /*
  7924. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  7925. *
  7926. * @details
  7927. * The following field definitions describe the format of the HTT host
  7928. * to target FW VDEV TX RX stats retrieve message.
  7929. * The message specifies the type of stats the host wants to retrieve.
  7930. *
  7931. * |31 27|26 25|24 17|16|15 8|7 0|
  7932. * |-----------------------------------------------------------|
  7933. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  7934. * |-----------------------------------------------------------|
  7935. * | vdev_id lower bitmask |
  7936. * |-----------------------------------------------------------|
  7937. * | vdev_id upper bitmask |
  7938. * |-----------------------------------------------------------|
  7939. * Header fields:
  7940. * Where:
  7941. * dword0 - b'7:0 - msg_type: This will be set to
  7942. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  7943. * b'15:8 - pdev id
  7944. * b'16(E) - Enable/Disable the vdev HW stats
  7945. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  7946. * b'25:26(R) - Reset stats bits
  7947. * 0: don't reset stats
  7948. * 1: reset stats once
  7949. * 2: reset stats at the start of each periodic interval
  7950. * b'27:31 - reserved for future use
  7951. * dword1 - b'0:31 - vdev_id lower bitmask
  7952. * dword2 - b'0:31 - vdev_id upper bitmask
  7953. */
  7954. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  7955. A_UINT32 msg_type :8,
  7956. pdev_id :8,
  7957. enable :1,
  7958. periodic_interval :8,
  7959. reset_stats_bits :2,
  7960. reserved0 :5;
  7961. A_UINT32 vdev_id_lower_bitmask;
  7962. A_UINT32 vdev_id_upper_bitmask;
  7963. } POSTPACK;
  7964. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  7965. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  7966. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  7967. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  7968. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  7969. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  7970. do { \
  7971. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  7972. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  7973. } while (0)
  7974. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  7975. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  7976. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  7977. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  7978. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  7979. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  7980. do { \
  7981. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  7982. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  7983. } while (0)
  7984. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  7985. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  7986. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  7987. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  7988. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  7989. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  7990. do { \
  7991. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  7992. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  7993. } while (0)
  7994. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  7995. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  7996. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  7997. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  7998. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  7999. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8000. do { \
  8001. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8002. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8003. } while (0)
  8004. /*
  8005. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8006. *
  8007. * @details
  8008. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8009. * the default MSDU queues for one of the TIDs within the specified peer
  8010. * to the specified service class.
  8011. * The TID is indirectly specified - each service class is associated
  8012. * with a TID. All default MSDU queues for this peer-TID will be
  8013. * linked to the service class in question.
  8014. *
  8015. * |31 16|15 8|7 0|
  8016. * |------------------------------+--------------+--------------|
  8017. * | peer ID | svc class ID | msg type |
  8018. * |------------------------------------------------------------|
  8019. * Header fields:
  8020. * dword0 - b'7:0 - msg_type: This will be set to
  8021. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8022. * b'15:8 - service class ID
  8023. * b'31:16 - peer ID
  8024. */
  8025. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8026. A_UINT32 msg_type :8,
  8027. svc_class_id :8,
  8028. peer_id :16;
  8029. } POSTPACK;
  8030. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8031. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8032. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8033. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8034. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8035. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8036. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8037. do { \
  8038. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8039. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8040. } while (0)
  8041. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8042. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8043. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8044. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8045. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8046. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8047. do { \
  8048. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8049. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8050. } while (0)
  8051. /*
  8052. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8053. *
  8054. * @details
  8055. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8056. * remove the linkage of the specified peer-TID's MSDU queues to
  8057. * service classes.
  8058. *
  8059. * |31 16|15 12|11 8|7 0|
  8060. * |------------------------------+------+-------+--------------|
  8061. * | peer ID | rsvd | TID | msg type |
  8062. * |------------------------------------------------------------|
  8063. * Header fields:
  8064. * dword0 - b'7:0 - msg_type: This will be set to
  8065. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8066. * b'11:8 - TID
  8067. * dword1 - b'31:16 - peer ID
  8068. */
  8069. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8070. A_UINT32 msg_type :8,
  8071. tid :4,
  8072. reserved :4,
  8073. peer_id :16;
  8074. } POSTPACK;
  8075. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8076. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_M 0x00000F00
  8077. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S 8
  8078. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_GET(_var) \
  8079. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_M) >> \
  8080. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S)
  8081. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_TID_SET(_var, _val) \
  8082. do { \
  8083. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID, _val); \
  8084. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_TID_S));\
  8085. } while (0)
  8086. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8087. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8088. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(_var) \
  8089. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8090. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8091. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(_var, _val) \
  8092. do { \
  8093. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8094. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8095. } while (0)
  8096. /*
  8097. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8098. *
  8099. * @details
  8100. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8101. * request the target to report what service class the default MSDU queues
  8102. * of the specified peer-TID are linked to.
  8103. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8104. * to report what service class (if any) the peer-TID's default MSDU queues
  8105. * are linked to.
  8106. *
  8107. * |31 16|15 12|11 8|7 0|
  8108. * |------------------------------+------+-------+--------------|
  8109. * | peer ID | rsvd | TID | msg type |
  8110. * |------------------------------------------------------------|
  8111. * Header fields:
  8112. * dword0 - b'7:0 - msg_type: This will be set to
  8113. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8114. * b'11:8 - TID
  8115. * dword1 - b'31:16 - peer ID
  8116. */
  8117. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8118. A_UINT32 msg_type :8,
  8119. tid :4,
  8120. reserved :4,
  8121. peer_id :16;
  8122. } POSTPACK;
  8123. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 4
  8124. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_M 0x00000F00
  8125. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S 8
  8126. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_GET(_var) \
  8127. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_M) >> \
  8128. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S)
  8129. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_SET(_var, _val) \
  8130. do { \
  8131. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID, _val); \
  8132. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_S));\
  8133. } while (0)
  8134. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8135. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8136. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(_var) \
  8137. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8138. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8139. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(_var, _val) \
  8140. do { \
  8141. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8142. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8143. } while (0)
  8144. /*=== target -> host messages ===============================================*/
  8145. enum htt_t2h_msg_type {
  8146. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8147. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8148. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8149. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8150. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8151. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8152. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8153. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8154. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8155. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8156. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8157. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8158. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8159. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8160. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8161. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8162. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8163. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8164. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8165. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8166. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8167. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8168. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8169. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8170. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8171. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8172. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8173. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8174. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8175. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8176. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8177. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8178. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8179. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8180. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8181. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8182. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8183. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8184. /* TX_OFFLOAD_DELIVER_IND:
  8185. * Forward the target's locally-generated packets to the host,
  8186. * to provide to the monitor mode interface.
  8187. */
  8188. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8189. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8190. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8191. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8192. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8193. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8194. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8195. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8196. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8197. HTT_T2H_MSG_TYPE_TEST,
  8198. /* keep this last */
  8199. HTT_T2H_NUM_MSGS
  8200. };
  8201. /*
  8202. * HTT target to host message type -
  8203. * stored in bits 7:0 of the first word of the message
  8204. */
  8205. #define HTT_T2H_MSG_TYPE_M 0xff
  8206. #define HTT_T2H_MSG_TYPE_S 0
  8207. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8208. do { \
  8209. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8210. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8211. } while (0)
  8212. #define HTT_T2H_MSG_TYPE_GET(word) \
  8213. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8214. /**
  8215. * @brief target -> host version number confirmation message definition
  8216. *
  8217. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8218. *
  8219. * |31 24|23 16|15 8|7 0|
  8220. * |----------------+----------------+----------------+----------------|
  8221. * | reserved | major number | minor number | msg type |
  8222. * |-------------------------------------------------------------------|
  8223. * : option request TLV (optional) |
  8224. * :...................................................................:
  8225. *
  8226. * The VER_CONF message may consist of a single 4-byte word, or may be
  8227. * extended with TLVs that specify HTT options selected by the target.
  8228. * The following option TLVs may be appended to the VER_CONF message:
  8229. * - LL_BUS_ADDR_SIZE
  8230. * - HL_SUPPRESS_TX_COMPL_IND
  8231. * - MAX_TX_QUEUE_GROUPS
  8232. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8233. * may be appended to the VER_CONF message (but only one TLV of each type).
  8234. *
  8235. * Header fields:
  8236. * - MSG_TYPE
  8237. * Bits 7:0
  8238. * Purpose: identifies this as a version number confirmation message
  8239. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8240. * - VER_MINOR
  8241. * Bits 15:8
  8242. * Purpose: Specify the minor number of the HTT message library version
  8243. * in use by the target firmware.
  8244. * The minor number specifies the specific revision within a range
  8245. * of fundamentally compatible HTT message definition revisions.
  8246. * Compatible revisions involve adding new messages or perhaps
  8247. * adding new fields to existing messages, in a backwards-compatible
  8248. * manner.
  8249. * Incompatible revisions involve changing the message type values,
  8250. * or redefining existing messages.
  8251. * Value: minor number
  8252. * - VER_MAJOR
  8253. * Bits 15:8
  8254. * Purpose: Specify the major number of the HTT message library version
  8255. * in use by the target firmware.
  8256. * The major number specifies the family of minor revisions that are
  8257. * fundamentally compatible with each other, but not with prior or
  8258. * later families.
  8259. * Value: major number
  8260. */
  8261. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8262. #define HTT_VER_CONF_MINOR_S 8
  8263. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8264. #define HTT_VER_CONF_MAJOR_S 16
  8265. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8266. do { \
  8267. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8268. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8269. } while (0)
  8270. #define HTT_VER_CONF_MINOR_GET(word) \
  8271. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8272. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8273. do { \
  8274. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8275. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8276. } while (0)
  8277. #define HTT_VER_CONF_MAJOR_GET(word) \
  8278. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  8279. #define HTT_VER_CONF_BYTES 4
  8280. /**
  8281. * @brief - target -> host HTT Rx In order indication message
  8282. *
  8283. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  8284. *
  8285. * @details
  8286. *
  8287. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  8288. * |----------------+-------------------+---------------------+---------------|
  8289. * | peer ID | P| F| O| ext TID | msg type |
  8290. * |--------------------------------------------------------------------------|
  8291. * | MSDU count | Reserved | vdev id |
  8292. * |--------------------------------------------------------------------------|
  8293. * | MSDU 0 bus address (bits 31:0) |
  8294. #if HTT_PADDR64
  8295. * | MSDU 0 bus address (bits 63:32) |
  8296. #endif
  8297. * |--------------------------------------------------------------------------|
  8298. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  8299. * |--------------------------------------------------------------------------|
  8300. * | MSDU 1 bus address (bits 31:0) |
  8301. #if HTT_PADDR64
  8302. * | MSDU 1 bus address (bits 63:32) |
  8303. #endif
  8304. * |--------------------------------------------------------------------------|
  8305. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  8306. * |--------------------------------------------------------------------------|
  8307. */
  8308. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  8309. *
  8310. * @details
  8311. * bits
  8312. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  8313. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8314. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  8315. * | | frag | | | | fail |chksum fail|
  8316. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8317. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  8318. */
  8319. struct htt_rx_in_ord_paddr_ind_hdr_t
  8320. {
  8321. A_UINT32 /* word 0 */
  8322. msg_type: 8,
  8323. ext_tid: 5,
  8324. offload: 1,
  8325. frag: 1,
  8326. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  8327. peer_id: 16;
  8328. A_UINT32 /* word 1 */
  8329. vap_id: 8,
  8330. /* NOTE:
  8331. * This reserved_1 field is not truly reserved - certain targets use
  8332. * this field internally to store debug information, and do not zero
  8333. * out the contents of the field before uploading the message to the
  8334. * host. Thus, any host-target communication supported by this field
  8335. * is limited to using values that are never used by the debug
  8336. * information stored by certain targets in the reserved_1 field.
  8337. * In particular, the targets in question don't use the value 0x3
  8338. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  8339. * so this previously-unused value within these bits is available to
  8340. * use as the host / target PKT_CAPTURE_MODE flag.
  8341. */
  8342. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  8343. /* if pkt_capture_mode == 0x3, host should
  8344. * send rx frames to monitor mode interface
  8345. */
  8346. msdu_cnt: 16;
  8347. };
  8348. struct htt_rx_in_ord_paddr_ind_msdu32_t
  8349. {
  8350. A_UINT32 dma_addr;
  8351. A_UINT32
  8352. length: 16,
  8353. fw_desc: 8,
  8354. msdu_info:8;
  8355. };
  8356. struct htt_rx_in_ord_paddr_ind_msdu64_t
  8357. {
  8358. A_UINT32 dma_addr_lo;
  8359. A_UINT32 dma_addr_hi;
  8360. A_UINT32
  8361. length: 16,
  8362. fw_desc: 8,
  8363. msdu_info:8;
  8364. };
  8365. #if HTT_PADDR64
  8366. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  8367. #else
  8368. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  8369. #endif
  8370. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  8371. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  8372. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  8373. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  8374. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  8375. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  8376. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  8377. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  8378. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  8379. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  8380. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  8381. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  8382. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  8383. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  8384. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  8385. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  8386. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  8387. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  8388. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  8389. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  8390. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  8391. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  8392. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  8393. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  8394. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  8395. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  8396. /* for systems using 64-bit format for bus addresses */
  8397. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  8398. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  8399. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  8400. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  8401. /* for systems using 32-bit format for bus addresses */
  8402. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  8403. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  8404. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  8405. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  8406. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  8407. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  8408. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  8409. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  8410. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  8411. do { \
  8412. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  8413. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  8414. } while (0)
  8415. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  8416. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  8417. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  8418. do { \
  8419. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  8420. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  8421. } while (0)
  8422. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  8423. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  8424. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  8425. do { \
  8426. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  8427. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  8428. } while (0)
  8429. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  8430. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  8431. /*
  8432. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  8433. * deliver the rx frames to the monitor mode interface.
  8434. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  8435. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  8436. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  8437. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  8438. */
  8439. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  8440. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  8441. do { \
  8442. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  8443. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  8444. } while (0)
  8445. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  8446. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  8447. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  8448. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  8449. do { \
  8450. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  8451. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  8452. } while (0)
  8453. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  8454. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  8455. /* for systems using 64-bit format for bus addresses */
  8456. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  8457. do { \
  8458. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  8459. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  8460. } while (0)
  8461. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  8462. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  8463. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  8464. do { \
  8465. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  8466. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  8467. } while (0)
  8468. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  8469. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  8470. /* for systems using 32-bit format for bus addresses */
  8471. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  8472. do { \
  8473. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  8474. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  8475. } while (0)
  8476. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  8477. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  8478. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  8479. do { \
  8480. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  8481. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  8482. } while (0)
  8483. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  8484. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  8485. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  8486. do { \
  8487. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  8488. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  8489. } while (0)
  8490. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  8491. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  8492. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  8493. do { \
  8494. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  8495. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  8496. } while (0)
  8497. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  8498. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  8499. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  8500. do { \
  8501. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  8502. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  8503. } while (0)
  8504. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  8505. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  8506. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  8507. do { \
  8508. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  8509. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  8510. } while (0)
  8511. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  8512. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  8513. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  8514. do { \
  8515. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  8516. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  8517. } while (0)
  8518. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  8519. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  8520. /* definitions used within target -> host rx indication message */
  8521. PREPACK struct htt_rx_ind_hdr_prefix_t
  8522. {
  8523. A_UINT32 /* word 0 */
  8524. msg_type: 8,
  8525. ext_tid: 5,
  8526. release_valid: 1,
  8527. flush_valid: 1,
  8528. reserved0: 1,
  8529. peer_id: 16;
  8530. A_UINT32 /* word 1 */
  8531. flush_start_seq_num: 6,
  8532. flush_end_seq_num: 6,
  8533. release_start_seq_num: 6,
  8534. release_end_seq_num: 6,
  8535. num_mpdu_ranges: 8;
  8536. } POSTPACK;
  8537. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  8538. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  8539. #define HTT_TGT_RSSI_INVALID 0x80
  8540. PREPACK struct htt_rx_ppdu_desc_t
  8541. {
  8542. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  8543. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  8544. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  8545. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  8546. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  8547. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  8548. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  8549. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  8550. A_UINT32 /* word 0 */
  8551. rssi_cmb: 8,
  8552. timestamp_submicrosec: 8,
  8553. phy_err_code: 8,
  8554. phy_err: 1,
  8555. legacy_rate: 4,
  8556. legacy_rate_sel: 1,
  8557. end_valid: 1,
  8558. start_valid: 1;
  8559. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  8560. union {
  8561. A_UINT32 /* word 1 */
  8562. rssi0_pri20: 8,
  8563. rssi0_ext20: 8,
  8564. rssi0_ext40: 8,
  8565. rssi0_ext80: 8;
  8566. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  8567. } u0;
  8568. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  8569. union {
  8570. A_UINT32 /* word 2 */
  8571. rssi1_pri20: 8,
  8572. rssi1_ext20: 8,
  8573. rssi1_ext40: 8,
  8574. rssi1_ext80: 8;
  8575. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  8576. } u1;
  8577. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  8578. union {
  8579. A_UINT32 /* word 3 */
  8580. rssi2_pri20: 8,
  8581. rssi2_ext20: 8,
  8582. rssi2_ext40: 8,
  8583. rssi2_ext80: 8;
  8584. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  8585. } u2;
  8586. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  8587. union {
  8588. A_UINT32 /* word 4 */
  8589. rssi3_pri20: 8,
  8590. rssi3_ext20: 8,
  8591. rssi3_ext40: 8,
  8592. rssi3_ext80: 8;
  8593. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  8594. } u3;
  8595. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  8596. A_UINT32 tsf32; /* word 5 */
  8597. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  8598. A_UINT32 timestamp_microsec; /* word 6 */
  8599. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  8600. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  8601. A_UINT32 /* word 7 */
  8602. vht_sig_a1: 24,
  8603. preamble_type: 8;
  8604. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  8605. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  8606. A_UINT32 /* word 8 */
  8607. vht_sig_a2: 24,
  8608. /* sa_ant_matrix
  8609. * For cases where a single rx chain has options to be connected to
  8610. * different rx antennas, show which rx antennas were in use during
  8611. * receipt of a given PPDU.
  8612. * This sa_ant_matrix provides a bitmask of the antennas used while
  8613. * receiving this frame.
  8614. */
  8615. sa_ant_matrix: 8;
  8616. } POSTPACK;
  8617. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  8618. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  8619. PREPACK struct htt_rx_ind_hdr_suffix_t
  8620. {
  8621. A_UINT32 /* word 0 */
  8622. fw_rx_desc_bytes: 16,
  8623. reserved0: 16;
  8624. } POSTPACK;
  8625. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  8626. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  8627. PREPACK struct htt_rx_ind_hdr_t
  8628. {
  8629. struct htt_rx_ind_hdr_prefix_t prefix;
  8630. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  8631. struct htt_rx_ind_hdr_suffix_t suffix;
  8632. } POSTPACK;
  8633. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  8634. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  8635. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  8636. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  8637. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  8638. /*
  8639. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  8640. * the offset into the HTT rx indication message at which the
  8641. * FW rx PPDU descriptor resides
  8642. */
  8643. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  8644. /*
  8645. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  8646. * the offset into the HTT rx indication message at which the
  8647. * header suffix (FW rx MSDU byte count) resides
  8648. */
  8649. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  8650. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  8651. /*
  8652. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  8653. * the offset into the HTT rx indication message at which the per-MSDU
  8654. * information starts
  8655. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  8656. * per-MSDU information portion of the message. The per-MSDU info itself
  8657. * starts at byte 12.
  8658. */
  8659. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  8660. /**
  8661. * @brief target -> host rx indication message definition
  8662. *
  8663. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  8664. *
  8665. * @details
  8666. * The following field definitions describe the format of the rx indication
  8667. * message sent from the target to the host.
  8668. * The message consists of three major sections:
  8669. * 1. a fixed-length header
  8670. * 2. a variable-length list of firmware rx MSDU descriptors
  8671. * 3. one or more 4-octet MPDU range information elements
  8672. * The fixed length header itself has two sub-sections
  8673. * 1. the message meta-information, including identification of the
  8674. * sender and type of the received data, and a 4-octet flush/release IE
  8675. * 2. the firmware rx PPDU descriptor
  8676. *
  8677. * The format of the message is depicted below.
  8678. * in this depiction, the following abbreviations are used for information
  8679. * elements within the message:
  8680. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  8681. * elements associated with the PPDU start are valid.
  8682. * Specifically, the following fields are valid only if SV is set:
  8683. * RSSI (all variants), L, legacy rate, preamble type, service,
  8684. * VHT-SIG-A
  8685. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  8686. * elements associated with the PPDU end are valid.
  8687. * Specifically, the following fields are valid only if EV is set:
  8688. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  8689. * - L - Legacy rate selector - if legacy rates are used, this flag
  8690. * indicates whether the rate is from a CCK (L == 1) or OFDM
  8691. * (L == 0) PHY.
  8692. * - P - PHY error flag - boolean indication of whether the rx frame had
  8693. * a PHY error
  8694. *
  8695. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  8696. * |----------------+-------------------+---------------------+---------------|
  8697. * | peer ID | |RV|FV| ext TID | msg type |
  8698. * |--------------------------------------------------------------------------|
  8699. * | num | release | release | flush | flush |
  8700. * | MPDU | end | start | end | start |
  8701. * | ranges | seq num | seq num | seq num | seq num |
  8702. * |==========================================================================|
  8703. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  8704. * |V|V| | rate | | | timestamp | RSSI |
  8705. * |--------------------------------------------------------------------------|
  8706. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  8707. * |--------------------------------------------------------------------------|
  8708. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  8709. * |--------------------------------------------------------------------------|
  8710. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  8711. * |--------------------------------------------------------------------------|
  8712. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  8713. * |--------------------------------------------------------------------------|
  8714. * | TSF LSBs |
  8715. * |--------------------------------------------------------------------------|
  8716. * | microsec timestamp |
  8717. * |--------------------------------------------------------------------------|
  8718. * | preamble type | HT-SIG / VHT-SIG-A1 |
  8719. * |--------------------------------------------------------------------------|
  8720. * | service | HT-SIG / VHT-SIG-A2 |
  8721. * |==========================================================================|
  8722. * | reserved | FW rx desc bytes |
  8723. * |--------------------------------------------------------------------------|
  8724. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  8725. * | desc B3 | desc B2 | desc B1 | desc B0 |
  8726. * |--------------------------------------------------------------------------|
  8727. * : : :
  8728. * |--------------------------------------------------------------------------|
  8729. * | alignment | MSDU Rx |
  8730. * | padding | desc Bn |
  8731. * |--------------------------------------------------------------------------|
  8732. * | reserved | MPDU range status | MPDU count |
  8733. * |--------------------------------------------------------------------------|
  8734. * : reserved : MPDU range status : MPDU count :
  8735. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  8736. *
  8737. * Header fields:
  8738. * - MSG_TYPE
  8739. * Bits 7:0
  8740. * Purpose: identifies this as an rx indication message
  8741. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  8742. * - EXT_TID
  8743. * Bits 12:8
  8744. * Purpose: identify the traffic ID of the rx data, including
  8745. * special "extended" TID values for multicast, broadcast, and
  8746. * non-QoS data frames
  8747. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  8748. * - FLUSH_VALID (FV)
  8749. * Bit 13
  8750. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  8751. * is valid
  8752. * Value:
  8753. * 1 -> flush IE is valid and needs to be processed
  8754. * 0 -> flush IE is not valid and should be ignored
  8755. * - REL_VALID (RV)
  8756. * Bit 13
  8757. * Purpose: indicate whether the release IE (start/end sequence numbers)
  8758. * is valid
  8759. * Value:
  8760. * 1 -> release IE is valid and needs to be processed
  8761. * 0 -> release IE is not valid and should be ignored
  8762. * - PEER_ID
  8763. * Bits 31:16
  8764. * Purpose: Identify, by ID, which peer sent the rx data
  8765. * Value: ID of the peer who sent the rx data
  8766. * - FLUSH_SEQ_NUM_START
  8767. * Bits 5:0
  8768. * Purpose: Indicate the start of a series of MPDUs to flush
  8769. * Not all MPDUs within this series are necessarily valid - the host
  8770. * must check each sequence number within this range to see if the
  8771. * corresponding MPDU is actually present.
  8772. * This field is only valid if the FV bit is set.
  8773. * Value:
  8774. * The sequence number for the first MPDUs to check to flush.
  8775. * The sequence number is masked by 0x3f.
  8776. * - FLUSH_SEQ_NUM_END
  8777. * Bits 11:6
  8778. * Purpose: Indicate the end of a series of MPDUs to flush
  8779. * Value:
  8780. * The sequence number one larger than the sequence number of the
  8781. * last MPDU to check to flush.
  8782. * The sequence number is masked by 0x3f.
  8783. * Not all MPDUs within this series are necessarily valid - the host
  8784. * must check each sequence number within this range to see if the
  8785. * corresponding MPDU is actually present.
  8786. * This field is only valid if the FV bit is set.
  8787. * - REL_SEQ_NUM_START
  8788. * Bits 17:12
  8789. * Purpose: Indicate the start of a series of MPDUs to release.
  8790. * All MPDUs within this series are present and valid - the host
  8791. * need not check each sequence number within this range to see if
  8792. * the corresponding MPDU is actually present.
  8793. * This field is only valid if the RV bit is set.
  8794. * Value:
  8795. * The sequence number for the first MPDUs to check to release.
  8796. * The sequence number is masked by 0x3f.
  8797. * - REL_SEQ_NUM_END
  8798. * Bits 23:18
  8799. * Purpose: Indicate the end of a series of MPDUs to release.
  8800. * Value:
  8801. * The sequence number one larger than the sequence number of the
  8802. * last MPDU to check to release.
  8803. * The sequence number is masked by 0x3f.
  8804. * All MPDUs within this series are present and valid - the host
  8805. * need not check each sequence number within this range to see if
  8806. * the corresponding MPDU is actually present.
  8807. * This field is only valid if the RV bit is set.
  8808. * - NUM_MPDU_RANGES
  8809. * Bits 31:24
  8810. * Purpose: Indicate how many ranges of MPDUs are present.
  8811. * Each MPDU range consists of a series of contiguous MPDUs within the
  8812. * rx frame sequence which all have the same MPDU status.
  8813. * Value: 1-63 (typically a small number, like 1-3)
  8814. *
  8815. * Rx PPDU descriptor fields:
  8816. * - RSSI_CMB
  8817. * Bits 7:0
  8818. * Purpose: Combined RSSI from all active rx chains, across the active
  8819. * bandwidth.
  8820. * Value: RSSI dB units w.r.t. noise floor
  8821. * - TIMESTAMP_SUBMICROSEC
  8822. * Bits 15:8
  8823. * Purpose: high-resolution timestamp
  8824. * Value:
  8825. * Sub-microsecond time of PPDU reception.
  8826. * This timestamp ranges from [0,MAC clock MHz).
  8827. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  8828. * to form a high-resolution, large range rx timestamp.
  8829. * - PHY_ERR_CODE
  8830. * Bits 23:16
  8831. * Purpose:
  8832. * If the rx frame processing resulted in a PHY error, indicate what
  8833. * type of rx PHY error occurred.
  8834. * Value:
  8835. * This field is valid if the "P" (PHY_ERR) flag is set.
  8836. * TBD: document/specify the values for this field
  8837. * - PHY_ERR
  8838. * Bit 24
  8839. * Purpose: indicate whether the rx PPDU had a PHY error
  8840. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  8841. * - LEGACY_RATE
  8842. * Bits 28:25
  8843. * Purpose:
  8844. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  8845. * specify which rate was used.
  8846. * Value:
  8847. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  8848. * flag.
  8849. * If LEGACY_RATE_SEL is 0:
  8850. * 0x8: OFDM 48 Mbps
  8851. * 0x9: OFDM 24 Mbps
  8852. * 0xA: OFDM 12 Mbps
  8853. * 0xB: OFDM 6 Mbps
  8854. * 0xC: OFDM 54 Mbps
  8855. * 0xD: OFDM 36 Mbps
  8856. * 0xE: OFDM 18 Mbps
  8857. * 0xF: OFDM 9 Mbps
  8858. * If LEGACY_RATE_SEL is 1:
  8859. * 0x8: CCK 11 Mbps long preamble
  8860. * 0x9: CCK 5.5 Mbps long preamble
  8861. * 0xA: CCK 2 Mbps long preamble
  8862. * 0xB: CCK 1 Mbps long preamble
  8863. * 0xC: CCK 11 Mbps short preamble
  8864. * 0xD: CCK 5.5 Mbps short preamble
  8865. * 0xE: CCK 2 Mbps short preamble
  8866. * - LEGACY_RATE_SEL
  8867. * Bit 29
  8868. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  8869. * Value:
  8870. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  8871. * used a legacy rate.
  8872. * 0 -> OFDM, 1 -> CCK
  8873. * - END_VALID
  8874. * Bit 30
  8875. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8876. * the start of the PPDU are valid. Specifically, the following
  8877. * fields are only valid if END_VALID is set:
  8878. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  8879. * TIMESTAMP_SUBMICROSEC
  8880. * Value:
  8881. * 0 -> rx PPDU desc end fields are not valid
  8882. * 1 -> rx PPDU desc end fields are valid
  8883. * - START_VALID
  8884. * Bit 31
  8885. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  8886. * the end of the PPDU are valid. Specifically, the following
  8887. * fields are only valid if START_VALID is set:
  8888. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  8889. * VHT-SIG-A
  8890. * Value:
  8891. * 0 -> rx PPDU desc start fields are not valid
  8892. * 1 -> rx PPDU desc start fields are valid
  8893. * - RSSI0_PRI20
  8894. * Bits 7:0
  8895. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  8896. * Value: RSSI dB units w.r.t. noise floor
  8897. *
  8898. * - RSSI0_EXT20
  8899. * Bits 7:0
  8900. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  8901. * (if the rx bandwidth was >= 40 MHz)
  8902. * Value: RSSI dB units w.r.t. noise floor
  8903. * - RSSI0_EXT40
  8904. * Bits 7:0
  8905. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  8906. * (if the rx bandwidth was >= 80 MHz)
  8907. * Value: RSSI dB units w.r.t. noise floor
  8908. * - RSSI0_EXT80
  8909. * Bits 7:0
  8910. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  8911. * (if the rx bandwidth was >= 160 MHz)
  8912. * Value: RSSI dB units w.r.t. noise floor
  8913. *
  8914. * - RSSI1_PRI20
  8915. * Bits 7:0
  8916. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  8917. * Value: RSSI dB units w.r.t. noise floor
  8918. * - RSSI1_EXT20
  8919. * Bits 7:0
  8920. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  8921. * (if the rx bandwidth was >= 40 MHz)
  8922. * Value: RSSI dB units w.r.t. noise floor
  8923. * - RSSI1_EXT40
  8924. * Bits 7:0
  8925. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  8926. * (if the rx bandwidth was >= 80 MHz)
  8927. * Value: RSSI dB units w.r.t. noise floor
  8928. * - RSSI1_EXT80
  8929. * Bits 7:0
  8930. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  8931. * (if the rx bandwidth was >= 160 MHz)
  8932. * Value: RSSI dB units w.r.t. noise floor
  8933. *
  8934. * - RSSI2_PRI20
  8935. * Bits 7:0
  8936. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  8937. * Value: RSSI dB units w.r.t. noise floor
  8938. * - RSSI2_EXT20
  8939. * Bits 7:0
  8940. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  8941. * (if the rx bandwidth was >= 40 MHz)
  8942. * Value: RSSI dB units w.r.t. noise floor
  8943. * - RSSI2_EXT40
  8944. * Bits 7:0
  8945. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  8946. * (if the rx bandwidth was >= 80 MHz)
  8947. * Value: RSSI dB units w.r.t. noise floor
  8948. * - RSSI2_EXT80
  8949. * Bits 7:0
  8950. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  8951. * (if the rx bandwidth was >= 160 MHz)
  8952. * Value: RSSI dB units w.r.t. noise floor
  8953. *
  8954. * - RSSI3_PRI20
  8955. * Bits 7:0
  8956. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  8957. * Value: RSSI dB units w.r.t. noise floor
  8958. * - RSSI3_EXT20
  8959. * Bits 7:0
  8960. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  8961. * (if the rx bandwidth was >= 40 MHz)
  8962. * Value: RSSI dB units w.r.t. noise floor
  8963. * - RSSI3_EXT40
  8964. * Bits 7:0
  8965. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  8966. * (if the rx bandwidth was >= 80 MHz)
  8967. * Value: RSSI dB units w.r.t. noise floor
  8968. * - RSSI3_EXT80
  8969. * Bits 7:0
  8970. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  8971. * (if the rx bandwidth was >= 160 MHz)
  8972. * Value: RSSI dB units w.r.t. noise floor
  8973. *
  8974. * - TSF32
  8975. * Bits 31:0
  8976. * Purpose: specify the time the rx PPDU was received, in TSF units
  8977. * Value: 32 LSBs of the TSF
  8978. * - TIMESTAMP_MICROSEC
  8979. * Bits 31:0
  8980. * Purpose: specify the time the rx PPDU was received, in microsecond units
  8981. * Value: PPDU rx time, in microseconds
  8982. * - VHT_SIG_A1
  8983. * Bits 23:0
  8984. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  8985. * from the rx PPDU
  8986. * Value:
  8987. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  8988. * VHT-SIG-A1 data.
  8989. * If PREAMBLE_TYPE specifies HT, then this field contains the
  8990. * first 24 bits of the HT-SIG data.
  8991. * Otherwise, this field is invalid.
  8992. * Refer to the the 802.11 protocol for the definition of the
  8993. * HT-SIG and VHT-SIG-A1 fields
  8994. * - VHT_SIG_A2
  8995. * Bits 23:0
  8996. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  8997. * from the rx PPDU
  8998. * Value:
  8999. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9000. * VHT-SIG-A2 data.
  9001. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9002. * last 24 bits of the HT-SIG data.
  9003. * Otherwise, this field is invalid.
  9004. * Refer to the the 802.11 protocol for the definition of the
  9005. * HT-SIG and VHT-SIG-A2 fields
  9006. * - PREAMBLE_TYPE
  9007. * Bits 31:24
  9008. * Purpose: indicate the PHY format of the received burst
  9009. * Value:
  9010. * 0x4: Legacy (OFDM/CCK)
  9011. * 0x8: HT
  9012. * 0x9: HT with TxBF
  9013. * 0xC: VHT
  9014. * 0xD: VHT with TxBF
  9015. * - SERVICE
  9016. * Bits 31:24
  9017. * Purpose: TBD
  9018. * Value: TBD
  9019. *
  9020. * Rx MSDU descriptor fields:
  9021. * - FW_RX_DESC_BYTES
  9022. * Bits 15:0
  9023. * Purpose: Indicate how many bytes in the Rx indication are used for
  9024. * FW Rx descriptors
  9025. *
  9026. * Payload fields:
  9027. * - MPDU_COUNT
  9028. * Bits 7:0
  9029. * Purpose: Indicate how many sequential MPDUs share the same status.
  9030. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9031. * - MPDU_STATUS
  9032. * Bits 15:8
  9033. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9034. * received successfully.
  9035. * Value:
  9036. * 0x1: success
  9037. * 0x2: FCS error
  9038. * 0x3: duplicate error
  9039. * 0x4: replay error
  9040. * 0x5: invalid peer
  9041. */
  9042. /* header fields */
  9043. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9044. #define HTT_RX_IND_EXT_TID_S 8
  9045. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9046. #define HTT_RX_IND_FLUSH_VALID_S 13
  9047. #define HTT_RX_IND_REL_VALID_M 0x4000
  9048. #define HTT_RX_IND_REL_VALID_S 14
  9049. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9050. #define HTT_RX_IND_PEER_ID_S 16
  9051. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9052. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9053. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9054. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9055. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9056. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9057. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9058. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9059. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9060. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9061. /* rx PPDU descriptor fields */
  9062. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9063. #define HTT_RX_IND_RSSI_CMB_S 0
  9064. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9065. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9066. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9067. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9068. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9069. #define HTT_RX_IND_PHY_ERR_S 24
  9070. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9071. #define HTT_RX_IND_LEGACY_RATE_S 25
  9072. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9073. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9074. #define HTT_RX_IND_END_VALID_M 0x40000000
  9075. #define HTT_RX_IND_END_VALID_S 30
  9076. #define HTT_RX_IND_START_VALID_M 0x80000000
  9077. #define HTT_RX_IND_START_VALID_S 31
  9078. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9079. #define HTT_RX_IND_RSSI_PRI20_S 0
  9080. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9081. #define HTT_RX_IND_RSSI_EXT20_S 8
  9082. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9083. #define HTT_RX_IND_RSSI_EXT40_S 16
  9084. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9085. #define HTT_RX_IND_RSSI_EXT80_S 24
  9086. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9087. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9088. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9089. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9090. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9091. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9092. #define HTT_RX_IND_SERVICE_M 0xff000000
  9093. #define HTT_RX_IND_SERVICE_S 24
  9094. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9095. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9096. /* rx MSDU descriptor fields */
  9097. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9098. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9099. /* payload fields */
  9100. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9101. #define HTT_RX_IND_MPDU_COUNT_S 0
  9102. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9103. #define HTT_RX_IND_MPDU_STATUS_S 8
  9104. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9105. do { \
  9106. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9107. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9108. } while (0)
  9109. #define HTT_RX_IND_EXT_TID_GET(word) \
  9110. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9111. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9112. do { \
  9113. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9114. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9115. } while (0)
  9116. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9117. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9118. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9119. do { \
  9120. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9121. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9122. } while (0)
  9123. #define HTT_RX_IND_REL_VALID_GET(word) \
  9124. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9125. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9126. do { \
  9127. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9128. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9129. } while (0)
  9130. #define HTT_RX_IND_PEER_ID_GET(word) \
  9131. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9132. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9133. do { \
  9134. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9135. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9136. } while (0)
  9137. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9138. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9139. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9140. do { \
  9141. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9142. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9143. } while (0)
  9144. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9145. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9146. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9147. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9148. do { \
  9149. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9150. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9151. } while (0)
  9152. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9153. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9154. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9155. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9156. do { \
  9157. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9158. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9159. } while (0)
  9160. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9161. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9162. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9163. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9164. do { \
  9165. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9166. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9167. } while (0)
  9168. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9169. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9170. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9171. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9172. do { \
  9173. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9174. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9175. } while (0)
  9176. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9177. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9178. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9179. /* FW rx PPDU descriptor fields */
  9180. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9181. do { \
  9182. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9183. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9184. } while (0)
  9185. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9186. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9187. HTT_RX_IND_RSSI_CMB_S)
  9188. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9189. do { \
  9190. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9191. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9192. } while (0)
  9193. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9194. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9195. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9196. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9197. do { \
  9198. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9199. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9200. } while (0)
  9201. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9202. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9203. HTT_RX_IND_PHY_ERR_CODE_S)
  9204. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9205. do { \
  9206. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9207. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9208. } while (0)
  9209. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9210. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9211. HTT_RX_IND_PHY_ERR_S)
  9212. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9213. do { \
  9214. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9215. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9216. } while (0)
  9217. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9218. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9219. HTT_RX_IND_LEGACY_RATE_S)
  9220. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9221. do { \
  9222. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9223. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9224. } while (0)
  9225. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9226. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9227. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9228. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9229. do { \
  9230. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9231. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9232. } while (0)
  9233. #define HTT_RX_IND_END_VALID_GET(word) \
  9234. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9235. HTT_RX_IND_END_VALID_S)
  9236. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9237. do { \
  9238. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9239. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9240. } while (0)
  9241. #define HTT_RX_IND_START_VALID_GET(word) \
  9242. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9243. HTT_RX_IND_START_VALID_S)
  9244. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9245. do { \
  9246. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9247. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9248. } while (0)
  9249. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9250. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9251. HTT_RX_IND_RSSI_PRI20_S)
  9252. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9253. do { \
  9254. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9255. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9256. } while (0)
  9257. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9258. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9259. HTT_RX_IND_RSSI_EXT20_S)
  9260. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9261. do { \
  9262. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9263. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9264. } while (0)
  9265. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9266. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9267. HTT_RX_IND_RSSI_EXT40_S)
  9268. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9269. do { \
  9270. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9271. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9272. } while (0)
  9273. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9274. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9275. HTT_RX_IND_RSSI_EXT80_S)
  9276. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9277. do { \
  9278. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  9279. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  9280. } while (0)
  9281. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  9282. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  9283. HTT_RX_IND_VHT_SIG_A1_S)
  9284. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  9285. do { \
  9286. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  9287. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  9288. } while (0)
  9289. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  9290. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  9291. HTT_RX_IND_VHT_SIG_A2_S)
  9292. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  9293. do { \
  9294. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  9295. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  9296. } while (0)
  9297. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  9298. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  9299. HTT_RX_IND_PREAMBLE_TYPE_S)
  9300. #define HTT_RX_IND_SERVICE_SET(word, value) \
  9301. do { \
  9302. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  9303. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  9304. } while (0)
  9305. #define HTT_RX_IND_SERVICE_GET(word) \
  9306. (((word) & HTT_RX_IND_SERVICE_M) >> \
  9307. HTT_RX_IND_SERVICE_S)
  9308. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  9309. do { \
  9310. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  9311. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  9312. } while (0)
  9313. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  9314. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  9315. HTT_RX_IND_SA_ANT_MATRIX_S)
  9316. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  9317. do { \
  9318. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  9319. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  9320. } while (0)
  9321. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  9322. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  9323. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  9324. do { \
  9325. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  9326. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  9327. } while (0)
  9328. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  9329. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  9330. #define HTT_RX_IND_HL_BYTES \
  9331. (HTT_RX_IND_HDR_BYTES + \
  9332. 4 /* single FW rx MSDU descriptor */ + \
  9333. 4 /* single MPDU range information element */)
  9334. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  9335. /* Could we use one macro entry? */
  9336. #define HTT_WORD_SET(word, field, value) \
  9337. do { \
  9338. HTT_CHECK_SET_VAL(field, value); \
  9339. (word) |= ((value) << field ## _S); \
  9340. } while (0)
  9341. #define HTT_WORD_GET(word, field) \
  9342. (((word) & field ## _M) >> field ## _S)
  9343. PREPACK struct hl_htt_rx_ind_base {
  9344. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  9345. } POSTPACK;
  9346. /*
  9347. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  9348. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  9349. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  9350. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  9351. * htt_rx_ind_hl_rx_desc_t.
  9352. */
  9353. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  9354. struct htt_rx_ind_hl_rx_desc_t {
  9355. A_UINT8 ver;
  9356. A_UINT8 len;
  9357. struct {
  9358. A_UINT8
  9359. first_msdu: 1,
  9360. last_msdu: 1,
  9361. c3_failed: 1,
  9362. c4_failed: 1,
  9363. ipv6: 1,
  9364. tcp: 1,
  9365. udp: 1,
  9366. reserved: 1;
  9367. } flags;
  9368. /* NOTE: no reserved space - don't append any new fields here */
  9369. };
  9370. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  9371. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9372. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  9373. #define HTT_RX_IND_HL_RX_DESC_VER 0
  9374. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  9375. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9376. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  9377. #define HTT_RX_IND_HL_FLAG_OFFSET \
  9378. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9379. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  9380. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  9381. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  9382. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  9383. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  9384. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  9385. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  9386. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  9387. /* This structure is used in HL, the basic descriptor information
  9388. * used by host. the structure is translated by FW from HW desc
  9389. * or generated by FW. But in HL monitor mode, the host would use
  9390. * the same structure with LL.
  9391. */
  9392. PREPACK struct hl_htt_rx_desc_base {
  9393. A_UINT32
  9394. seq_num:12,
  9395. encrypted:1,
  9396. chan_info_present:1,
  9397. resv0:2,
  9398. mcast_bcast:1,
  9399. fragment:1,
  9400. key_id_oct:8,
  9401. resv1:6;
  9402. A_UINT32
  9403. pn_31_0;
  9404. union {
  9405. struct {
  9406. A_UINT16 pn_47_32;
  9407. A_UINT16 pn_63_48;
  9408. } pn16;
  9409. A_UINT32 pn_63_32;
  9410. } u0;
  9411. A_UINT32
  9412. pn_95_64;
  9413. A_UINT32
  9414. pn_127_96;
  9415. } POSTPACK;
  9416. /*
  9417. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  9418. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  9419. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  9420. * Please see htt_chan_change_t for description of the fields.
  9421. */
  9422. PREPACK struct htt_chan_info_t
  9423. {
  9424. A_UINT32 primary_chan_center_freq_mhz: 16,
  9425. contig_chan1_center_freq_mhz: 16;
  9426. A_UINT32 contig_chan2_center_freq_mhz: 16,
  9427. phy_mode: 8,
  9428. reserved: 8;
  9429. } POSTPACK;
  9430. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  9431. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  9432. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  9433. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  9434. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  9435. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  9436. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  9437. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  9438. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  9439. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  9440. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  9441. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  9442. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  9443. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  9444. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  9445. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  9446. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  9447. /* Channel information */
  9448. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  9449. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  9450. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  9451. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  9452. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  9453. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  9454. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  9455. #define HTT_CHAN_INFO_PHY_MODE_S 16
  9456. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  9457. do { \
  9458. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  9459. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  9460. } while (0)
  9461. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  9462. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  9463. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  9464. do { \
  9465. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  9466. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  9467. } while (0)
  9468. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  9469. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  9470. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  9471. do { \
  9472. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  9473. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  9474. } while (0)
  9475. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  9476. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  9477. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  9478. do { \
  9479. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  9480. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  9481. } while (0)
  9482. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  9483. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  9484. /*
  9485. * @brief target -> host message definition for FW offloaded pkts
  9486. *
  9487. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  9488. *
  9489. * @details
  9490. * The following field definitions describe the format of the firmware
  9491. * offload deliver message sent from the target to the host.
  9492. *
  9493. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  9494. *
  9495. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  9496. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  9497. * | reserved_1 | msg type |
  9498. * |--------------------------------------------------------------------------|
  9499. * | phy_timestamp_l32 |
  9500. * |--------------------------------------------------------------------------|
  9501. * | WORD2 (see below) |
  9502. * |--------------------------------------------------------------------------|
  9503. * | seqno | framectrl |
  9504. * |--------------------------------------------------------------------------|
  9505. * | reserved_3 | vdev_id | tid_num|
  9506. * |--------------------------------------------------------------------------|
  9507. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  9508. * |--------------------------------------------------------------------------|
  9509. *
  9510. * where:
  9511. * STAT = status
  9512. * F = format (802.3 vs. 802.11)
  9513. *
  9514. * definition for word 2
  9515. *
  9516. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  9517. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  9518. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  9519. * |--------------------------------------------------------------------------|
  9520. *
  9521. * where:
  9522. * PR = preamble
  9523. * BF = beamformed
  9524. */
  9525. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  9526. {
  9527. A_UINT32 /* word 0 */
  9528. msg_type:8, /* [ 7: 0] */
  9529. reserved_1:24; /* [31: 8] */
  9530. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  9531. A_UINT32 /* word 2 */
  9532. /* preamble:
  9533. * 0-OFDM,
  9534. * 1-CCk,
  9535. * 2-HT,
  9536. * 3-VHT
  9537. */
  9538. preamble: 2, /* [1:0] */
  9539. /* mcs:
  9540. * In case of HT preamble interpret
  9541. * MCS along with NSS.
  9542. * Valid values for HT are 0 to 7.
  9543. * HT mcs 0 with NSS 2 is mcs 8.
  9544. * Valid values for VHT are 0 to 9.
  9545. */
  9546. mcs: 4, /* [5:2] */
  9547. /* rate:
  9548. * This is applicable only for
  9549. * CCK and OFDM preamble type
  9550. * rate 0: OFDM 48 Mbps,
  9551. * 1: OFDM 24 Mbps,
  9552. * 2: OFDM 12 Mbps
  9553. * 3: OFDM 6 Mbps
  9554. * 4: OFDM 54 Mbps
  9555. * 5: OFDM 36 Mbps
  9556. * 6: OFDM 18 Mbps
  9557. * 7: OFDM 9 Mbps
  9558. * rate 0: CCK 11 Mbps Long
  9559. * 1: CCK 5.5 Mbps Long
  9560. * 2: CCK 2 Mbps Long
  9561. * 3: CCK 1 Mbps Long
  9562. * 4: CCK 11 Mbps Short
  9563. * 5: CCK 5.5 Mbps Short
  9564. * 6: CCK 2 Mbps Short
  9565. */
  9566. rate : 3, /* [ 8: 6] */
  9567. rssi : 8, /* [16: 9] units=dBm */
  9568. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  9569. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  9570. stbc : 1, /* [22] */
  9571. sgi : 1, /* [23] */
  9572. ldpc : 1, /* [24] */
  9573. beamformed: 1, /* [25] */
  9574. reserved_2: 6; /* [31:26] */
  9575. A_UINT32 /* word 3 */
  9576. framectrl:16, /* [15: 0] */
  9577. seqno:16; /* [31:16] */
  9578. A_UINT32 /* word 4 */
  9579. tid_num:5, /* [ 4: 0] actual TID number */
  9580. vdev_id:8, /* [12: 5] */
  9581. reserved_3:19; /* [31:13] */
  9582. A_UINT32 /* word 5 */
  9583. /* status:
  9584. * 0: tx_ok
  9585. * 1: retry
  9586. * 2: drop
  9587. * 3: filtered
  9588. * 4: abort
  9589. * 5: tid delete
  9590. * 6: sw abort
  9591. * 7: dropped by peer migration
  9592. */
  9593. status:3, /* [2:0] */
  9594. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  9595. tx_mpdu_bytes:16, /* [19:4] */
  9596. /* Indicates retry count of offloaded/local generated Data tx frames */
  9597. tx_retry_cnt:6, /* [25:20] */
  9598. reserved_4:6; /* [31:26] */
  9599. } POSTPACK;
  9600. /* FW offload deliver ind message header fields */
  9601. /* DWORD one */
  9602. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  9603. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  9604. /* DWORD two */
  9605. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  9606. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  9607. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  9608. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  9609. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  9610. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  9611. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  9612. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  9613. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  9614. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  9615. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  9616. #define HTT_FW_OFFLOAD_IND_BW_S 19
  9617. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  9618. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  9619. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  9620. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  9621. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  9622. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  9623. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  9624. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  9625. /* DWORD three*/
  9626. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  9627. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  9628. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  9629. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  9630. /* DWORD four */
  9631. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  9632. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  9633. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  9634. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  9635. /* DWORD five */
  9636. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  9637. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  9638. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  9639. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  9640. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  9641. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  9642. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  9643. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  9644. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  9645. do { \
  9646. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  9647. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  9648. } while (0)
  9649. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  9650. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  9651. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  9652. do { \
  9653. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  9654. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  9655. } while (0)
  9656. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  9657. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  9658. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  9659. do { \
  9660. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  9661. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  9662. } while (0)
  9663. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  9664. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  9665. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  9666. do { \
  9667. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  9668. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  9669. } while (0)
  9670. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  9671. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  9672. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  9673. do { \
  9674. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  9675. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  9676. } while (0)
  9677. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  9678. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  9679. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  9680. do { \
  9681. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  9682. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  9683. } while (0)
  9684. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  9685. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  9686. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  9687. do { \
  9688. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  9689. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  9690. } while (0)
  9691. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  9692. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  9693. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  9694. do { \
  9695. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  9696. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  9697. } while (0)
  9698. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  9699. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  9700. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  9701. do { \
  9702. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  9703. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  9704. } while (0)
  9705. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  9706. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  9707. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  9708. do { \
  9709. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  9710. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  9711. } while (0)
  9712. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  9713. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  9714. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  9715. do { \
  9716. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  9717. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  9718. } while (0)
  9719. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  9720. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  9721. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  9722. do { \
  9723. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  9724. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  9725. } while (0)
  9726. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  9727. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  9728. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  9729. do { \
  9730. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  9731. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  9732. } while (0)
  9733. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  9734. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  9735. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  9736. do { \
  9737. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  9738. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  9739. } while (0)
  9740. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  9741. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  9742. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  9743. do { \
  9744. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  9745. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  9746. } while (0)
  9747. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  9748. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  9749. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  9750. do { \
  9751. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  9752. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  9753. } while (0)
  9754. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  9755. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  9756. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  9757. do { \
  9758. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  9759. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  9760. } while (0)
  9761. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  9762. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  9763. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  9764. do { \
  9765. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  9766. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  9767. } while (0)
  9768. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  9769. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  9770. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  9771. do { \
  9772. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  9773. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  9774. } while (0)
  9775. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  9776. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  9777. /*
  9778. * @brief target -> host rx reorder flush message definition
  9779. *
  9780. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  9781. *
  9782. * @details
  9783. * The following field definitions describe the format of the rx flush
  9784. * message sent from the target to the host.
  9785. * The message consists of a 4-octet header, followed by one or more
  9786. * 4-octet payload information elements.
  9787. *
  9788. * |31 24|23 8|7 0|
  9789. * |--------------------------------------------------------------|
  9790. * | TID | peer ID | msg type |
  9791. * |--------------------------------------------------------------|
  9792. * | seq num end | seq num start | MPDU status | reserved |
  9793. * |--------------------------------------------------------------|
  9794. * First DWORD:
  9795. * - MSG_TYPE
  9796. * Bits 7:0
  9797. * Purpose: identifies this as an rx flush message
  9798. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  9799. * - PEER_ID
  9800. * Bits 23:8 (only bits 18:8 actually used)
  9801. * Purpose: identify which peer's rx data is being flushed
  9802. * Value: (rx) peer ID
  9803. * - TID
  9804. * Bits 31:24 (only bits 27:24 actually used)
  9805. * Purpose: Specifies which traffic identifier's rx data is being flushed
  9806. * Value: traffic identifier
  9807. * Second DWORD:
  9808. * - MPDU_STATUS
  9809. * Bits 15:8
  9810. * Purpose:
  9811. * Indicate whether the flushed MPDUs should be discarded or processed.
  9812. * Value:
  9813. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  9814. * stages of rx processing
  9815. * other: discard the MPDUs
  9816. * It is anticipated that flush messages will always have
  9817. * MPDU status == 1, but the status flag is included for
  9818. * flexibility.
  9819. * - SEQ_NUM_START
  9820. * Bits 23:16
  9821. * Purpose:
  9822. * Indicate the start of a series of consecutive MPDUs being flushed.
  9823. * Not all MPDUs within this range are necessarily valid - the host
  9824. * must check each sequence number within this range to see if the
  9825. * corresponding MPDU is actually present.
  9826. * Value:
  9827. * The sequence number for the first MPDU in the sequence.
  9828. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9829. * - SEQ_NUM_END
  9830. * Bits 30:24
  9831. * Purpose:
  9832. * Indicate the end of a series of consecutive MPDUs being flushed.
  9833. * Value:
  9834. * The sequence number one larger than the sequence number of the
  9835. * last MPDU being flushed.
  9836. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9837. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  9838. * are to be released for further rx processing.
  9839. * Not all MPDUs within this range are necessarily valid - the host
  9840. * must check each sequence number within this range to see if the
  9841. * corresponding MPDU is actually present.
  9842. */
  9843. /* first DWORD */
  9844. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  9845. #define HTT_RX_FLUSH_PEER_ID_S 8
  9846. #define HTT_RX_FLUSH_TID_M 0xff000000
  9847. #define HTT_RX_FLUSH_TID_S 24
  9848. /* second DWORD */
  9849. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  9850. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  9851. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  9852. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  9853. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  9854. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  9855. #define HTT_RX_FLUSH_BYTES 8
  9856. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  9857. do { \
  9858. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  9859. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  9860. } while (0)
  9861. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  9862. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  9863. #define HTT_RX_FLUSH_TID_SET(word, value) \
  9864. do { \
  9865. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  9866. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  9867. } while (0)
  9868. #define HTT_RX_FLUSH_TID_GET(word) \
  9869. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  9870. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  9871. do { \
  9872. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  9873. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  9874. } while (0)
  9875. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  9876. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  9877. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  9878. do { \
  9879. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  9880. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  9881. } while (0)
  9882. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  9883. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  9884. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  9885. do { \
  9886. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  9887. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  9888. } while (0)
  9889. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  9890. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  9891. /*
  9892. * @brief target -> host rx pn check indication message
  9893. *
  9894. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  9895. *
  9896. * @details
  9897. * The following field definitions describe the format of the Rx PN check
  9898. * indication message sent from the target to the host.
  9899. * The message consists of a 4-octet header, followed by the start and
  9900. * end sequence numbers to be released, followed by the PN IEs. Each PN
  9901. * IE is one octet containing the sequence number that failed the PN
  9902. * check.
  9903. *
  9904. * |31 24|23 8|7 0|
  9905. * |--------------------------------------------------------------|
  9906. * | TID | peer ID | msg type |
  9907. * |--------------------------------------------------------------|
  9908. * | Reserved | PN IE count | seq num end | seq num start|
  9909. * |--------------------------------------------------------------|
  9910. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  9911. * |--------------------------------------------------------------|
  9912. * First DWORD:
  9913. * - MSG_TYPE
  9914. * Bits 7:0
  9915. * Purpose: Identifies this as an rx pn check indication message
  9916. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  9917. * - PEER_ID
  9918. * Bits 23:8 (only bits 18:8 actually used)
  9919. * Purpose: identify which peer
  9920. * Value: (rx) peer ID
  9921. * - TID
  9922. * Bits 31:24 (only bits 27:24 actually used)
  9923. * Purpose: identify traffic identifier
  9924. * Value: traffic identifier
  9925. * Second DWORD:
  9926. * - SEQ_NUM_START
  9927. * Bits 7:0
  9928. * Purpose:
  9929. * Indicates the starting sequence number of the MPDU in this
  9930. * series of MPDUs that went though PN check.
  9931. * Value:
  9932. * The sequence number for the first MPDU in the sequence.
  9933. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9934. * - SEQ_NUM_END
  9935. * Bits 15:8
  9936. * Purpose:
  9937. * Indicates the ending sequence number of the MPDU in this
  9938. * series of MPDUs that went though PN check.
  9939. * Value:
  9940. * The sequence number one larger then the sequence number of the last
  9941. * MPDU being flushed.
  9942. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  9943. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  9944. * for invalid PN numbers and are ready to be released for further processing.
  9945. * Not all MPDUs within this range are necessarily valid - the host
  9946. * must check each sequence number within this range to see if the
  9947. * corresponding MPDU is actually present.
  9948. * - PN_IE_COUNT
  9949. * Bits 23:16
  9950. * Purpose:
  9951. * Used to determine the variable number of PN information elements in this
  9952. * message
  9953. *
  9954. * PN information elements:
  9955. * - PN_IE_x-
  9956. * Purpose:
  9957. * Each PN information element contains the sequence number of the MPDU that
  9958. * has failed the target PN check.
  9959. * Value:
  9960. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  9961. * that failed the PN check.
  9962. */
  9963. /* first DWORD */
  9964. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  9965. #define HTT_RX_PN_IND_PEER_ID_S 8
  9966. #define HTT_RX_PN_IND_TID_M 0xff000000
  9967. #define HTT_RX_PN_IND_TID_S 24
  9968. /* second DWORD */
  9969. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  9970. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  9971. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  9972. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  9973. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  9974. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  9975. #define HTT_RX_PN_IND_BYTES 8
  9976. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  9977. do { \
  9978. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  9979. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  9980. } while (0)
  9981. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  9982. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  9983. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  9984. do { \
  9985. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  9986. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  9987. } while (0)
  9988. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  9989. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  9990. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  9991. do { \
  9992. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  9993. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  9994. } while (0)
  9995. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  9996. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  9997. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  9998. do { \
  9999. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10000. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10001. } while (0)
  10002. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10003. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10004. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10005. do { \
  10006. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10007. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10008. } while (0)
  10009. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10010. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10011. /*
  10012. * @brief target -> host rx offload deliver message for LL system
  10013. *
  10014. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10015. *
  10016. * @details
  10017. * In a low latency system this message is sent whenever the offload
  10018. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10019. * The DMA of the actual packets into host memory is done before sending out
  10020. * this message. This message indicates only how many MSDUs to reap. The
  10021. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10022. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10023. * DMA'd by the MAC directly into host memory these packets do not contain
  10024. * the MAC descriptors in the header portion of the packet. Instead they contain
  10025. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10026. * message, the packets are delivered directly to the NW stack without going
  10027. * through the regular reorder buffering and PN checking path since it has
  10028. * already been done in target.
  10029. *
  10030. * |31 24|23 16|15 8|7 0|
  10031. * |-----------------------------------------------------------------------|
  10032. * | Total MSDU count | reserved | msg type |
  10033. * |-----------------------------------------------------------------------|
  10034. *
  10035. * @brief target -> host rx offload deliver message for HL system
  10036. *
  10037. * @details
  10038. * In a high latency system this message is sent whenever the offload manager
  10039. * flushes out the packets it has coalesced in its coalescing buffer. The
  10040. * actual packets are also carried along with this message. When the host
  10041. * receives this message, it is expected to deliver these packets to the NW
  10042. * stack directly instead of routing them through the reorder buffering and
  10043. * PN checking path since it has already been done in target.
  10044. *
  10045. * |31 24|23 16|15 8|7 0|
  10046. * |-----------------------------------------------------------------------|
  10047. * | Total MSDU count | reserved | msg type |
  10048. * |-----------------------------------------------------------------------|
  10049. * | peer ID | MSDU length |
  10050. * |-----------------------------------------------------------------------|
  10051. * | MSDU payload | FW Desc | tid | vdev ID |
  10052. * |-----------------------------------------------------------------------|
  10053. * | MSDU payload contd. |
  10054. * |-----------------------------------------------------------------------|
  10055. * | peer ID | MSDU length |
  10056. * |-----------------------------------------------------------------------|
  10057. * | MSDU payload | FW Desc | tid | vdev ID |
  10058. * |-----------------------------------------------------------------------|
  10059. * | MSDU payload contd. |
  10060. * |-----------------------------------------------------------------------|
  10061. *
  10062. */
  10063. /* first DWORD */
  10064. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10065. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10066. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10067. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10068. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10069. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10070. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10071. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10072. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10073. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10074. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10075. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10076. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10077. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10078. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10079. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10080. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10081. do { \
  10082. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10083. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10084. } while (0)
  10085. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10086. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10087. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10088. do { \
  10089. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10090. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10091. } while (0)
  10092. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10093. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10094. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10095. do { \
  10096. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10097. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10098. } while (0)
  10099. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10100. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10101. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10102. do { \
  10103. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10104. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10105. } while (0)
  10106. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10107. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10108. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10109. do { \
  10110. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10111. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10112. } while (0)
  10113. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10114. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10115. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10116. do { \
  10117. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10118. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10119. } while (0)
  10120. /**
  10121. * @brief target -> host rx peer map/unmap message definition
  10122. *
  10123. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10124. *
  10125. * @details
  10126. * The following diagram shows the format of the rx peer map message sent
  10127. * from the target to the host. This layout assumes the target operates
  10128. * as little-endian.
  10129. *
  10130. * This message always contains a SW peer ID. The main purpose of the
  10131. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10132. * with, so that the host can use that peer ID to determine which peer
  10133. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10134. * other purposes, such as identifying during tx completions which peer
  10135. * the tx frames in question were transmitted to.
  10136. *
  10137. * In certain generations of chips, the peer map message also contains
  10138. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10139. * to identify which peer the frame needs to be forwarded to (i.e. the
  10140. * peer assocated with the Destination MAC Address within the packet),
  10141. * and particularly which vdev needs to transmit the frame (for cases
  10142. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10143. * meaning as AST_INDEX_0.
  10144. * This DA-based peer ID that is provided for certain rx frames
  10145. * (the rx frames that need to be re-transmitted as tx frames)
  10146. * is the ID that the HW uses for referring to the peer in question,
  10147. * rather than the peer ID that the SW+FW use to refer to the peer.
  10148. *
  10149. *
  10150. * |31 24|23 16|15 8|7 0|
  10151. * |-----------------------------------------------------------------------|
  10152. * | SW peer ID | VDEV ID | msg type |
  10153. * |-----------------------------------------------------------------------|
  10154. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10155. * |-----------------------------------------------------------------------|
  10156. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10157. * |-----------------------------------------------------------------------|
  10158. *
  10159. *
  10160. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10161. *
  10162. * The following diagram shows the format of the rx peer unmap message sent
  10163. * from the target to the host.
  10164. *
  10165. * |31 24|23 16|15 8|7 0|
  10166. * |-----------------------------------------------------------------------|
  10167. * | SW peer ID | VDEV ID | msg type |
  10168. * |-----------------------------------------------------------------------|
  10169. *
  10170. * The following field definitions describe the format of the rx peer map
  10171. * and peer unmap messages sent from the target to the host.
  10172. * - MSG_TYPE
  10173. * Bits 7:0
  10174. * Purpose: identifies this as an rx peer map or peer unmap message
  10175. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10176. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10177. * - VDEV_ID
  10178. * Bits 15:8
  10179. * Purpose: Indicates which virtual device the peer is associated
  10180. * with.
  10181. * Value: vdev ID (used in the host to look up the vdev object)
  10182. * - PEER_ID (a.k.a. SW_PEER_ID)
  10183. * Bits 31:16
  10184. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10185. * freeing (unmap)
  10186. * Value: (rx) peer ID
  10187. * - MAC_ADDR_L32 (peer map only)
  10188. * Bits 31:0
  10189. * Purpose: Identifies which peer node the peer ID is for.
  10190. * Value: lower 4 bytes of peer node's MAC address
  10191. * - MAC_ADDR_U16 (peer map only)
  10192. * Bits 15:0
  10193. * Purpose: Identifies which peer node the peer ID is for.
  10194. * Value: upper 2 bytes of peer node's MAC address
  10195. * - HW_PEER_ID
  10196. * Bits 31:16
  10197. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10198. * address, so for rx frames marked for rx --> tx forwarding, the
  10199. * host can determine from the HW peer ID provided as meta-data with
  10200. * the rx frame which peer the frame is supposed to be forwarded to.
  10201. * Value: ID used by the MAC HW to identify the peer
  10202. */
  10203. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10204. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10205. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10206. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10207. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10208. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10209. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10210. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10211. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10212. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10213. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10214. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10215. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10216. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10217. do { \
  10218. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10219. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10220. } while (0)
  10221. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10222. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10223. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10224. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10225. do { \
  10226. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10227. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10228. } while (0)
  10229. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10230. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10231. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10232. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10233. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10234. do { \
  10235. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10236. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10237. } while (0)
  10238. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10239. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10240. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10241. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10242. #define HTT_RX_PEER_MAP_BYTES 12
  10243. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10244. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10245. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10246. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10247. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10248. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10249. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10250. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10251. #define HTT_RX_PEER_UNMAP_BYTES 4
  10252. /**
  10253. * @brief target -> host rx peer map V2 message definition
  10254. *
  10255. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10256. *
  10257. * @details
  10258. * The following diagram shows the format of the rx peer map v2 message sent
  10259. * from the target to the host. This layout assumes the target operates
  10260. * as little-endian.
  10261. *
  10262. * This message always contains a SW peer ID. The main purpose of the
  10263. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10264. * with, so that the host can use that peer ID to determine which peer
  10265. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10266. * other purposes, such as identifying during tx completions which peer
  10267. * the tx frames in question were transmitted to.
  10268. *
  10269. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10270. * is used during rx --> tx frame forwarding to identify which peer the
  10271. * frame needs to be forwarded to (i.e. the peer assocated with the
  10272. * Destination MAC Address within the packet), and particularly which vdev
  10273. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10274. * This DA-based peer ID that is provided for certain rx frames
  10275. * (the rx frames that need to be re-transmitted as tx frames)
  10276. * is the ID that the HW uses for referring to the peer in question,
  10277. * rather than the peer ID that the SW+FW use to refer to the peer.
  10278. *
  10279. * The HW peer id here is the same meaning as AST_INDEX_0.
  10280. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  10281. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  10282. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  10283. * AST is valid.
  10284. *
  10285. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  10286. * |-------------------------------------------------------------------------|
  10287. * | SW peer ID | VDEV ID | msg type |
  10288. * |-------------------------------------------------------------------------|
  10289. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10290. * |-------------------------------------------------------------------------|
  10291. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10292. * |-------------------------------------------------------------------------|
  10293. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  10294. * |-------------------------------------------------------------------------|
  10295. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  10296. * |-------------------------------------------------------------------------|
  10297. * |TID valid low pri| TID valid hi pri | AST index 2 |
  10298. * |-------------------------------------------------------------------------|
  10299. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  10300. * |-------------------------------------------------------------------------|
  10301. * | Reserved_2 |
  10302. * |-------------------------------------------------------------------------|
  10303. * Where:
  10304. * NH = Next Hop
  10305. * ASTVM = AST valid mask
  10306. * OA = on-chip AST valid bit
  10307. * ASTFM = AST flow mask
  10308. *
  10309. * The following field definitions describe the format of the rx peer map v2
  10310. * messages sent from the target to the host.
  10311. * - MSG_TYPE
  10312. * Bits 7:0
  10313. * Purpose: identifies this as an rx peer map v2 message
  10314. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  10315. * - VDEV_ID
  10316. * Bits 15:8
  10317. * Purpose: Indicates which virtual device the peer is associated with.
  10318. * Value: vdev ID (used in the host to look up the vdev object)
  10319. * - SW_PEER_ID
  10320. * Bits 31:16
  10321. * Purpose: The peer ID (index) that WAL is allocating
  10322. * Value: (rx) peer ID
  10323. * - MAC_ADDR_L32
  10324. * Bits 31:0
  10325. * Purpose: Identifies which peer node the peer ID is for.
  10326. * Value: lower 4 bytes of peer node's MAC address
  10327. * - MAC_ADDR_U16
  10328. * Bits 15:0
  10329. * Purpose: Identifies which peer node the peer ID is for.
  10330. * Value: upper 2 bytes of peer node's MAC address
  10331. * - HW_PEER_ID / AST_INDEX_0
  10332. * Bits 31:16
  10333. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10334. * address, so for rx frames marked for rx --> tx forwarding, the
  10335. * host can determine from the HW peer ID provided as meta-data with
  10336. * the rx frame which peer the frame is supposed to be forwarded to.
  10337. * Value: ID used by the MAC HW to identify the peer
  10338. * - AST_HASH_VALUE
  10339. * Bits 15:0
  10340. * Purpose: Indicates AST Hash value is required for the TCL AST index
  10341. * override feature.
  10342. * - NEXT_HOP
  10343. * Bit 16
  10344. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  10345. * (Wireless Distribution System).
  10346. * - AST_VALID_MASK
  10347. * Bits 19:17
  10348. * Purpose: Indicate if the AST 1 through AST 3 are valid
  10349. * - ONCHIP_AST_VALID_FLAG
  10350. * Bit 20
  10351. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  10352. * is valid.
  10353. * - AST_INDEX_1
  10354. * Bits 15:0
  10355. * Purpose: indicate the second AST index for this peer
  10356. * - AST_0_FLOW_MASK
  10357. * Bits 19:16
  10358. * Purpose: identify the which flow the AST 0 entry corresponds to.
  10359. * - AST_1_FLOW_MASK
  10360. * Bits 23:20
  10361. * Purpose: identify the which flow the AST 1 entry corresponds to.
  10362. * - AST_2_FLOW_MASK
  10363. * Bits 27:24
  10364. * Purpose: identify the which flow the AST 2 entry corresponds to.
  10365. * - AST_3_FLOW_MASK
  10366. * Bits 31:28
  10367. * Purpose: identify the which flow the AST 3 entry corresponds to.
  10368. * - AST_INDEX_2
  10369. * Bits 15:0
  10370. * Purpose: indicate the third AST index for this peer
  10371. * - TID_VALID_HI_PRI
  10372. * Bits 23:16
  10373. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  10374. * - TID_VALID_LOW_PRI
  10375. * Bits 31:24
  10376. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  10377. * - AST_INDEX_3
  10378. * Bits 15:0
  10379. * Purpose: indicate the fourth AST index for this peer
  10380. * - ONCHIP_AST_IDX / RESERVED
  10381. * Bits 31:16
  10382. * Purpose: This field is valid only when split AST feature is enabled.
  10383. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  10384. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10385. * address, this ast_idx is used for LMAC modules for RXPCU.
  10386. * Value: ID used by the LMAC HW to identify the peer
  10387. */
  10388. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  10389. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  10390. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  10391. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  10392. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  10393. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  10394. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  10395. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  10396. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  10397. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  10398. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  10399. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  10400. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  10401. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  10402. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  10403. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  10404. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  10405. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  10406. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  10407. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  10408. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  10409. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  10410. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  10411. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  10412. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  10413. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  10414. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  10415. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  10416. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  10417. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  10418. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  10419. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  10420. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  10421. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  10422. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  10423. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  10424. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  10425. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  10426. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  10427. do { \
  10428. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  10429. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  10430. } while (0)
  10431. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  10432. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  10433. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  10434. do { \
  10435. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  10436. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  10437. } while (0)
  10438. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  10439. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  10440. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  10441. do { \
  10442. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  10443. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  10444. } while (0)
  10445. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  10446. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  10447. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  10448. do { \
  10449. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  10450. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  10451. } while (0)
  10452. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  10453. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  10454. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  10455. do { \
  10456. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  10457. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  10458. } while (0)
  10459. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  10460. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  10461. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  10462. do { \
  10463. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  10464. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  10465. } while (0)
  10466. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  10467. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  10468. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  10469. do { \
  10470. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  10471. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  10472. } while (0)
  10473. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  10474. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  10475. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10476. do { \
  10477. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  10478. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  10479. } while (0)
  10480. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  10481. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  10482. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  10483. do { \
  10484. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  10485. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  10486. } while (0)
  10487. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  10488. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  10489. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  10490. do { \
  10491. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  10492. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  10493. } while (0)
  10494. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  10495. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  10496. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  10497. do { \
  10498. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  10499. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  10500. } while (0)
  10501. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  10502. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  10503. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  10504. do { \
  10505. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  10506. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  10507. } while (0)
  10508. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  10509. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  10510. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  10511. do { \
  10512. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  10513. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  10514. } while (0)
  10515. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  10516. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  10517. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  10518. do { \
  10519. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  10520. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  10521. } while (0)
  10522. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  10523. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  10524. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  10525. do { \
  10526. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  10527. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  10528. } while (0)
  10529. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  10530. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  10531. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  10532. do { \
  10533. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  10534. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  10535. } while (0)
  10536. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  10537. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  10538. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  10539. do { \
  10540. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  10541. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  10542. } while (0)
  10543. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  10544. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  10545. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10546. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  10547. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  10548. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  10549. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  10550. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  10551. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  10552. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  10553. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  10554. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  10555. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  10556. #define HTT_RX_PEER_MAP_V2_BYTES 32
  10557. /**
  10558. * @brief target -> host rx peer map V3 message definition
  10559. *
  10560. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  10561. *
  10562. * @details
  10563. * The following diagram shows the format of the rx peer map v3 message sent
  10564. * from the target to the host.
  10565. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  10566. * This layout assumes the target operates as little-endian.
  10567. *
  10568. * |31 24|23 20|19|18|17|16|15 8|7 0|
  10569. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  10570. * | SW peer ID | VDEV ID | msg type |
  10571. * |-----------------+--------------------+-----------------+-----------------|
  10572. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10573. * |-----------------+--------------------+-----------------+-----------------|
  10574. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  10575. * |-----------------+--------+-----------+-----------------+-----------------|
  10576. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  10577. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  10578. * | (8bits) | | (4bits) | |
  10579. * |-----------------+--------+--+--+--+--------------------------------------|
  10580. * | RESERVED |E |O | | |
  10581. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  10582. * | |V |V | | |
  10583. * |-----------------+--------------------+-----------------------------------|
  10584. * | HTT_MSDU_IDX_ | RESERVED | |
  10585. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  10586. * | (8bits) | | |
  10587. * |-----------------+--------------------+-----------------------------------|
  10588. * | Reserved_2 |
  10589. * |--------------------------------------------------------------------------|
  10590. * | Reserved_3 |
  10591. * |--------------------------------------------------------------------------|
  10592. *
  10593. * Where:
  10594. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  10595. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  10596. * NH = Next Hop
  10597. * The following field definitions describe the format of the rx peer map v3
  10598. * messages sent from the target to the host.
  10599. * - MSG_TYPE
  10600. * Bits 7:0
  10601. * Purpose: identifies this as a peer map v3 message
  10602. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  10603. * - VDEV_ID
  10604. * Bits 15:8
  10605. * Purpose: Indicates which virtual device the peer is associated with.
  10606. * - SW_PEER_ID
  10607. * Bits 31:16
  10608. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  10609. * - MAC_ADDR_L32
  10610. * Bits 31:0
  10611. * Purpose: Identifies which peer node the peer ID is for.
  10612. * Value: lower 4 bytes of peer node's MAC address
  10613. * - MAC_ADDR_U16
  10614. * Bits 15:0
  10615. * Purpose: Identifies which peer node the peer ID is for.
  10616. * Value: upper 2 bytes of peer node's MAC address
  10617. * - MULTICAST_SW_PEER_ID
  10618. * Bits 31:16
  10619. * Purpose: The multicast peer ID (index)
  10620. * Value: set to HTT_INVALID_PEER if not valid
  10621. * - HW_PEER_ID / AST_INDEX
  10622. * Bits 15:0
  10623. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10624. * address, so for rx frames marked for rx --> tx forwarding, the
  10625. * host can determine from the HW peer ID provided as meta-data with
  10626. * the rx frame which peer the frame is supposed to be forwarded to.
  10627. * - CACHE_SET_NUM
  10628. * Bits 19:16
  10629. * Purpose: Cache Set Number for AST_INDEX
  10630. * Cache set number that should be used to cache the index based
  10631. * search results, for address and flow search.
  10632. * This value should be equal to LSB 4 bits of the hash value
  10633. * of match data, in case of search index points to an entry which
  10634. * may be used in content based search also. The value can be
  10635. * anything when the entry pointed by search index will not be
  10636. * used for content based search.
  10637. * - HTT_MSDU_IDX_VALID_MASK
  10638. * Bits 31:24
  10639. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  10640. * - ONCHIP_AST_IDX / RESERVED
  10641. * Bits 15:0
  10642. * Purpose: This field is valid only when split AST feature is enabled.
  10643. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  10644. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10645. * address, this ast_idx is used for LMAC modules for RXPCU.
  10646. * - NEXT_HOP
  10647. * Bits 16
  10648. * Purpose: Flag indicates next_hop AST entry used for WDS
  10649. * (Wireless Distribution System).
  10650. * - ONCHIP_AST_VALID
  10651. * Bits 17
  10652. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  10653. * - EXT_AST_VALID
  10654. * Bits 18
  10655. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  10656. * - EXT_AST_INDEX
  10657. * Bits 15:0
  10658. * Purpose: This field describes Extended AST index
  10659. * Valid if EXT_AST_VALID flag set
  10660. * - HTT_MSDU_IDX_VALID_MASK_EXT
  10661. * Bits 31:24
  10662. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  10663. */
  10664. /* dword 0 */
  10665. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  10666. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  10667. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  10668. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  10669. /* dword 1 */
  10670. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  10671. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  10672. /* dword 2 */
  10673. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  10674. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  10675. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  10676. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  10677. /* dword 3 */
  10678. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  10679. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  10680. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  10681. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  10682. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  10683. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  10684. /* dword 4 */
  10685. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  10686. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  10687. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  10688. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  10689. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  10690. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  10691. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  10692. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  10693. /* dword 5 */
  10694. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  10695. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  10696. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  10697. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  10698. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  10699. do { \
  10700. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  10701. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  10702. } while (0)
  10703. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  10704. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  10705. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  10706. do { \
  10707. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  10708. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  10709. } while (0)
  10710. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  10711. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  10712. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  10713. do { \
  10714. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  10715. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  10716. } while (0)
  10717. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  10718. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  10719. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  10720. do { \
  10721. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  10722. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  10723. } while (0)
  10724. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  10725. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  10726. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  10727. do { \
  10728. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  10729. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  10730. } while (0)
  10731. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  10732. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  10733. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  10734. do { \
  10735. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  10736. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  10737. } while (0)
  10738. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  10739. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  10740. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  10741. do { \
  10742. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  10743. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  10744. } while (0)
  10745. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  10746. (((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)
  10747. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  10748. do { \
  10749. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  10750. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  10751. } while (0)
  10752. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  10753. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  10754. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10755. do { \
  10756. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  10757. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  10758. } while (0)
  10759. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  10760. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  10761. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  10762. do { \
  10763. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  10764. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  10765. } while (0)
  10766. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  10767. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  10768. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  10769. do { \
  10770. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  10771. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  10772. } while (0)
  10773. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  10774. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  10775. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  10776. do { \
  10777. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  10778. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  10779. } while (0)
  10780. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  10781. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  10782. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  10783. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  10784. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  10785. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  10786. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  10787. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  10788. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  10789. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10790. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  10791. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  10792. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  10793. #define HTT_RX_PEER_MAP_V3_BYTES 32
  10794. /**
  10795. * @brief target -> host rx peer unmap V2 message definition
  10796. *
  10797. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  10798. *
  10799. * The following diagram shows the format of the rx peer unmap message sent
  10800. * from the target to the host.
  10801. *
  10802. * |31 24|23 16|15 8|7 0|
  10803. * |-----------------------------------------------------------------------|
  10804. * | SW peer ID | VDEV ID | msg type |
  10805. * |-----------------------------------------------------------------------|
  10806. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10807. * |-----------------------------------------------------------------------|
  10808. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  10809. * |-----------------------------------------------------------------------|
  10810. * | Peer Delete Duration |
  10811. * |-----------------------------------------------------------------------|
  10812. * | Reserved_0 | WDS Free Count |
  10813. * |-----------------------------------------------------------------------|
  10814. * | Reserved_1 |
  10815. * |-----------------------------------------------------------------------|
  10816. * | Reserved_2 |
  10817. * |-----------------------------------------------------------------------|
  10818. *
  10819. *
  10820. * The following field definitions describe the format of the rx peer unmap
  10821. * messages sent from the target to the host.
  10822. * - MSG_TYPE
  10823. * Bits 7:0
  10824. * Purpose: identifies this as an rx peer unmap v2 message
  10825. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  10826. * - VDEV_ID
  10827. * Bits 15:8
  10828. * Purpose: Indicates which virtual device the peer is associated
  10829. * with.
  10830. * Value: vdev ID (used in the host to look up the vdev object)
  10831. * - SW_PEER_ID
  10832. * Bits 31:16
  10833. * Purpose: The peer ID (index) that WAL is freeing
  10834. * Value: (rx) peer ID
  10835. * - MAC_ADDR_L32
  10836. * Bits 31:0
  10837. * Purpose: Identifies which peer node the peer ID is for.
  10838. * Value: lower 4 bytes of peer node's MAC address
  10839. * - MAC_ADDR_U16
  10840. * Bits 15:0
  10841. * Purpose: Identifies which peer node the peer ID is for.
  10842. * Value: upper 2 bytes of peer node's MAC address
  10843. * - NEXT_HOP
  10844. * Bits 16
  10845. * Purpose: Bit indicates next_hop AST entry used for WDS
  10846. * (Wireless Distribution System).
  10847. * - PEER_DELETE_DURATION
  10848. * Bits 31:0
  10849. * Purpose: Time taken to delete peer, in msec,
  10850. * Used for monitoring / debugging PEER delete response delay
  10851. * - PEER_WDS_FREE_COUNT
  10852. * Bits 15:0
  10853. * Purpose: Count of WDS entries deleted associated to peer deleted
  10854. */
  10855. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  10856. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  10857. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  10858. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  10859. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  10860. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  10861. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  10862. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  10863. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  10864. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  10865. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  10866. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  10867. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  10868. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  10869. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  10870. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  10871. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  10872. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  10873. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  10874. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  10875. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  10876. do { \
  10877. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  10878. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  10879. } while (0)
  10880. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  10881. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  10882. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  10883. do { \
  10884. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  10885. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  10886. } while (0)
  10887. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  10888. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  10889. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  10890. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  10891. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  10892. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  10893. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  10894. /**
  10895. * @brief target -> host rx peer mlo map message definition
  10896. *
  10897. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  10898. *
  10899. * @details
  10900. * The following diagram shows the format of the rx mlo peer map message sent
  10901. * from the target to the host. This layout assumes the target operates
  10902. * as little-endian.
  10903. *
  10904. * MCC:
  10905. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  10906. *
  10907. * WIN:
  10908. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  10909. * It will be sent on the Assoc Link.
  10910. *
  10911. * This message always contains a MLO peer ID. The main purpose of the
  10912. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  10913. * with, so that the host can use that MLO peer ID to determine which peer
  10914. * transmitted the rx frame.
  10915. *
  10916. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  10917. * |-------------------------------------------------------------------------|
  10918. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  10919. * |-------------------------------------------------------------------------|
  10920. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10921. * |-------------------------------------------------------------------------|
  10922. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  10923. * |-------------------------------------------------------------------------|
  10924. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  10925. * |-------------------------------------------------------------------------|
  10926. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  10927. * |-------------------------------------------------------------------------|
  10928. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  10929. * |-------------------------------------------------------------------------|
  10930. * |RSVD |
  10931. * |-------------------------------------------------------------------------|
  10932. * |RSVD |
  10933. * |-------------------------------------------------------------------------|
  10934. * | htt_tlv_hdr_t |
  10935. * |-------------------------------------------------------------------------|
  10936. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10937. * |-------------------------------------------------------------------------|
  10938. * | htt_tlv_hdr_t |
  10939. * |-------------------------------------------------------------------------|
  10940. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10941. * |-------------------------------------------------------------------------|
  10942. * | htt_tlv_hdr_t |
  10943. * |-------------------------------------------------------------------------|
  10944. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  10945. * |-------------------------------------------------------------------------|
  10946. *
  10947. * Where:
  10948. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  10949. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  10950. * V (valid) - 1 Bit Bit17
  10951. * CHIPID - 3 Bits
  10952. * TIDMASK - 8 Bits
  10953. * CACHE_SET_NUM - 8 Bits
  10954. *
  10955. * The following field definitions describe the format of the rx MLO peer map
  10956. * messages sent from the target to the host.
  10957. * - MSG_TYPE
  10958. * Bits 7:0
  10959. * Purpose: identifies this as an rx mlo peer map message
  10960. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  10961. *
  10962. * - MLO_PEER_ID
  10963. * Bits 23:8
  10964. * Purpose: The MLO peer ID (index).
  10965. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  10966. * Value: MLO peer ID
  10967. *
  10968. * - NUMLINK
  10969. * Bits: 26:24 (3Bits)
  10970. * Purpose: Indicate the max number of logical links supported per client.
  10971. * Value: number of logical links
  10972. *
  10973. * - PRC
  10974. * Bits: 29:27 (3Bits)
  10975. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  10976. * if there is migration of the primary chip.
  10977. * Value: Primary REO CHIPID
  10978. *
  10979. * - MAC_ADDR_L32
  10980. * Bits 31:0
  10981. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  10982. * Value: lower 4 bytes of peer node's MAC address
  10983. *
  10984. * - MAC_ADDR_U16
  10985. * Bits 15:0
  10986. * Purpose: Identifies which peer node the peer ID is for.
  10987. * Value: upper 2 bytes of peer node's MAC address
  10988. *
  10989. * - PRIMARY_TCL_AST_IDX
  10990. * Bits 15:0
  10991. * Purpose: Primary TCL AST index for this peer.
  10992. *
  10993. * - V
  10994. * 1 Bit Position 16
  10995. * Purpose: If the ast idx is valid.
  10996. *
  10997. * - CHIPID
  10998. * Bits 19:17
  10999. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11000. *
  11001. * - TIDMASK
  11002. * Bits 27:20
  11003. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11004. *
  11005. * - CACHE_SET_NUM
  11006. * Bits 31:28
  11007. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11008. * Cache set number that should be used to cache the index based
  11009. * search results, for address and flow search.
  11010. * This value should be equal to LSB four bits of the hash value
  11011. * of match data, in case of search index points to an entry which
  11012. * may be used in content based search also. The value can be
  11013. * anything when the entry pointed by search index will not be
  11014. * used for content based search.
  11015. *
  11016. * - htt_tlv_hdr_t
  11017. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11018. *
  11019. * Bits 11:0
  11020. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11021. *
  11022. * Bits 23:12
  11023. * Purpose: Length, Length of the value that follows the header
  11024. *
  11025. * Bits 31:28
  11026. * Purpose: Reserved.
  11027. *
  11028. *
  11029. * - SW_PEER_ID
  11030. * Bits 15:0
  11031. * Purpose: The peer ID (index) that WAL is allocating
  11032. * Value: (rx) peer ID
  11033. *
  11034. * - VDEV_ID
  11035. * Bits 23:16
  11036. * Purpose: Indicates which virtual device the peer is associated with.
  11037. * Value: vdev ID (used in the host to look up the vdev object)
  11038. *
  11039. * - CHIPID
  11040. * Bits 26:24
  11041. * Purpose: Indicates which Chip id the peer is associated with.
  11042. * Value: chip ID (Provided by Host as part of QMI exchange)
  11043. */
  11044. typedef enum {
  11045. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11046. } MLO_PEER_MAP_TLV_TAG_ID;
  11047. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11048. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11049. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11050. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11051. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11052. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11053. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11054. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11055. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11056. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11057. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11058. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11059. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11060. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11061. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11062. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11063. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11064. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11065. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11066. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11067. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11068. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11069. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11070. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11071. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11072. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11073. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11074. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11075. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11076. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11077. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11078. do { \
  11079. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11080. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11081. } while (0)
  11082. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11083. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11084. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11085. do { \
  11086. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11087. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11088. } while (0)
  11089. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11090. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11091. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11092. do { \
  11093. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11094. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11095. } while (0)
  11096. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11097. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11098. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11099. do { \
  11100. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11101. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11102. } while (0)
  11103. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11104. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11105. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11106. do { \
  11107. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11108. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11109. } while (0)
  11110. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11111. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11112. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11113. do { \
  11114. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11115. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11116. } while (0)
  11117. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11118. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11119. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11120. do { \
  11121. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11122. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11123. } while (0)
  11124. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11125. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11126. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11127. do { \
  11128. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11129. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11130. } while (0)
  11131. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11132. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11133. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11134. do { \
  11135. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11136. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11137. } while (0)
  11138. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11139. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11140. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11141. do { \
  11142. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11143. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11144. } while (0)
  11145. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11146. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11147. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11148. do { \
  11149. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11150. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11151. } while (0)
  11152. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11153. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11154. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11155. do { \
  11156. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11157. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11158. } while (0)
  11159. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11160. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11161. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11162. do { \
  11163. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11164. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11165. } while (0)
  11166. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11167. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11168. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11169. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11170. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11171. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11172. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11173. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11174. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11175. *
  11176. * The following diagram shows the format of the rx mlo peer unmap message sent
  11177. * from the target to the host.
  11178. *
  11179. * |31 24|23 16|15 8|7 0|
  11180. * |-----------------------------------------------------------------------|
  11181. * | RSVD_24_31 | MLO peer ID | msg type |
  11182. * |-----------------------------------------------------------------------|
  11183. */
  11184. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11185. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11186. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11187. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11188. /**
  11189. * @brief target -> host message specifying security parameters
  11190. *
  11191. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11192. *
  11193. * @details
  11194. * The following diagram shows the format of the security specification
  11195. * message sent from the target to the host.
  11196. * This security specification message tells the host whether a PN check is
  11197. * necessary on rx data frames, and if so, how large the PN counter is.
  11198. * This message also tells the host about the security processing to apply
  11199. * to defragmented rx frames - specifically, whether a Message Integrity
  11200. * Check is required, and the Michael key to use.
  11201. *
  11202. * |31 24|23 16|15|14 8|7 0|
  11203. * |-----------------------------------------------------------------------|
  11204. * | peer ID | U| security type | msg type |
  11205. * |-----------------------------------------------------------------------|
  11206. * | Michael Key K0 |
  11207. * |-----------------------------------------------------------------------|
  11208. * | Michael Key K1 |
  11209. * |-----------------------------------------------------------------------|
  11210. * | WAPI RSC Low0 |
  11211. * |-----------------------------------------------------------------------|
  11212. * | WAPI RSC Low1 |
  11213. * |-----------------------------------------------------------------------|
  11214. * | WAPI RSC Hi0 |
  11215. * |-----------------------------------------------------------------------|
  11216. * | WAPI RSC Hi1 |
  11217. * |-----------------------------------------------------------------------|
  11218. *
  11219. * The following field definitions describe the format of the security
  11220. * indication message sent from the target to the host.
  11221. * - MSG_TYPE
  11222. * Bits 7:0
  11223. * Purpose: identifies this as a security specification message
  11224. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11225. * - SEC_TYPE
  11226. * Bits 14:8
  11227. * Purpose: specifies which type of security applies to the peer
  11228. * Value: htt_sec_type enum value
  11229. * - UNICAST
  11230. * Bit 15
  11231. * Purpose: whether this security is applied to unicast or multicast data
  11232. * Value: 1 -> unicast, 0 -> multicast
  11233. * - PEER_ID
  11234. * Bits 31:16
  11235. * Purpose: The ID number for the peer the security specification is for
  11236. * Value: peer ID
  11237. * - MICHAEL_KEY_K0
  11238. * Bits 31:0
  11239. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11240. * Value: Michael Key K0 (if security type is TKIP)
  11241. * - MICHAEL_KEY_K1
  11242. * Bits 31:0
  11243. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11244. * Value: Michael Key K1 (if security type is TKIP)
  11245. * - WAPI_RSC_LOW0
  11246. * Bits 31:0
  11247. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11248. * Value: WAPI RSC Low0 (if security type is WAPI)
  11249. * - WAPI_RSC_LOW1
  11250. * Bits 31:0
  11251. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11252. * Value: WAPI RSC Low1 (if security type is WAPI)
  11253. * - WAPI_RSC_HI0
  11254. * Bits 31:0
  11255. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11256. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11257. * - WAPI_RSC_HI1
  11258. * Bits 31:0
  11259. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11260. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11261. */
  11262. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11263. #define HTT_SEC_IND_SEC_TYPE_S 8
  11264. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11265. #define HTT_SEC_IND_UNICAST_S 15
  11266. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11267. #define HTT_SEC_IND_PEER_ID_S 16
  11268. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11269. do { \
  11270. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11271. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11272. } while (0)
  11273. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11274. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11275. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11276. do { \
  11277. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  11278. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  11279. } while (0)
  11280. #define HTT_SEC_IND_UNICAST_GET(word) \
  11281. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  11282. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  11283. do { \
  11284. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  11285. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  11286. } while (0)
  11287. #define HTT_SEC_IND_PEER_ID_GET(word) \
  11288. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  11289. #define HTT_SEC_IND_BYTES 28
  11290. /**
  11291. * @brief target -> host rx ADDBA / DELBA message definitions
  11292. *
  11293. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  11294. *
  11295. * @details
  11296. * The following diagram shows the format of the rx ADDBA message sent
  11297. * from the target to the host:
  11298. *
  11299. * |31 20|19 16|15 8|7 0|
  11300. * |---------------------------------------------------------------------|
  11301. * | peer ID | TID | window size | msg type |
  11302. * |---------------------------------------------------------------------|
  11303. *
  11304. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  11305. *
  11306. * The following diagram shows the format of the rx DELBA message sent
  11307. * from the target to the host:
  11308. *
  11309. * |31 20|19 16|15 10|9 8|7 0|
  11310. * |---------------------------------------------------------------------|
  11311. * | peer ID | TID | window size | IR| msg type |
  11312. * |---------------------------------------------------------------------|
  11313. *
  11314. * The following field definitions describe the format of the rx ADDBA
  11315. * and DELBA messages sent from the target to the host.
  11316. * - MSG_TYPE
  11317. * Bits 7:0
  11318. * Purpose: identifies this as an rx ADDBA or DELBA message
  11319. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  11320. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  11321. * - IR (initiator / recipient)
  11322. * Bits 9:8 (DELBA only)
  11323. * Purpose: specify whether the DELBA handshake was initiated by the
  11324. * local STA/AP, or by the peer STA/AP
  11325. * Value:
  11326. * 0 - unspecified
  11327. * 1 - initiator (a.k.a. originator)
  11328. * 2 - recipient (a.k.a. responder)
  11329. * 3 - unused / reserved
  11330. * - WIN_SIZE
  11331. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  11332. * Purpose: Specifies the length of the block ack window (max = 64).
  11333. * Value:
  11334. * block ack window length specified by the received ADDBA/DELBA
  11335. * management message.
  11336. * - TID
  11337. * Bits 19:16
  11338. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  11339. * Value:
  11340. * TID specified by the received ADDBA or DELBA management message.
  11341. * - PEER_ID
  11342. * Bits 31:20
  11343. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  11344. * Value:
  11345. * ID (hash value) used by the host for fast, direct lookup of
  11346. * host SW peer info, including rx reorder states.
  11347. */
  11348. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  11349. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  11350. #define HTT_RX_ADDBA_TID_M 0xf0000
  11351. #define HTT_RX_ADDBA_TID_S 16
  11352. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  11353. #define HTT_RX_ADDBA_PEER_ID_S 20
  11354. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  11355. do { \
  11356. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  11357. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  11358. } while (0)
  11359. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  11360. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  11361. #define HTT_RX_ADDBA_TID_SET(word, value) \
  11362. do { \
  11363. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  11364. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  11365. } while (0)
  11366. #define HTT_RX_ADDBA_TID_GET(word) \
  11367. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  11368. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  11369. do { \
  11370. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  11371. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  11372. } while (0)
  11373. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  11374. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  11375. #define HTT_RX_ADDBA_BYTES 4
  11376. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  11377. #define HTT_RX_DELBA_INITIATOR_S 8
  11378. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  11379. #define HTT_RX_DELBA_WIN_SIZE_S 10
  11380. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  11381. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  11382. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  11383. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  11384. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  11385. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  11386. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  11387. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  11388. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  11389. do { \
  11390. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  11391. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  11392. } while (0)
  11393. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  11394. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  11395. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  11396. do { \
  11397. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  11398. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  11399. } while (0)
  11400. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  11401. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  11402. #define HTT_RX_DELBA_BYTES 4
  11403. /**
  11404. * @brief tx queue group information element definition
  11405. *
  11406. * @details
  11407. * The following diagram shows the format of the tx queue group
  11408. * information element, which can be included in target --> host
  11409. * messages to specify the number of tx "credits" (tx descriptors
  11410. * for LL, or tx buffers for HL) available to a particular group
  11411. * of host-side tx queues, and which host-side tx queues belong to
  11412. * the group.
  11413. *
  11414. * |31|30 24|23 16|15|14|13 0|
  11415. * |------------------------------------------------------------------------|
  11416. * | X| reserved | tx queue grp ID | A| S| credit count |
  11417. * |------------------------------------------------------------------------|
  11418. * | vdev ID mask | AC mask |
  11419. * |------------------------------------------------------------------------|
  11420. *
  11421. * The following definitions describe the fields within the tx queue group
  11422. * information element:
  11423. * - credit_count
  11424. * Bits 13:1
  11425. * Purpose: specify how many tx credits are available to the tx queue group
  11426. * Value: An absolute or relative, positive or negative credit value
  11427. * The 'A' bit specifies whether the value is absolute or relative.
  11428. * The 'S' bit specifies whether the value is positive or negative.
  11429. * A negative value can only be relative, not absolute.
  11430. * An absolute value replaces any prior credit value the host has for
  11431. * the tx queue group in question.
  11432. * A relative value is added to the prior credit value the host has for
  11433. * the tx queue group in question.
  11434. * - sign
  11435. * Bit 14
  11436. * Purpose: specify whether the credit count is positive or negative
  11437. * Value: 0 -> positive, 1 -> negative
  11438. * - absolute
  11439. * Bit 15
  11440. * Purpose: specify whether the credit count is absolute or relative
  11441. * Value: 0 -> relative, 1 -> absolute
  11442. * - txq_group_id
  11443. * Bits 23:16
  11444. * Purpose: indicate which tx queue group's credit and/or membership are
  11445. * being specified
  11446. * Value: 0 to max_tx_queue_groups-1
  11447. * - reserved
  11448. * Bits 30:16
  11449. * Value: 0x0
  11450. * - eXtension
  11451. * Bit 31
  11452. * Purpose: specify whether another tx queue group info element follows
  11453. * Value: 0 -> no more tx queue group information elements
  11454. * 1 -> another tx queue group information element immediately follows
  11455. * - ac_mask
  11456. * Bits 15:0
  11457. * Purpose: specify which Access Categories belong to the tx queue group
  11458. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  11459. * the tx queue group.
  11460. * The AC bit-mask values are obtained by left-shifting by the
  11461. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  11462. * - vdev_id_mask
  11463. * Bits 31:16
  11464. * Purpose: specify which vdev's tx queues belong to the tx queue group
  11465. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  11466. * belong to the tx queue group.
  11467. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  11468. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  11469. */
  11470. PREPACK struct htt_txq_group {
  11471. A_UINT32
  11472. credit_count: 14,
  11473. sign: 1,
  11474. absolute: 1,
  11475. tx_queue_group_id: 8,
  11476. reserved0: 7,
  11477. extension: 1;
  11478. A_UINT32
  11479. ac_mask: 16,
  11480. vdev_id_mask: 16;
  11481. } POSTPACK;
  11482. /* first word */
  11483. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  11484. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  11485. #define HTT_TXQ_GROUP_SIGN_S 14
  11486. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  11487. #define HTT_TXQ_GROUP_ABS_S 15
  11488. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  11489. #define HTT_TXQ_GROUP_ID_S 16
  11490. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  11491. #define HTT_TXQ_GROUP_EXT_S 31
  11492. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  11493. /* second word */
  11494. #define HTT_TXQ_GROUP_AC_MASK_S 0
  11495. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  11496. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  11497. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  11498. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  11499. do { \
  11500. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  11501. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  11502. } while (0)
  11503. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  11504. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  11505. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  11506. do { \
  11507. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  11508. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  11509. } while (0)
  11510. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  11511. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  11512. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  11513. do { \
  11514. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  11515. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  11516. } while (0)
  11517. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  11518. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  11519. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  11520. do { \
  11521. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  11522. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  11523. } while (0)
  11524. #define HTT_TXQ_GROUP_ID_GET(_info) \
  11525. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  11526. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  11527. do { \
  11528. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  11529. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  11530. } while (0)
  11531. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  11532. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  11533. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  11534. do { \
  11535. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  11536. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  11537. } while (0)
  11538. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  11539. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  11540. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  11541. do { \
  11542. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  11543. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  11544. } while (0)
  11545. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  11546. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  11547. /**
  11548. * @brief target -> host TX completion indication message definition
  11549. *
  11550. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  11551. *
  11552. * @details
  11553. * The following diagram shows the format of the TX completion indication sent
  11554. * from the target to the host
  11555. *
  11556. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  11557. * |-------------------------------------------------------------------|
  11558. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  11559. * |-------------------------------------------------------------------|
  11560. * payload:| MSDU1 ID | MSDU0 ID |
  11561. * |-------------------------------------------------------------------|
  11562. * : MSDU3 ID | MSDU2 ID :
  11563. * |-------------------------------------------------------------------|
  11564. * | struct htt_tx_compl_ind_append_retries |
  11565. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11566. * | struct htt_tx_compl_ind_append_tx_tstamp |
  11567. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11568. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  11569. * |-------------------------------------------------------------------|
  11570. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  11571. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11572. * | MSDU0 tx_tsf64_low |
  11573. * |-------------------------------------------------------------------|
  11574. * | MSDU0 tx_tsf64_high |
  11575. * |-------------------------------------------------------------------|
  11576. * | MSDU1 tx_tsf64_low |
  11577. * |-------------------------------------------------------------------|
  11578. * | MSDU1 tx_tsf64_high |
  11579. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11580. * | phy_timestamp |
  11581. * |-------------------------------------------------------------------|
  11582. * | rate specs (see below) |
  11583. * |-------------------------------------------------------------------|
  11584. * | seqctrl | framectrl |
  11585. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  11586. * Where:
  11587. * A0 = append (a.k.a. append0)
  11588. * A1 = append1
  11589. * TP = MSDU tx power presence
  11590. * A2 = append2
  11591. * A3 = append3
  11592. * A4 = append4
  11593. *
  11594. * The following field definitions describe the format of the TX completion
  11595. * indication sent from the target to the host
  11596. * Header fields:
  11597. * - msg_type
  11598. * Bits 7:0
  11599. * Purpose: identifies this as HTT TX completion indication
  11600. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  11601. * - status
  11602. * Bits 10:8
  11603. * Purpose: the TX completion status of payload fragmentations descriptors
  11604. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  11605. * - tid
  11606. * Bits 14:11
  11607. * Purpose: the tid associated with those fragmentation descriptors. It is
  11608. * valid or not, depending on the tid_invalid bit.
  11609. * Value: 0 to 15
  11610. * - tid_invalid
  11611. * Bits 15:15
  11612. * Purpose: this bit indicates whether the tid field is valid or not
  11613. * Value: 0 indicates valid; 1 indicates invalid
  11614. * - num
  11615. * Bits 23:16
  11616. * Purpose: the number of payload in this indication
  11617. * Value: 1 to 255
  11618. * - append (a.k.a. append0)
  11619. * Bits 24:24
  11620. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  11621. * the number of tx retries for one MSDU at the end of this message
  11622. * Value: 0 indicates no appending; 1 indicates appending
  11623. * - append1
  11624. * Bits 25:25
  11625. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  11626. * contains the timestamp info for each TX msdu id in payload.
  11627. * The order of the timestamps matches the order of the MSDU IDs.
  11628. * Note that a big-endian host needs to account for the reordering
  11629. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11630. * conversion) when determining which tx timestamp corresponds to
  11631. * which MSDU ID.
  11632. * Value: 0 indicates no appending; 1 indicates appending
  11633. * - msdu_tx_power_presence
  11634. * Bits 26:26
  11635. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  11636. * for each MSDU referenced by the TX_COMPL_IND message.
  11637. * The tx power is reported in 0.5 dBm units.
  11638. * The order of the per-MSDU tx power reports matches the order
  11639. * of the MSDU IDs.
  11640. * Note that a big-endian host needs to account for the reordering
  11641. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  11642. * conversion) when determining which Tx Power corresponds to
  11643. * which MSDU ID.
  11644. * Value: 0 indicates MSDU tx power reports are not appended,
  11645. * 1 indicates MSDU tx power reports are appended
  11646. * - append2
  11647. * Bits 27:27
  11648. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  11649. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  11650. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  11651. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  11652. * for each MSDU, for convenience.
  11653. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  11654. * this append2 bit is set).
  11655. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  11656. * dB above the noise floor.
  11657. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  11658. * 1 indicates MSDU ACK RSSI values are appended.
  11659. * - append3
  11660. * Bits 28:28
  11661. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  11662. * contains the tx tsf info based on wlan global TSF for
  11663. * each TX msdu id in payload.
  11664. * The order of the tx tsf matches the order of the MSDU IDs.
  11665. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  11666. * values to indicate the the lower 32 bits and higher 32 bits of
  11667. * the tx tsf.
  11668. * The tx_tsf64 here represents the time MSDU was acked and the
  11669. * tx_tsf64 has microseconds units.
  11670. * Value: 0 indicates no appending; 1 indicates appending
  11671. * - append4
  11672. * Bits 29:29
  11673. * Purpose: Indicate whether data frame control fields and fields required
  11674. * for radio tap header are appended for each MSDU in TX_COMP_IND
  11675. * message. The order of the this message matches the order of
  11676. * the MSDU IDs.
  11677. * Value: 0 indicates frame control fields and fields required for
  11678. * radio tap header values are not appended,
  11679. * 1 indicates frame control fields and fields required for
  11680. * radio tap header values are appended.
  11681. * Payload fields:
  11682. * - hmsdu_id
  11683. * Bits 15:0
  11684. * Purpose: this ID is used to track the Tx buffer in host
  11685. * Value: 0 to "size of host MSDU descriptor pool - 1"
  11686. */
  11687. PREPACK struct htt_tx_data_hdr_information {
  11688. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  11689. A_UINT32 /* word 1 */
  11690. /* preamble:
  11691. * 0-OFDM,
  11692. * 1-CCk,
  11693. * 2-HT,
  11694. * 3-VHT
  11695. */
  11696. preamble: 2, /* [1:0] */
  11697. /* mcs:
  11698. * In case of HT preamble interpret
  11699. * MCS along with NSS.
  11700. * Valid values for HT are 0 to 7.
  11701. * HT mcs 0 with NSS 2 is mcs 8.
  11702. * Valid values for VHT are 0 to 9.
  11703. */
  11704. mcs: 4, /* [5:2] */
  11705. /* rate:
  11706. * This is applicable only for
  11707. * CCK and OFDM preamble type
  11708. * rate 0: OFDM 48 Mbps,
  11709. * 1: OFDM 24 Mbps,
  11710. * 2: OFDM 12 Mbps
  11711. * 3: OFDM 6 Mbps
  11712. * 4: OFDM 54 Mbps
  11713. * 5: OFDM 36 Mbps
  11714. * 6: OFDM 18 Mbps
  11715. * 7: OFDM 9 Mbps
  11716. * rate 0: CCK 11 Mbps Long
  11717. * 1: CCK 5.5 Mbps Long
  11718. * 2: CCK 2 Mbps Long
  11719. * 3: CCK 1 Mbps Long
  11720. * 4: CCK 11 Mbps Short
  11721. * 5: CCK 5.5 Mbps Short
  11722. * 6: CCK 2 Mbps Short
  11723. */
  11724. rate : 3, /* [ 8: 6] */
  11725. rssi : 8, /* [16: 9] units=dBm */
  11726. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  11727. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  11728. stbc : 1, /* [22] */
  11729. sgi : 1, /* [23] */
  11730. ldpc : 1, /* [24] */
  11731. beamformed: 1, /* [25] */
  11732. /* tx_retry_cnt:
  11733. * Indicates retry count of data tx frames provided by the host.
  11734. */
  11735. tx_retry_cnt: 6; /* [31:26] */
  11736. A_UINT32 /* word 2 */
  11737. framectrl:16, /* [15: 0] */
  11738. seqno:16; /* [31:16] */
  11739. } POSTPACK;
  11740. #define HTT_TX_COMPL_IND_STATUS_S 8
  11741. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  11742. #define HTT_TX_COMPL_IND_TID_S 11
  11743. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  11744. #define HTT_TX_COMPL_IND_TID_INV_S 15
  11745. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  11746. #define HTT_TX_COMPL_IND_NUM_S 16
  11747. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  11748. #define HTT_TX_COMPL_IND_APPEND_S 24
  11749. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  11750. #define HTT_TX_COMPL_IND_APPEND1_S 25
  11751. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  11752. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  11753. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  11754. #define HTT_TX_COMPL_IND_APPEND2_S 27
  11755. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  11756. #define HTT_TX_COMPL_IND_APPEND3_S 28
  11757. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  11758. #define HTT_TX_COMPL_IND_APPEND4_S 29
  11759. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  11760. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  11761. do { \
  11762. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  11763. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  11764. } while (0)
  11765. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  11766. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  11767. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  11768. do { \
  11769. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  11770. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  11771. } while (0)
  11772. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  11773. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  11774. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  11775. do { \
  11776. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  11777. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  11778. } while (0)
  11779. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  11780. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  11781. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  11782. do { \
  11783. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  11784. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  11785. } while (0)
  11786. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  11787. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  11788. HTT_TX_COMPL_IND_TID_INV_S)
  11789. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  11790. do { \
  11791. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  11792. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  11793. } while (0)
  11794. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  11795. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  11796. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  11797. do { \
  11798. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  11799. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  11800. } while (0)
  11801. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  11802. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  11803. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  11804. do { \
  11805. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  11806. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  11807. } while (0)
  11808. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  11809. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  11810. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  11811. do { \
  11812. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  11813. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  11814. } while (0)
  11815. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  11816. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  11817. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  11818. do { \
  11819. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  11820. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  11821. } while (0)
  11822. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  11823. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  11824. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  11825. do { \
  11826. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  11827. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  11828. } while (0)
  11829. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  11830. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  11831. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  11832. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  11833. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  11834. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  11835. #define HTT_TX_COMPL_IND_STAT_OK 0
  11836. /* DISCARD:
  11837. * current meaning:
  11838. * MSDUs were queued for transmission but filtered by HW or SW
  11839. * without any over the air attempts
  11840. * legacy meaning (HL Rome):
  11841. * MSDUs were discarded by the target FW without any over the air
  11842. * attempts due to lack of space
  11843. */
  11844. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  11845. /* NO_ACK:
  11846. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  11847. */
  11848. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  11849. /* POSTPONE:
  11850. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  11851. * be downloaded again later (in the appropriate order), when they are
  11852. * deliverable.
  11853. */
  11854. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  11855. /*
  11856. * The PEER_DEL tx completion status is used for HL cases
  11857. * where the peer the frame is for has been deleted.
  11858. * The host has already discarded its copy of the frame, but
  11859. * it still needs the tx completion to restore its credit.
  11860. */
  11861. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  11862. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  11863. #define HTT_TX_COMPL_IND_STAT_DROP 5
  11864. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  11865. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  11866. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  11867. PREPACK struct htt_tx_compl_ind_base {
  11868. A_UINT32 hdr;
  11869. A_UINT16 payload[1/*or more*/];
  11870. } POSTPACK;
  11871. PREPACK struct htt_tx_compl_ind_append_retries {
  11872. A_UINT16 msdu_id;
  11873. A_UINT8 tx_retries;
  11874. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  11875. 0: this is the last append_retries struct */
  11876. } POSTPACK;
  11877. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  11878. A_UINT32 timestamp[1/*or more*/];
  11879. } POSTPACK;
  11880. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  11881. A_UINT32 tx_tsf64_low;
  11882. A_UINT32 tx_tsf64_high;
  11883. } POSTPACK;
  11884. /* htt_tx_data_hdr_information payload extension fields: */
  11885. /* DWORD zero */
  11886. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  11887. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  11888. /* DWORD one */
  11889. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  11890. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  11891. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  11892. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  11893. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  11894. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  11895. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  11896. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  11897. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  11898. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  11899. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  11900. #define HTT_FW_TX_DATA_HDR_BW_S 19
  11901. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  11902. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  11903. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  11904. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  11905. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  11906. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  11907. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  11908. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  11909. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  11910. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  11911. /* DWORD two */
  11912. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  11913. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  11914. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  11915. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  11916. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  11917. do { \
  11918. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  11919. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  11920. } while (0)
  11921. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  11922. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  11923. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  11924. do { \
  11925. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  11926. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  11927. } while (0)
  11928. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  11929. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  11930. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  11931. do { \
  11932. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  11933. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  11934. } while (0)
  11935. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  11936. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  11937. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  11938. do { \
  11939. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  11940. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  11941. } while (0)
  11942. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  11943. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  11944. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  11945. do { \
  11946. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  11947. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  11948. } while (0)
  11949. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  11950. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  11951. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  11952. do { \
  11953. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  11954. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  11955. } while (0)
  11956. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  11957. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  11958. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  11959. do { \
  11960. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  11961. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  11962. } while (0)
  11963. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  11964. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  11965. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  11966. do { \
  11967. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  11968. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  11969. } while (0)
  11970. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  11971. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  11972. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  11973. do { \
  11974. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  11975. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  11976. } while (0)
  11977. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  11978. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  11979. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  11980. do { \
  11981. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  11982. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  11983. } while (0)
  11984. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  11985. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  11986. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  11987. do { \
  11988. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  11989. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  11990. } while (0)
  11991. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  11992. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  11993. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  11994. do { \
  11995. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  11996. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  11997. } while (0)
  11998. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  11999. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12000. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12001. do { \
  12002. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12003. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12004. } while (0)
  12005. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12006. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12007. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12008. do { \
  12009. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12010. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12011. } while (0)
  12012. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12013. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12014. /**
  12015. * @brief target -> host rate-control update indication message
  12016. *
  12017. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12018. *
  12019. * @details
  12020. * The following diagram shows the format of the RC Update message
  12021. * sent from the target to the host, while processing the tx-completion
  12022. * of a transmitted PPDU.
  12023. *
  12024. * |31 24|23 16|15 8|7 0|
  12025. * |-------------------------------------------------------------|
  12026. * | peer ID | vdev ID | msg_type |
  12027. * |-------------------------------------------------------------|
  12028. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12029. * |-------------------------------------------------------------|
  12030. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12031. * |-------------------------------------------------------------|
  12032. * | : |
  12033. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12034. * | : |
  12035. * |-------------------------------------------------------------|
  12036. * | : |
  12037. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12038. * | : |
  12039. * |-------------------------------------------------------------|
  12040. * : :
  12041. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12042. *
  12043. */
  12044. typedef struct {
  12045. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12046. A_UINT32 rate_code_flags;
  12047. A_UINT32 flags; /* Encodes information such as excessive
  12048. retransmission, aggregate, some info
  12049. from .11 frame control,
  12050. STBC, LDPC, (SGI and Tx Chain Mask
  12051. are encoded in ptx_rc->flags field),
  12052. AMPDU truncation (BT/time based etc.),
  12053. RTS/CTS attempt */
  12054. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12055. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12056. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12057. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12058. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12059. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12060. } HTT_RC_TX_DONE_PARAMS;
  12061. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12062. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12063. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12064. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12065. #define HTT_RC_UPDATE_VDEVID_S 8
  12066. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12067. #define HTT_RC_UPDATE_PEERID_S 16
  12068. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12069. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12070. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12071. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12072. do { \
  12073. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12074. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12075. } while (0)
  12076. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12077. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12078. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12079. do { \
  12080. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12081. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12082. } while (0)
  12083. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12084. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12085. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12086. do { \
  12087. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12088. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12089. } while (0)
  12090. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12091. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12092. /**
  12093. * @brief target -> host rx fragment indication message definition
  12094. *
  12095. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12096. *
  12097. * @details
  12098. * The following field definitions describe the format of the rx fragment
  12099. * indication message sent from the target to the host.
  12100. * The rx fragment indication message shares the format of the
  12101. * rx indication message, but not all fields from the rx indication message
  12102. * are relevant to the rx fragment indication message.
  12103. *
  12104. *
  12105. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12106. * |-----------+-------------------+---------------------+-------------|
  12107. * | peer ID | |FV| ext TID | msg type |
  12108. * |-------------------------------------------------------------------|
  12109. * | | flush | flush |
  12110. * | | end | start |
  12111. * | | seq num | seq num |
  12112. * |-------------------------------------------------------------------|
  12113. * | reserved | FW rx desc bytes |
  12114. * |-------------------------------------------------------------------|
  12115. * | | FW MSDU Rx |
  12116. * | | desc B0 |
  12117. * |-------------------------------------------------------------------|
  12118. * Header fields:
  12119. * - MSG_TYPE
  12120. * Bits 7:0
  12121. * Purpose: identifies this as an rx fragment indication message
  12122. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12123. * - EXT_TID
  12124. * Bits 12:8
  12125. * Purpose: identify the traffic ID of the rx data, including
  12126. * special "extended" TID values for multicast, broadcast, and
  12127. * non-QoS data frames
  12128. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12129. * - FLUSH_VALID (FV)
  12130. * Bit 13
  12131. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12132. * is valid
  12133. * Value:
  12134. * 1 -> flush IE is valid and needs to be processed
  12135. * 0 -> flush IE is not valid and should be ignored
  12136. * - PEER_ID
  12137. * Bits 31:16
  12138. * Purpose: Identify, by ID, which peer sent the rx data
  12139. * Value: ID of the peer who sent the rx data
  12140. * - FLUSH_SEQ_NUM_START
  12141. * Bits 5:0
  12142. * Purpose: Indicate the start of a series of MPDUs to flush
  12143. * Not all MPDUs within this series are necessarily valid - the host
  12144. * must check each sequence number within this range to see if the
  12145. * corresponding MPDU is actually present.
  12146. * This field is only valid if the FV bit is set.
  12147. * Value:
  12148. * The sequence number for the first MPDUs to check to flush.
  12149. * The sequence number is masked by 0x3f.
  12150. * - FLUSH_SEQ_NUM_END
  12151. * Bits 11:6
  12152. * Purpose: Indicate the end of a series of MPDUs to flush
  12153. * Value:
  12154. * The sequence number one larger than the sequence number of the
  12155. * last MPDU to check to flush.
  12156. * The sequence number is masked by 0x3f.
  12157. * Not all MPDUs within this series are necessarily valid - the host
  12158. * must check each sequence number within this range to see if the
  12159. * corresponding MPDU is actually present.
  12160. * This field is only valid if the FV bit is set.
  12161. * Rx descriptor fields:
  12162. * - FW_RX_DESC_BYTES
  12163. * Bits 15:0
  12164. * Purpose: Indicate how many bytes in the Rx indication are used for
  12165. * FW Rx descriptors
  12166. * Value: 1
  12167. */
  12168. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  12169. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  12170. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  12171. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  12172. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  12173. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  12174. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  12175. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  12176. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  12177. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  12178. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  12179. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  12180. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  12181. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  12182. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  12183. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  12184. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  12185. #define HTT_RX_FRAG_IND_BYTES \
  12186. (4 /* msg hdr */ + \
  12187. 4 /* flush spec */ + \
  12188. 4 /* (unused) FW rx desc bytes spec */ + \
  12189. 4 /* FW rx desc */)
  12190. /**
  12191. * @brief target -> host test message definition
  12192. *
  12193. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  12194. *
  12195. * @details
  12196. * The following field definitions describe the format of the test
  12197. * message sent from the target to the host.
  12198. * The message consists of a 4-octet header, followed by a variable
  12199. * number of 32-bit integer values, followed by a variable number
  12200. * of 8-bit character values.
  12201. *
  12202. * |31 16|15 8|7 0|
  12203. * |-----------------------------------------------------------|
  12204. * | num chars | num ints | msg type |
  12205. * |-----------------------------------------------------------|
  12206. * | int 0 |
  12207. * |-----------------------------------------------------------|
  12208. * | int 1 |
  12209. * |-----------------------------------------------------------|
  12210. * | ... |
  12211. * |-----------------------------------------------------------|
  12212. * | char 3 | char 2 | char 1 | char 0 |
  12213. * |-----------------------------------------------------------|
  12214. * | | | ... | char 4 |
  12215. * |-----------------------------------------------------------|
  12216. * - MSG_TYPE
  12217. * Bits 7:0
  12218. * Purpose: identifies this as a test message
  12219. * Value: HTT_MSG_TYPE_TEST
  12220. * - NUM_INTS
  12221. * Bits 15:8
  12222. * Purpose: indicate how many 32-bit integers follow the message header
  12223. * - NUM_CHARS
  12224. * Bits 31:16
  12225. * Purpose: indicate how many 8-bit charaters follow the series of integers
  12226. */
  12227. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  12228. #define HTT_RX_TEST_NUM_INTS_S 8
  12229. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  12230. #define HTT_RX_TEST_NUM_CHARS_S 16
  12231. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  12232. do { \
  12233. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  12234. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  12235. } while (0)
  12236. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  12237. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  12238. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  12239. do { \
  12240. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  12241. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  12242. } while (0)
  12243. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  12244. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  12245. /**
  12246. * @brief target -> host packet log message
  12247. *
  12248. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  12249. *
  12250. * @details
  12251. * The following field definitions describe the format of the packet log
  12252. * message sent from the target to the host.
  12253. * The message consists of a 4-octet header,followed by a variable number
  12254. * of 32-bit character values.
  12255. *
  12256. * |31 16|15 12|11 10|9 8|7 0|
  12257. * |------------------------------------------------------------------|
  12258. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  12259. * |------------------------------------------------------------------|
  12260. * | payload |
  12261. * |------------------------------------------------------------------|
  12262. * - MSG_TYPE
  12263. * Bits 7:0
  12264. * Purpose: identifies this as a pktlog message
  12265. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  12266. * - mac_id
  12267. * Bits 9:8
  12268. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  12269. * Value: 0-3
  12270. * - pdev_id
  12271. * Bits 11:10
  12272. * Purpose: pdev_id
  12273. * Value: 0-3
  12274. * 0 (for rings at SOC level),
  12275. * 1/2/3 PDEV -> 0/1/2
  12276. * - payload_size
  12277. * Bits 31:16
  12278. * Purpose: explicitly specify the payload size
  12279. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  12280. */
  12281. PREPACK struct htt_pktlog_msg {
  12282. A_UINT32 header;
  12283. A_UINT32 payload[1/* or more */];
  12284. } POSTPACK;
  12285. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  12286. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  12287. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  12288. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  12289. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  12290. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  12291. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  12292. do { \
  12293. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  12294. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  12295. } while (0)
  12296. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  12297. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  12298. HTT_T2H_PKTLOG_MAC_ID_S)
  12299. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  12300. do { \
  12301. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  12302. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  12303. } while (0)
  12304. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  12305. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  12306. HTT_T2H_PKTLOG_PDEV_ID_S)
  12307. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  12308. do { \
  12309. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  12310. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  12311. } while (0)
  12312. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  12313. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  12314. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  12315. /*
  12316. * Rx reorder statistics
  12317. * NB: all the fields must be defined in 4 octets size.
  12318. */
  12319. struct rx_reorder_stats {
  12320. /* Non QoS MPDUs received */
  12321. A_UINT32 deliver_non_qos;
  12322. /* MPDUs received in-order */
  12323. A_UINT32 deliver_in_order;
  12324. /* Flush due to reorder timer expired */
  12325. A_UINT32 deliver_flush_timeout;
  12326. /* Flush due to move out of window */
  12327. A_UINT32 deliver_flush_oow;
  12328. /* Flush due to DELBA */
  12329. A_UINT32 deliver_flush_delba;
  12330. /* MPDUs dropped due to FCS error */
  12331. A_UINT32 fcs_error;
  12332. /* MPDUs dropped due to monitor mode non-data packet */
  12333. A_UINT32 mgmt_ctrl;
  12334. /* Unicast-data MPDUs dropped due to invalid peer */
  12335. A_UINT32 invalid_peer;
  12336. /* MPDUs dropped due to duplication (non aggregation) */
  12337. A_UINT32 dup_non_aggr;
  12338. /* MPDUs dropped due to processed before */
  12339. A_UINT32 dup_past;
  12340. /* MPDUs dropped due to duplicate in reorder queue */
  12341. A_UINT32 dup_in_reorder;
  12342. /* Reorder timeout happened */
  12343. A_UINT32 reorder_timeout;
  12344. /* invalid bar ssn */
  12345. A_UINT32 invalid_bar_ssn;
  12346. /* reorder reset due to bar ssn */
  12347. A_UINT32 ssn_reset;
  12348. /* Flush due to delete peer */
  12349. A_UINT32 deliver_flush_delpeer;
  12350. /* Flush due to offload*/
  12351. A_UINT32 deliver_flush_offload;
  12352. /* Flush due to out of buffer*/
  12353. A_UINT32 deliver_flush_oob;
  12354. /* MPDUs dropped due to PN check fail */
  12355. A_UINT32 pn_fail;
  12356. /* MPDUs dropped due to unable to allocate memory */
  12357. A_UINT32 store_fail;
  12358. /* Number of times the tid pool alloc succeeded */
  12359. A_UINT32 tid_pool_alloc_succ;
  12360. /* Number of times the MPDU pool alloc succeeded */
  12361. A_UINT32 mpdu_pool_alloc_succ;
  12362. /* Number of times the MSDU pool alloc succeeded */
  12363. A_UINT32 msdu_pool_alloc_succ;
  12364. /* Number of times the tid pool alloc failed */
  12365. A_UINT32 tid_pool_alloc_fail;
  12366. /* Number of times the MPDU pool alloc failed */
  12367. A_UINT32 mpdu_pool_alloc_fail;
  12368. /* Number of times the MSDU pool alloc failed */
  12369. A_UINT32 msdu_pool_alloc_fail;
  12370. /* Number of times the tid pool freed */
  12371. A_UINT32 tid_pool_free;
  12372. /* Number of times the MPDU pool freed */
  12373. A_UINT32 mpdu_pool_free;
  12374. /* Number of times the MSDU pool freed */
  12375. A_UINT32 msdu_pool_free;
  12376. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  12377. A_UINT32 msdu_queued;
  12378. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  12379. A_UINT32 msdu_recycled;
  12380. /* Number of MPDUs with invalid peer but A2 found in AST */
  12381. A_UINT32 invalid_peer_a2_in_ast;
  12382. /* Number of MPDUs with invalid peer but A3 found in AST */
  12383. A_UINT32 invalid_peer_a3_in_ast;
  12384. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  12385. A_UINT32 invalid_peer_bmc_mpdus;
  12386. /* Number of MSDUs with err attention word */
  12387. A_UINT32 rxdesc_err_att;
  12388. /* Number of MSDUs with flag of peer_idx_invalid */
  12389. A_UINT32 rxdesc_err_peer_idx_inv;
  12390. /* Number of MSDUs with flag of peer_idx_timeout */
  12391. A_UINT32 rxdesc_err_peer_idx_to;
  12392. /* Number of MSDUs with flag of overflow */
  12393. A_UINT32 rxdesc_err_ov;
  12394. /* Number of MSDUs with flag of msdu_length_err */
  12395. A_UINT32 rxdesc_err_msdu_len;
  12396. /* Number of MSDUs with flag of mpdu_length_err */
  12397. A_UINT32 rxdesc_err_mpdu_len;
  12398. /* Number of MSDUs with flag of tkip_mic_err */
  12399. A_UINT32 rxdesc_err_tkip_mic;
  12400. /* Number of MSDUs with flag of decrypt_err */
  12401. A_UINT32 rxdesc_err_decrypt;
  12402. /* Number of MSDUs with flag of fcs_err */
  12403. A_UINT32 rxdesc_err_fcs;
  12404. /* Number of Unicast (bc_mc bit is not set in attention word)
  12405. * frames with invalid peer handler
  12406. */
  12407. A_UINT32 rxdesc_uc_msdus_inv_peer;
  12408. /* Number of unicast frame directly (direct bit is set in attention word)
  12409. * to DUT with invalid peer handler
  12410. */
  12411. A_UINT32 rxdesc_direct_msdus_inv_peer;
  12412. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  12413. * frames with invalid peer handler
  12414. */
  12415. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  12416. /* Number of MSDUs dropped due to no first MSDU flag */
  12417. A_UINT32 rxdesc_no_1st_msdu;
  12418. /* Number of MSDUs droped due to ring overflow */
  12419. A_UINT32 msdu_drop_ring_ov;
  12420. /* Number of MSDUs dropped due to FC mismatch */
  12421. A_UINT32 msdu_drop_fc_mismatch;
  12422. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  12423. A_UINT32 msdu_drop_mgmt_remote_ring;
  12424. /* Number of MSDUs dropped due to errors not reported in attention word */
  12425. A_UINT32 msdu_drop_misc;
  12426. /* Number of MSDUs go to offload before reorder */
  12427. A_UINT32 offload_msdu_wal;
  12428. /* Number of data frame dropped by offload after reorder */
  12429. A_UINT32 offload_msdu_reorder;
  12430. /* Number of MPDUs with sequence number in the past and within the BA window */
  12431. A_UINT32 dup_past_within_window;
  12432. /* Number of MPDUs with sequence number in the past and outside the BA window */
  12433. A_UINT32 dup_past_outside_window;
  12434. /* Number of MSDUs with decrypt/MIC error */
  12435. A_UINT32 rxdesc_err_decrypt_mic;
  12436. /* Number of data MSDUs received on both local and remote rings */
  12437. A_UINT32 data_msdus_on_both_rings;
  12438. /* MPDUs never filled */
  12439. A_UINT32 holes_not_filled;
  12440. };
  12441. /*
  12442. * Rx Remote buffer statistics
  12443. * NB: all the fields must be defined in 4 octets size.
  12444. */
  12445. struct rx_remote_buffer_mgmt_stats {
  12446. /* Total number of MSDUs reaped for Rx processing */
  12447. A_UINT32 remote_reaped;
  12448. /* MSDUs recycled within firmware */
  12449. A_UINT32 remote_recycled;
  12450. /* MSDUs stored by Data Rx */
  12451. A_UINT32 data_rx_msdus_stored;
  12452. /* Number of HTT indications from WAL Rx MSDU */
  12453. A_UINT32 wal_rx_ind;
  12454. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  12455. A_UINT32 wal_rx_ind_unconsumed;
  12456. /* Number of HTT indications from Data Rx MSDU */
  12457. A_UINT32 data_rx_ind;
  12458. /* Number of unconsumed HTT indications from Data Rx MSDU */
  12459. A_UINT32 data_rx_ind_unconsumed;
  12460. /* Number of HTT indications from ATHBUF */
  12461. A_UINT32 athbuf_rx_ind;
  12462. /* Number of remote buffers requested for refill */
  12463. A_UINT32 refill_buf_req;
  12464. /* Number of remote buffers filled by the host */
  12465. A_UINT32 refill_buf_rsp;
  12466. /* Number of times MAC hw_index = f/w write_index */
  12467. A_INT32 mac_no_bufs;
  12468. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  12469. A_INT32 fw_indices_equal;
  12470. /* Number of times f/w finds no buffers to post */
  12471. A_INT32 host_no_bufs;
  12472. };
  12473. /*
  12474. * TXBF MU/SU packets and NDPA statistics
  12475. * NB: all the fields must be defined in 4 octets size.
  12476. */
  12477. struct rx_txbf_musu_ndpa_pkts_stats {
  12478. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  12479. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  12480. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  12481. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  12482. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  12483. A_UINT32 reserved[3]; /* must be set to 0x0 */
  12484. };
  12485. /*
  12486. * htt_dbg_stats_status -
  12487. * present - The requested stats have been delivered in full.
  12488. * This indicates that either the stats information was contained
  12489. * in its entirety within this message, or else this message
  12490. * completes the delivery of the requested stats info that was
  12491. * partially delivered through earlier STATS_CONF messages.
  12492. * partial - The requested stats have been delivered in part.
  12493. * One or more subsequent STATS_CONF messages with the same
  12494. * cookie value will be sent to deliver the remainder of the
  12495. * information.
  12496. * error - The requested stats could not be delivered, for example due
  12497. * to a shortage of memory to construct a message holding the
  12498. * requested stats.
  12499. * invalid - The requested stat type is either not recognized, or the
  12500. * target is configured to not gather the stats type in question.
  12501. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12502. * series_done - This special value indicates that no further stats info
  12503. * elements are present within a series of stats info elems
  12504. * (within a stats upload confirmation message).
  12505. */
  12506. enum htt_dbg_stats_status {
  12507. HTT_DBG_STATS_STATUS_PRESENT = 0,
  12508. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  12509. HTT_DBG_STATS_STATUS_ERROR = 2,
  12510. HTT_DBG_STATS_STATUS_INVALID = 3,
  12511. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  12512. };
  12513. /**
  12514. * @brief target -> host statistics upload
  12515. *
  12516. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  12517. *
  12518. * @details
  12519. * The following field definitions describe the format of the HTT target
  12520. * to host stats upload confirmation message.
  12521. * The message contains a cookie echoed from the HTT host->target stats
  12522. * upload request, which identifies which request the confirmation is
  12523. * for, and a series of tag-length-value stats information elements.
  12524. * The tag-length header for each stats info element also includes a
  12525. * status field, to indicate whether the request for the stat type in
  12526. * question was fully met, partially met, unable to be met, or invalid
  12527. * (if the stat type in question is disabled in the target).
  12528. * A special value of all 1's in this status field is used to indicate
  12529. * the end of the series of stats info elements.
  12530. *
  12531. *
  12532. * |31 16|15 8|7 5|4 0|
  12533. * |------------------------------------------------------------|
  12534. * | reserved | msg type |
  12535. * |------------------------------------------------------------|
  12536. * | cookie LSBs |
  12537. * |------------------------------------------------------------|
  12538. * | cookie MSBs |
  12539. * |------------------------------------------------------------|
  12540. * | stats entry length | reserved | S |stat type|
  12541. * |------------------------------------------------------------|
  12542. * | |
  12543. * | type-specific stats info |
  12544. * | |
  12545. * |------------------------------------------------------------|
  12546. * | stats entry length | reserved | S |stat type|
  12547. * |------------------------------------------------------------|
  12548. * | |
  12549. * | type-specific stats info |
  12550. * | |
  12551. * |------------------------------------------------------------|
  12552. * | n/a | reserved | 111 | n/a |
  12553. * |------------------------------------------------------------|
  12554. * Header fields:
  12555. * - MSG_TYPE
  12556. * Bits 7:0
  12557. * Purpose: identifies this is a statistics upload confirmation message
  12558. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  12559. * - COOKIE_LSBS
  12560. * Bits 31:0
  12561. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12562. * message with its preceding host->target stats request message.
  12563. * Value: LSBs of the opaque cookie specified by the host-side requestor
  12564. * - COOKIE_MSBS
  12565. * Bits 31:0
  12566. * Purpose: Provide a mechanism to match a target->host stats confirmation
  12567. * message with its preceding host->target stats request message.
  12568. * Value: MSBs of the opaque cookie specified by the host-side requestor
  12569. *
  12570. * Stats Information Element tag-length header fields:
  12571. * - STAT_TYPE
  12572. * Bits 4:0
  12573. * Purpose: identifies the type of statistics info held in the
  12574. * following information element
  12575. * Value: htt_dbg_stats_type
  12576. * - STATUS
  12577. * Bits 7:5
  12578. * Purpose: indicate whether the requested stats are present
  12579. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  12580. * the completion of the stats entry series
  12581. * - LENGTH
  12582. * Bits 31:16
  12583. * Purpose: indicate the stats information size
  12584. * Value: This field specifies the number of bytes of stats information
  12585. * that follows the element tag-length header.
  12586. * It is expected but not required that this length is a multiple of
  12587. * 4 bytes. Even if the length is not an integer multiple of 4, the
  12588. * subsequent stats entry header will begin on a 4-byte aligned
  12589. * boundary.
  12590. */
  12591. #define HTT_T2H_STATS_COOKIE_SIZE 8
  12592. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  12593. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  12594. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  12595. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  12596. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  12597. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  12598. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  12599. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  12600. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  12601. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  12602. do { \
  12603. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  12604. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  12605. } while (0)
  12606. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  12607. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  12608. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  12609. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  12610. do { \
  12611. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  12612. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  12613. } while (0)
  12614. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  12615. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  12616. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  12617. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  12618. do { \
  12619. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  12620. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  12621. } while (0)
  12622. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  12623. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  12624. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  12625. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  12626. #define HTT_MAX_AGGR 64
  12627. #define HTT_HL_MAX_AGGR 18
  12628. /**
  12629. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  12630. *
  12631. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  12632. *
  12633. * @details
  12634. * The following field definitions describe the format of the HTT host
  12635. * to target frag_desc/msdu_ext bank configuration message.
  12636. * The message contains the based address and the min and max id of the
  12637. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  12638. * MSDU_EXT/FRAG_DESC.
  12639. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  12640. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  12641. * the hardware does the mapping/translation.
  12642. *
  12643. * Total banks that can be configured is configured to 16.
  12644. *
  12645. * This should be called before any TX has be initiated by the HTT
  12646. *
  12647. * |31 16|15 8|7 5|4 0|
  12648. * |------------------------------------------------------------|
  12649. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  12650. * |------------------------------------------------------------|
  12651. * | BANK0_BASE_ADDRESS (bits 31:0) |
  12652. #if HTT_PADDR64
  12653. * | BANK0_BASE_ADDRESS (bits 63:32) |
  12654. #endif
  12655. * |------------------------------------------------------------|
  12656. * | ... |
  12657. * |------------------------------------------------------------|
  12658. * | BANK15_BASE_ADDRESS (bits 31:0) |
  12659. #if HTT_PADDR64
  12660. * | BANK15_BASE_ADDRESS (bits 63:32) |
  12661. #endif
  12662. * |------------------------------------------------------------|
  12663. * | BANK0_MAX_ID | BANK0_MIN_ID |
  12664. * |------------------------------------------------------------|
  12665. * | ... |
  12666. * |------------------------------------------------------------|
  12667. * | BANK15_MAX_ID | BANK15_MIN_ID |
  12668. * |------------------------------------------------------------|
  12669. * Header fields:
  12670. * - MSG_TYPE
  12671. * Bits 7:0
  12672. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  12673. * for systems with 64-bit format for bus addresses:
  12674. * - BANKx_BASE_ADDRESS_LO
  12675. * Bits 31:0
  12676. * Purpose: Provide a mechanism to specify the base address of the
  12677. * MSDU_EXT bank physical/bus address.
  12678. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  12679. * - BANKx_BASE_ADDRESS_HI
  12680. * Bits 31:0
  12681. * Purpose: Provide a mechanism to specify the base address of the
  12682. * MSDU_EXT bank physical/bus address.
  12683. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  12684. * for systems with 32-bit format for bus addresses:
  12685. * - BANKx_BASE_ADDRESS
  12686. * Bits 31:0
  12687. * Purpose: Provide a mechanism to specify the base address of the
  12688. * MSDU_EXT bank physical/bus address.
  12689. * Value: MSDU_EXT bank physical / bus address
  12690. * - BANKx_MIN_ID
  12691. * Bits 15:0
  12692. * Purpose: Provide a mechanism to specify the min index that needs to
  12693. * mapped.
  12694. * - BANKx_MAX_ID
  12695. * Bits 31:16
  12696. * Purpose: Provide a mechanism to specify the max index that needs to
  12697. * mapped.
  12698. *
  12699. */
  12700. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  12701. * safe value.
  12702. * @note MAX supported banks is 16.
  12703. */
  12704. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  12705. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  12706. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  12707. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  12708. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  12709. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  12710. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  12711. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  12712. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  12713. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  12714. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  12715. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  12716. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  12717. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  12718. do { \
  12719. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  12720. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  12721. } while (0)
  12722. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  12723. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  12724. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  12725. do { \
  12726. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  12727. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  12728. } while (0)
  12729. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  12730. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  12731. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  12732. do { \
  12733. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  12734. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  12735. } while (0)
  12736. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  12737. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  12738. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  12739. do { \
  12740. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  12741. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  12742. } while (0)
  12743. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  12744. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  12745. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  12746. do { \
  12747. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  12748. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  12749. } while (0)
  12750. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  12751. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  12752. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  12753. do { \
  12754. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  12755. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  12756. } while (0)
  12757. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  12758. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  12759. /*
  12760. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  12761. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  12762. * addresses are stored in a XXX-bit field.
  12763. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  12764. * htt_tx_frag_desc64_bank_cfg_t structs.
  12765. */
  12766. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  12767. _paddr_bits_, \
  12768. _paddr__bank_base_address_) \
  12769. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  12770. /** word 0 \
  12771. * msg_type: 8, \
  12772. * pdev_id: 2, \
  12773. * swap: 1, \
  12774. * reserved0: 5, \
  12775. * num_banks: 8, \
  12776. * desc_size: 8; \
  12777. */ \
  12778. A_UINT32 word0; \
  12779. /* \
  12780. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  12781. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  12782. * the second A_UINT32). \
  12783. */ \
  12784. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12785. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  12786. } POSTPACK
  12787. /* define htt_tx_frag_desc32_bank_cfg_t */
  12788. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  12789. /* define htt_tx_frag_desc64_bank_cfg_t */
  12790. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  12791. /*
  12792. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  12793. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  12794. */
  12795. #if HTT_PADDR64
  12796. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  12797. #else
  12798. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  12799. #endif
  12800. /**
  12801. * @brief target -> host HTT TX Credit total count update message definition
  12802. *
  12803. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  12804. *
  12805. *|31 16|15|14 9| 8 |7 0 |
  12806. *|---------------------+--+----------+-------+----------|
  12807. *|cur htt credit delta | Q| reserved | sign | msg type |
  12808. *|------------------------------------------------------|
  12809. *
  12810. * Header fields:
  12811. * - MSG_TYPE
  12812. * Bits 7:0
  12813. * Purpose: identifies this as a htt tx credit delta update message
  12814. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  12815. * - SIGN
  12816. * Bits 8
  12817. * identifies whether credit delta is positive or negative
  12818. * Value:
  12819. * - 0x0: credit delta is positive, rebalance in some buffers
  12820. * - 0x1: credit delta is negative, rebalance out some buffers
  12821. * - reserved
  12822. * Bits 14:9
  12823. * Value: 0x0
  12824. * - TXQ_GRP
  12825. * Bit 15
  12826. * Purpose: indicates whether any tx queue group information elements
  12827. * are appended to the tx credit update message
  12828. * Value: 0 -> no tx queue group information element is present
  12829. * 1 -> a tx queue group information element immediately follows
  12830. * - DELTA_COUNT
  12831. * Bits 31:16
  12832. * Purpose: Specify current htt credit delta absolute count
  12833. */
  12834. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  12835. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  12836. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  12837. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  12838. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  12839. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  12840. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  12841. do { \
  12842. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  12843. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  12844. } while (0)
  12845. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  12846. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  12847. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  12848. do { \
  12849. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  12850. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  12851. } while (0)
  12852. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  12853. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  12854. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  12855. do { \
  12856. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  12857. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  12858. } while (0)
  12859. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  12860. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  12861. #define HTT_TX_CREDIT_MSG_BYTES 4
  12862. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  12863. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  12864. /**
  12865. * @brief HTT WDI_IPA Operation Response Message
  12866. *
  12867. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  12868. *
  12869. * @details
  12870. * HTT WDI_IPA Operation Response message is sent by target
  12871. * to host confirming suspend or resume operation.
  12872. * |31 24|23 16|15 8|7 0|
  12873. * |----------------+----------------+----------------+----------------|
  12874. * | op_code | Rsvd | msg_type |
  12875. * |-------------------------------------------------------------------|
  12876. * | Rsvd | Response len |
  12877. * |-------------------------------------------------------------------|
  12878. * | |
  12879. * | Response-type specific info |
  12880. * | |
  12881. * | |
  12882. * |-------------------------------------------------------------------|
  12883. * Header fields:
  12884. * - MSG_TYPE
  12885. * Bits 7:0
  12886. * Purpose: Identifies this as WDI_IPA Operation Response message
  12887. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  12888. * - OP_CODE
  12889. * Bits 31:16
  12890. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  12891. * value: = enum htt_wdi_ipa_op_code
  12892. * - RSP_LEN
  12893. * Bits 16:0
  12894. * Purpose: length for the response-type specific info
  12895. * value: = length in bytes for response-type specific info
  12896. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  12897. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  12898. */
  12899. PREPACK struct htt_wdi_ipa_op_response_t
  12900. {
  12901. /* DWORD 0: flags and meta-data */
  12902. A_UINT32
  12903. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  12904. reserved1: 8,
  12905. op_code: 16;
  12906. A_UINT32
  12907. rsp_len: 16,
  12908. reserved2: 16;
  12909. } POSTPACK;
  12910. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  12911. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  12912. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  12913. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  12914. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  12915. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  12916. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  12917. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  12918. do { \
  12919. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  12920. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  12921. } while (0)
  12922. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  12923. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  12924. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  12925. do { \
  12926. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  12927. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  12928. } while (0)
  12929. enum htt_phy_mode {
  12930. htt_phy_mode_11a = 0,
  12931. htt_phy_mode_11g = 1,
  12932. htt_phy_mode_11b = 2,
  12933. htt_phy_mode_11g_only = 3,
  12934. htt_phy_mode_11na_ht20 = 4,
  12935. htt_phy_mode_11ng_ht20 = 5,
  12936. htt_phy_mode_11na_ht40 = 6,
  12937. htt_phy_mode_11ng_ht40 = 7,
  12938. htt_phy_mode_11ac_vht20 = 8,
  12939. htt_phy_mode_11ac_vht40 = 9,
  12940. htt_phy_mode_11ac_vht80 = 10,
  12941. htt_phy_mode_11ac_vht20_2g = 11,
  12942. htt_phy_mode_11ac_vht40_2g = 12,
  12943. htt_phy_mode_11ac_vht80_2g = 13,
  12944. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  12945. htt_phy_mode_11ac_vht160 = 15,
  12946. htt_phy_mode_max,
  12947. };
  12948. /**
  12949. * @brief target -> host HTT channel change indication
  12950. *
  12951. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  12952. *
  12953. * @details
  12954. * Specify when a channel change occurs.
  12955. * This allows the host to precisely determine which rx frames arrived
  12956. * on the old channel and which rx frames arrived on the new channel.
  12957. *
  12958. *|31 |7 0 |
  12959. *|-------------------------------------------+----------|
  12960. *| reserved | msg type |
  12961. *|------------------------------------------------------|
  12962. *| primary_chan_center_freq_mhz |
  12963. *|------------------------------------------------------|
  12964. *| contiguous_chan1_center_freq_mhz |
  12965. *|------------------------------------------------------|
  12966. *| contiguous_chan2_center_freq_mhz |
  12967. *|------------------------------------------------------|
  12968. *| phy_mode |
  12969. *|------------------------------------------------------|
  12970. *
  12971. * Header fields:
  12972. * - MSG_TYPE
  12973. * Bits 7:0
  12974. * Purpose: identifies this as a htt channel change indication message
  12975. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  12976. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  12977. * Bits 31:0
  12978. * Purpose: identify the (center of the) new 20 MHz primary channel
  12979. * Value: center frequency of the 20 MHz primary channel, in MHz units
  12980. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  12981. * Bits 31:0
  12982. * Purpose: identify the (center of the) contiguous frequency range
  12983. * comprising the new channel.
  12984. * For example, if the new channel is a 80 MHz channel extending
  12985. * 60 MHz beyond the primary channel, this field would be 30 larger
  12986. * than the primary channel center frequency field.
  12987. * Value: center frequency of the contiguous frequency range comprising
  12988. * the full channel in MHz units
  12989. * (80+80 channels also use the CONTIG_CHAN2 field)
  12990. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  12991. * Bits 31:0
  12992. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  12993. * within a VHT 80+80 channel.
  12994. * This field is only relevant for VHT 80+80 channels.
  12995. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  12996. * channel (arbitrary value for cases besides VHT 80+80)
  12997. * - PHY_MODE
  12998. * Bits 31:0
  12999. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13000. * and band
  13001. * Value: htt_phy_mode enum value
  13002. */
  13003. PREPACK struct htt_chan_change_t
  13004. {
  13005. /* DWORD 0: flags and meta-data */
  13006. A_UINT32
  13007. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13008. reserved1: 24;
  13009. A_UINT32 primary_chan_center_freq_mhz;
  13010. A_UINT32 contig_chan1_center_freq_mhz;
  13011. A_UINT32 contig_chan2_center_freq_mhz;
  13012. A_UINT32 phy_mode;
  13013. } POSTPACK;
  13014. /*
  13015. * Due to historical / backwards-compatibility reasons, maintain the
  13016. * below htt_chan_change_msg struct definition, which needs to be
  13017. * consistent with the above htt_chan_change_t struct definition
  13018. * (aside from the htt_chan_change_t definition including the msg_type
  13019. * dword within the message, and the htt_chan_change_msg only containing
  13020. * the payload of the message that follows the msg_type dword).
  13021. */
  13022. PREPACK struct htt_chan_change_msg {
  13023. A_UINT32 chan_mhz; /* frequency in mhz */
  13024. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13025. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13026. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13027. } POSTPACK;
  13028. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13029. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13030. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13031. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13032. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13033. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13034. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13035. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13036. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13037. do { \
  13038. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13039. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13040. } while (0)
  13041. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13042. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13043. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13044. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13045. do { \
  13046. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13047. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13048. } while (0)
  13049. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13050. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13051. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13052. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13053. do { \
  13054. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13055. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13056. } while (0)
  13057. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13058. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13059. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13060. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13061. do { \
  13062. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13063. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13064. } while (0)
  13065. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13066. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13067. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13068. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13069. /**
  13070. * @brief rx offload packet error message
  13071. *
  13072. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13073. *
  13074. * @details
  13075. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13076. * of target payload like mic err.
  13077. *
  13078. * |31 24|23 16|15 8|7 0|
  13079. * |----------------+----------------+----------------+----------------|
  13080. * | tid | vdev_id | msg_sub_type | msg_type |
  13081. * |-------------------------------------------------------------------|
  13082. * : (sub-type dependent content) :
  13083. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13084. * Header fields:
  13085. * - msg_type
  13086. * Bits 7:0
  13087. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13088. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13089. * - msg_sub_type
  13090. * Bits 15:8
  13091. * Purpose: Identifies which type of rx error is reported by this message
  13092. * value: htt_rx_ofld_pkt_err_type
  13093. * - vdev_id
  13094. * Bits 23:16
  13095. * Purpose: Identifies which vdev received the erroneous rx frame
  13096. * value:
  13097. * - tid
  13098. * Bits 31:24
  13099. * Purpose: Identifies the traffic type of the rx frame
  13100. * value:
  13101. *
  13102. * - The payload fields used if the sub-type == MIC error are shown below.
  13103. * Note - MIC err is per MSDU, while PN is per MPDU.
  13104. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13105. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13106. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13107. * instead of sending separate HTT messages for each wrong MSDU within
  13108. * the MPDU.
  13109. *
  13110. * |31 24|23 16|15 8|7 0|
  13111. * |----------------+----------------+----------------+----------------|
  13112. * | Rsvd | key_id | peer_id |
  13113. * |-------------------------------------------------------------------|
  13114. * | receiver MAC addr 31:0 |
  13115. * |-------------------------------------------------------------------|
  13116. * | Rsvd | receiver MAC addr 47:32 |
  13117. * |-------------------------------------------------------------------|
  13118. * | transmitter MAC addr 31:0 |
  13119. * |-------------------------------------------------------------------|
  13120. * | Rsvd | transmitter MAC addr 47:32 |
  13121. * |-------------------------------------------------------------------|
  13122. * | PN 31:0 |
  13123. * |-------------------------------------------------------------------|
  13124. * | Rsvd | PN 47:32 |
  13125. * |-------------------------------------------------------------------|
  13126. * - peer_id
  13127. * Bits 15:0
  13128. * Purpose: identifies which peer is frame is from
  13129. * value:
  13130. * - key_id
  13131. * Bits 23:16
  13132. * Purpose: identifies key_id of rx frame
  13133. * value:
  13134. * - RA_31_0 (receiver MAC addr 31:0)
  13135. * Bits 31:0
  13136. * Purpose: identifies by MAC address which vdev received the frame
  13137. * value: MAC address lower 4 bytes
  13138. * - RA_47_32 (receiver MAC addr 47:32)
  13139. * Bits 15:0
  13140. * Purpose: identifies by MAC address which vdev received the frame
  13141. * value: MAC address upper 2 bytes
  13142. * - TA_31_0 (transmitter MAC addr 31:0)
  13143. * Bits 31:0
  13144. * Purpose: identifies by MAC address which peer transmitted the frame
  13145. * value: MAC address lower 4 bytes
  13146. * - TA_47_32 (transmitter MAC addr 47:32)
  13147. * Bits 15:0
  13148. * Purpose: identifies by MAC address which peer transmitted the frame
  13149. * value: MAC address upper 2 bytes
  13150. * - PN_31_0
  13151. * Bits 31:0
  13152. * Purpose: Identifies pn of rx frame
  13153. * value: PN lower 4 bytes
  13154. * - PN_47_32
  13155. * Bits 15:0
  13156. * Purpose: Identifies pn of rx frame
  13157. * value:
  13158. * TKIP or CCMP: PN upper 2 bytes
  13159. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  13160. */
  13161. enum htt_rx_ofld_pkt_err_type {
  13162. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  13163. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  13164. };
  13165. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  13166. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  13167. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  13168. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  13169. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  13170. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  13171. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  13172. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  13173. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  13174. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  13175. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  13176. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  13177. do { \
  13178. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  13179. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  13180. } while (0)
  13181. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  13182. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  13183. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  13184. do { \
  13185. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  13186. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  13187. } while (0)
  13188. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  13189. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  13190. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  13191. do { \
  13192. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  13193. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  13194. } while (0)
  13195. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  13196. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  13197. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  13198. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  13199. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  13200. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  13201. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  13202. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  13203. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  13204. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  13205. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  13206. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  13207. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  13208. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  13209. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  13210. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  13211. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  13212. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  13213. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  13214. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  13215. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  13216. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  13217. do { \
  13218. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  13219. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  13220. } while (0)
  13221. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  13222. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  13223. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  13224. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  13225. do { \
  13226. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  13227. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  13228. } while (0)
  13229. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  13230. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  13231. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  13232. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  13233. do { \
  13234. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  13235. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  13236. } while (0)
  13237. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  13238. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  13239. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  13240. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  13241. do { \
  13242. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  13243. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  13244. } while (0)
  13245. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  13246. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  13247. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  13248. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  13249. do { \
  13250. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  13251. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  13252. } while (0)
  13253. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  13254. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  13255. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  13256. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  13257. do { \
  13258. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  13259. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  13260. } while (0)
  13261. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  13262. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  13263. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  13264. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  13265. do { \
  13266. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  13267. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  13268. } while (0)
  13269. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  13270. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  13271. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  13272. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  13273. do { \
  13274. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  13275. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  13276. } while (0)
  13277. /**
  13278. * @brief target -> host peer rate report message
  13279. *
  13280. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  13281. *
  13282. * @details
  13283. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  13284. * justified rate of all the peers.
  13285. *
  13286. * |31 24|23 16|15 8|7 0|
  13287. * |----------------+----------------+----------------+----------------|
  13288. * | peer_count | | msg_type |
  13289. * |-------------------------------------------------------------------|
  13290. * : Payload (variant number of peer rate report) :
  13291. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13292. * Header fields:
  13293. * - msg_type
  13294. * Bits 7:0
  13295. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  13296. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  13297. * - reserved
  13298. * Bits 15:8
  13299. * Purpose:
  13300. * value:
  13301. * - peer_count
  13302. * Bits 31:16
  13303. * Purpose: Specify how many peer rate report elements are present in the payload.
  13304. * value:
  13305. *
  13306. * Payload:
  13307. * There are variant number of peer rate report follow the first 32 bits.
  13308. * The peer rate report is defined as follows.
  13309. *
  13310. * |31 20|19 16|15 0|
  13311. * |-----------------------+---------+---------------------------------|-
  13312. * | reserved | phy | peer_id | \
  13313. * |-------------------------------------------------------------------| -> report #0
  13314. * | rate | /
  13315. * |-----------------------+---------+---------------------------------|-
  13316. * | reserved | phy | peer_id | \
  13317. * |-------------------------------------------------------------------| -> report #1
  13318. * | rate | /
  13319. * |-----------------------+---------+---------------------------------|-
  13320. * | reserved | phy | peer_id | \
  13321. * |-------------------------------------------------------------------| -> report #2
  13322. * | rate | /
  13323. * |-------------------------------------------------------------------|-
  13324. * : :
  13325. * : :
  13326. * : :
  13327. * :-------------------------------------------------------------------:
  13328. *
  13329. * - peer_id
  13330. * Bits 15:0
  13331. * Purpose: identify the peer
  13332. * value:
  13333. * - phy
  13334. * Bits 19:16
  13335. * Purpose: identify which phy is in use
  13336. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  13337. * Please see enum htt_peer_report_phy_type for detail.
  13338. * - reserved
  13339. * Bits 31:20
  13340. * Purpose:
  13341. * value:
  13342. * - rate
  13343. * Bits 31:0
  13344. * Purpose: represent the justified rate of the peer specified by peer_id
  13345. * value:
  13346. */
  13347. enum htt_peer_rate_report_phy_type {
  13348. HTT_PEER_RATE_REPORT_11B = 0,
  13349. HTT_PEER_RATE_REPORT_11A_G,
  13350. HTT_PEER_RATE_REPORT_11N,
  13351. HTT_PEER_RATE_REPORT_11AC,
  13352. };
  13353. #define HTT_PEER_RATE_REPORT_SIZE 8
  13354. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  13355. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  13356. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  13357. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  13358. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  13359. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  13360. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  13361. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  13362. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  13363. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  13364. do { \
  13365. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  13366. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  13367. } while (0)
  13368. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  13369. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  13370. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  13371. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  13372. do { \
  13373. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  13374. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  13375. } while (0)
  13376. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  13377. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  13378. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  13379. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  13380. do { \
  13381. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  13382. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  13383. } while (0)
  13384. /**
  13385. * @brief target -> host flow pool map message
  13386. *
  13387. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  13388. *
  13389. * @details
  13390. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  13391. * a flow of descriptors.
  13392. *
  13393. * This message is in TLV format and indicates the parameters to be setup a
  13394. * flow in the host. Each entry indicates that a particular flow ID is ready to
  13395. * receive descriptors from a specified pool.
  13396. *
  13397. * The message would appear as follows:
  13398. *
  13399. * |31 24|23 16|15 8|7 0|
  13400. * |----------------+----------------+----------------+----------------|
  13401. * header | reserved | num_flows | msg_type |
  13402. * |-------------------------------------------------------------------|
  13403. * | |
  13404. * : payload :
  13405. * | |
  13406. * |-------------------------------------------------------------------|
  13407. *
  13408. * The header field is one DWORD long and is interpreted as follows:
  13409. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  13410. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  13411. * this message
  13412. * b'16-31 - reserved: These bits are reserved for future use
  13413. *
  13414. * Payload:
  13415. * The payload would contain multiple objects of the following structure. Each
  13416. * object represents a flow.
  13417. *
  13418. * |31 24|23 16|15 8|7 0|
  13419. * |----------------+----------------+----------------+----------------|
  13420. * header | reserved | num_flows | msg_type |
  13421. * |-------------------------------------------------------------------|
  13422. * payload0| flow_type |
  13423. * |-------------------------------------------------------------------|
  13424. * | flow_id |
  13425. * |-------------------------------------------------------------------|
  13426. * | reserved0 | flow_pool_id |
  13427. * |-------------------------------------------------------------------|
  13428. * | reserved1 | flow_pool_size |
  13429. * |-------------------------------------------------------------------|
  13430. * | reserved2 |
  13431. * |-------------------------------------------------------------------|
  13432. * payload1| flow_type |
  13433. * |-------------------------------------------------------------------|
  13434. * | flow_id |
  13435. * |-------------------------------------------------------------------|
  13436. * | reserved0 | flow_pool_id |
  13437. * |-------------------------------------------------------------------|
  13438. * | reserved1 | flow_pool_size |
  13439. * |-------------------------------------------------------------------|
  13440. * | reserved2 |
  13441. * |-------------------------------------------------------------------|
  13442. * | . |
  13443. * | . |
  13444. * | . |
  13445. * |-------------------------------------------------------------------|
  13446. *
  13447. * Each payload is 5 DWORDS long and is interpreted as follows:
  13448. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  13449. * this flow is associated. It can be VDEV, peer,
  13450. * or tid (AC). Based on enum htt_flow_type.
  13451. *
  13452. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13453. * object. For flow_type vdev it is set to the
  13454. * vdevid, for peer it is peerid and for tid, it is
  13455. * tid_num.
  13456. *
  13457. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  13458. * in the host for this flow
  13459. * b'16:31 - reserved0: This field in reserved for the future. In case
  13460. * we have a hierarchical implementation (HCM) of
  13461. * pools, it can be used to indicate the ID of the
  13462. * parent-pool.
  13463. *
  13464. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  13465. * Descriptors for this flow will be
  13466. * allocated from this pool in the host.
  13467. * b'16:31 - reserved1: This field in reserved for the future. In case
  13468. * we have a hierarchical implementation of pools,
  13469. * it can be used to indicate the max number of
  13470. * descriptors in the pool. The b'0:15 can be used
  13471. * to indicate min number of descriptors in the
  13472. * HCM scheme.
  13473. *
  13474. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  13475. * we have a hierarchical implementation of pools,
  13476. * b'0:15 can be used to indicate the
  13477. * priority-based borrowing (PBB) threshold of
  13478. * the flow's pool. The b'16:31 are still left
  13479. * reserved.
  13480. */
  13481. enum htt_flow_type {
  13482. FLOW_TYPE_VDEV = 0,
  13483. /* Insert new flow types above this line */
  13484. };
  13485. PREPACK struct htt_flow_pool_map_payload_t {
  13486. A_UINT32 flow_type;
  13487. A_UINT32 flow_id;
  13488. A_UINT32 flow_pool_id:16,
  13489. reserved0:16;
  13490. A_UINT32 flow_pool_size:16,
  13491. reserved1:16;
  13492. A_UINT32 reserved2;
  13493. } POSTPACK;
  13494. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  13495. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  13496. (sizeof(struct htt_flow_pool_map_payload_t))
  13497. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  13498. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  13499. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  13500. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  13501. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  13502. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  13503. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  13504. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  13505. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  13506. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  13507. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  13508. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  13509. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  13510. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  13511. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  13512. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  13513. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  13514. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  13515. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  13516. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  13517. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  13518. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  13519. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  13520. do { \
  13521. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  13522. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  13523. } while (0)
  13524. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  13525. do { \
  13526. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  13527. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  13528. } while (0)
  13529. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  13530. do { \
  13531. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  13532. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  13533. } while (0)
  13534. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  13535. do { \
  13536. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  13537. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  13538. } while (0)
  13539. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  13540. do { \
  13541. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  13542. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  13543. } while (0)
  13544. /**
  13545. * @brief target -> host flow pool unmap message
  13546. *
  13547. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  13548. *
  13549. * @details
  13550. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  13551. * down a flow of descriptors.
  13552. * This message indicates that for the flow (whose ID is provided) is wanting
  13553. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  13554. * pool of descriptors from where descriptors are being allocated for this
  13555. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  13556. * be unmapped by the host.
  13557. *
  13558. * The message would appear as follows:
  13559. *
  13560. * |31 24|23 16|15 8|7 0|
  13561. * |----------------+----------------+----------------+----------------|
  13562. * | reserved0 | msg_type |
  13563. * |-------------------------------------------------------------------|
  13564. * | flow_type |
  13565. * |-------------------------------------------------------------------|
  13566. * | flow_id |
  13567. * |-------------------------------------------------------------------|
  13568. * | reserved1 | flow_pool_id |
  13569. * |-------------------------------------------------------------------|
  13570. *
  13571. * The message is interpreted as follows:
  13572. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  13573. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  13574. * b'8:31 - reserved0: Reserved for future use
  13575. *
  13576. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  13577. * this flow is associated. It can be VDEV, peer,
  13578. * or tid (AC). Based on enum htt_flow_type.
  13579. *
  13580. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13581. * object. For flow_type vdev it is set to the
  13582. * vdevid, for peer it is peerid and for tid, it is
  13583. * tid_num.
  13584. *
  13585. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  13586. * used in the host for this flow
  13587. * b'16:31 - reserved0: This field in reserved for the future.
  13588. *
  13589. */
  13590. PREPACK struct htt_flow_pool_unmap_t {
  13591. A_UINT32 msg_type:8,
  13592. reserved0:24;
  13593. A_UINT32 flow_type;
  13594. A_UINT32 flow_id;
  13595. A_UINT32 flow_pool_id:16,
  13596. reserved1:16;
  13597. } POSTPACK;
  13598. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  13599. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  13600. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  13601. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  13602. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  13603. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  13604. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  13605. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  13606. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  13607. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  13608. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  13609. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  13610. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  13611. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  13612. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  13613. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  13614. do { \
  13615. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  13616. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  13617. } while (0)
  13618. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  13619. do { \
  13620. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  13621. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  13622. } while (0)
  13623. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  13624. do { \
  13625. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  13626. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  13627. } while (0)
  13628. /**
  13629. * @brief target -> host SRING setup done message
  13630. *
  13631. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  13632. *
  13633. * @details
  13634. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  13635. * SRNG ring setup is done
  13636. *
  13637. * This message indicates whether the last setup operation is successful.
  13638. * It will be sent to host when host set respose_required bit in
  13639. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  13640. * The message would appear as follows:
  13641. *
  13642. * |31 24|23 16|15 8|7 0|
  13643. * |--------------- +----------------+----------------+----------------|
  13644. * | setup_status | ring_id | pdev_id | msg_type |
  13645. * |-------------------------------------------------------------------|
  13646. *
  13647. * The message is interpreted as follows:
  13648. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  13649. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  13650. * b'8:15 - pdev_id:
  13651. * 0 (for rings at SOC/UMAC level),
  13652. * 1/2/3 mac id (for rings at LMAC level)
  13653. * b'16:23 - ring_id: Identify the ring which is set up
  13654. * More details can be got from enum htt_srng_ring_id
  13655. * b'24:31 - setup_status: Indicate status of setup operation
  13656. * Refer to htt_ring_setup_status
  13657. */
  13658. PREPACK struct htt_sring_setup_done_t {
  13659. A_UINT32 msg_type: 8,
  13660. pdev_id: 8,
  13661. ring_id: 8,
  13662. setup_status: 8;
  13663. } POSTPACK;
  13664. enum htt_ring_setup_status {
  13665. htt_ring_setup_status_ok = 0,
  13666. htt_ring_setup_status_error,
  13667. };
  13668. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  13669. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  13670. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  13671. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  13672. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  13673. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  13674. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  13675. do { \
  13676. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  13677. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  13678. } while (0)
  13679. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  13680. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  13681. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  13682. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  13683. HTT_SRING_SETUP_DONE_RING_ID_S)
  13684. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  13685. do { \
  13686. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  13687. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  13688. } while (0)
  13689. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  13690. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  13691. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  13692. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  13693. HTT_SRING_SETUP_DONE_STATUS_S)
  13694. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  13695. do { \
  13696. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  13697. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  13698. } while (0)
  13699. /**
  13700. * @brief target -> flow map flow info
  13701. *
  13702. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  13703. *
  13704. * @details
  13705. * HTT TX map flow entry with tqm flow pointer
  13706. * Sent from firmware to host to add tqm flow pointer in corresponding
  13707. * flow search entry. Flow metadata is replayed back to host as part of this
  13708. * struct to enable host to find the specific flow search entry
  13709. *
  13710. * The message would appear as follows:
  13711. *
  13712. * |31 28|27 18|17 14|13 8|7 0|
  13713. * |-------+------------------------------------------+----------------|
  13714. * | rsvd0 | fse_hsh_idx | msg_type |
  13715. * |-------------------------------------------------------------------|
  13716. * | rsvd1 | tid | peer_id |
  13717. * |-------------------------------------------------------------------|
  13718. * | tqm_flow_pntr_lo |
  13719. * |-------------------------------------------------------------------|
  13720. * | tqm_flow_pntr_hi |
  13721. * |-------------------------------------------------------------------|
  13722. * | fse_meta_data |
  13723. * |-------------------------------------------------------------------|
  13724. *
  13725. * The message is interpreted as follows:
  13726. *
  13727. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  13728. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  13729. *
  13730. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  13731. * for this flow entry
  13732. *
  13733. * dword0 - b'28:31 - rsvd0: Reserved for future use
  13734. *
  13735. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  13736. *
  13737. * dword1 - b'14:17 - tid
  13738. *
  13739. * dword1 - b'18:31 - rsvd1: Reserved for future use
  13740. *
  13741. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  13742. *
  13743. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  13744. *
  13745. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  13746. * given by host
  13747. */
  13748. PREPACK struct htt_tx_map_flow_info {
  13749. A_UINT32
  13750. msg_type: 8,
  13751. fse_hsh_idx: 20,
  13752. rsvd0: 4;
  13753. A_UINT32
  13754. peer_id: 14,
  13755. tid: 4,
  13756. rsvd1: 14;
  13757. A_UINT32 tqm_flow_pntr_lo;
  13758. A_UINT32 tqm_flow_pntr_hi;
  13759. struct htt_tx_flow_metadata fse_meta_data;
  13760. } POSTPACK;
  13761. /* DWORD 0 */
  13762. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  13763. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  13764. /* DWORD 1 */
  13765. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  13766. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  13767. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  13768. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  13769. /* DWORD 0 */
  13770. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  13771. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  13772. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  13773. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  13774. do { \
  13775. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  13776. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  13777. } while (0)
  13778. /* DWORD 1 */
  13779. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  13780. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  13781. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  13782. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  13783. do { \
  13784. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  13785. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  13786. } while (0)
  13787. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  13788. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  13789. HTT_TX_MAP_FLOW_INFO_TID_S)
  13790. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  13791. do { \
  13792. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  13793. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  13794. } while (0)
  13795. /*
  13796. * htt_dbg_ext_stats_status -
  13797. * present - The requested stats have been delivered in full.
  13798. * This indicates that either the stats information was contained
  13799. * in its entirety within this message, or else this message
  13800. * completes the delivery of the requested stats info that was
  13801. * partially delivered through earlier STATS_CONF messages.
  13802. * partial - The requested stats have been delivered in part.
  13803. * One or more subsequent STATS_CONF messages with the same
  13804. * cookie value will be sent to deliver the remainder of the
  13805. * information.
  13806. * error - The requested stats could not be delivered, for example due
  13807. * to a shortage of memory to construct a message holding the
  13808. * requested stats.
  13809. * invalid - The requested stat type is either not recognized, or the
  13810. * target is configured to not gather the stats type in question.
  13811. */
  13812. enum htt_dbg_ext_stats_status {
  13813. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  13814. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  13815. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  13816. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  13817. };
  13818. /**
  13819. * @brief target -> host ppdu stats upload
  13820. *
  13821. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  13822. *
  13823. * @details
  13824. * The following field definitions describe the format of the HTT target
  13825. * to host ppdu stats indication message.
  13826. *
  13827. *
  13828. * |31 16|15 12|11 10|9 8|7 0 |
  13829. * |----------------------------------------------------------------------|
  13830. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  13831. * |----------------------------------------------------------------------|
  13832. * | ppdu_id |
  13833. * |----------------------------------------------------------------------|
  13834. * | Timestamp in us |
  13835. * |----------------------------------------------------------------------|
  13836. * | reserved |
  13837. * |----------------------------------------------------------------------|
  13838. * | type-specific stats info |
  13839. * | (see htt_ppdu_stats.h) |
  13840. * |----------------------------------------------------------------------|
  13841. * Header fields:
  13842. * - MSG_TYPE
  13843. * Bits 7:0
  13844. * Purpose: Identifies this is a PPDU STATS indication
  13845. * message.
  13846. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  13847. * - mac_id
  13848. * Bits 9:8
  13849. * Purpose: mac_id of this ppdu_id
  13850. * Value: 0-3
  13851. * - pdev_id
  13852. * Bits 11:10
  13853. * Purpose: pdev_id of this ppdu_id
  13854. * Value: 0-3
  13855. * 0 (for rings at SOC level),
  13856. * 1/2/3 PDEV -> 0/1/2
  13857. * - payload_size
  13858. * Bits 31:16
  13859. * Purpose: total tlv size
  13860. * Value: payload_size in bytes
  13861. */
  13862. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  13863. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  13864. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  13865. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  13866. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  13867. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  13868. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  13869. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  13870. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  13871. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  13872. do { \
  13873. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  13874. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  13875. } while (0)
  13876. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  13877. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  13878. HTT_T2H_PPDU_STATS_MAC_ID_S)
  13879. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  13880. do { \
  13881. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  13882. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  13883. } while (0)
  13884. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  13885. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  13886. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  13887. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  13888. do { \
  13889. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  13890. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  13891. } while (0)
  13892. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  13893. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  13894. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  13895. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  13896. do { \
  13897. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  13898. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  13899. } while (0)
  13900. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  13901. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  13902. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  13903. /* htt_t2h_ppdu_stats_ind_hdr_t
  13904. * This struct contains the fields within the header of the
  13905. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  13906. * stats info.
  13907. * This struct assumes little-endian layout, and thus is only
  13908. * suitable for use within processors known to be little-endian
  13909. * (such as the target).
  13910. * In contrast, the above macros provide endian-portable methods
  13911. * to get and set the bitfields within this PPDU_STATS_IND header.
  13912. */
  13913. typedef struct {
  13914. A_UINT32 msg_type: 8, /* bits 7:0 */
  13915. mac_id: 2, /* bits 9:8 */
  13916. pdev_id: 2, /* bits 11:10 */
  13917. reserved1: 4, /* bits 15:12 */
  13918. payload_size: 16; /* bits 31:16 */
  13919. A_UINT32 ppdu_id;
  13920. A_UINT32 timestamp_us;
  13921. A_UINT32 reserved2;
  13922. } htt_t2h_ppdu_stats_ind_hdr_t;
  13923. /**
  13924. * @brief target -> host extended statistics upload
  13925. *
  13926. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  13927. *
  13928. * @details
  13929. * The following field definitions describe the format of the HTT target
  13930. * to host stats upload confirmation message.
  13931. * The message contains a cookie echoed from the HTT host->target stats
  13932. * upload request, which identifies which request the confirmation is
  13933. * for, and a single stats can span over multiple HTT stats indication
  13934. * due to the HTT message size limitation so every HTT ext stats indication
  13935. * will have tag-length-value stats information elements.
  13936. * The tag-length header for each HTT stats IND message also includes a
  13937. * status field, to indicate whether the request for the stat type in
  13938. * question was fully met, partially met, unable to be met, or invalid
  13939. * (if the stat type in question is disabled in the target).
  13940. * A Done bit 1's indicate the end of the of stats info elements.
  13941. *
  13942. *
  13943. * |31 16|15 12|11|10 8|7 5|4 0|
  13944. * |--------------------------------------------------------------|
  13945. * | reserved | msg type |
  13946. * |--------------------------------------------------------------|
  13947. * | cookie LSBs |
  13948. * |--------------------------------------------------------------|
  13949. * | cookie MSBs |
  13950. * |--------------------------------------------------------------|
  13951. * | stats entry length | rsvd | D| S | stat type |
  13952. * |--------------------------------------------------------------|
  13953. * | type-specific stats info |
  13954. * | (see htt_stats.h) |
  13955. * |--------------------------------------------------------------|
  13956. * Header fields:
  13957. * - MSG_TYPE
  13958. * Bits 7:0
  13959. * Purpose: Identifies this is a extended statistics upload confirmation
  13960. * message.
  13961. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  13962. * - COOKIE_LSBS
  13963. * Bits 31:0
  13964. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13965. * message with its preceding host->target stats request message.
  13966. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13967. * - COOKIE_MSBS
  13968. * Bits 31:0
  13969. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13970. * message with its preceding host->target stats request message.
  13971. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13972. *
  13973. * Stats Information Element tag-length header fields:
  13974. * - STAT_TYPE
  13975. * Bits 7:0
  13976. * Purpose: identifies the type of statistics info held in the
  13977. * following information element
  13978. * Value: htt_dbg_ext_stats_type
  13979. * - STATUS
  13980. * Bits 10:8
  13981. * Purpose: indicate whether the requested stats are present
  13982. * Value: htt_dbg_ext_stats_status
  13983. * - DONE
  13984. * Bits 11
  13985. * Purpose:
  13986. * Indicates the completion of the stats entry, this will be the last
  13987. * stats conf HTT segment for the requested stats type.
  13988. * Value:
  13989. * 0 -> the stats retrieval is ongoing
  13990. * 1 -> the stats retrieval is complete
  13991. * - LENGTH
  13992. * Bits 31:16
  13993. * Purpose: indicate the stats information size
  13994. * Value: This field specifies the number of bytes of stats information
  13995. * that follows the element tag-length header.
  13996. * It is expected but not required that this length is a multiple of
  13997. * 4 bytes.
  13998. */
  13999. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14000. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14001. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14002. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14003. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14004. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14005. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14006. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14007. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14008. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14009. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14010. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14011. do { \
  14012. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14013. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14014. } while (0)
  14015. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14016. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14017. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14018. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14019. do { \
  14020. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14021. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14022. } while (0)
  14023. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14024. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14025. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14026. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14027. do { \
  14028. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14029. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14030. } while (0)
  14031. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14032. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14033. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14034. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14035. do { \
  14036. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14037. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14038. } while (0)
  14039. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14040. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14041. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14042. typedef enum {
  14043. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14044. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14045. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14046. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14047. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14048. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14049. /* Reserved from 128 - 255 for target internal use.*/
  14050. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14051. } HTT_PEER_TYPE;
  14052. /** macro to convert MAC address from char array to HTT word format */
  14053. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14054. (phtt_mac_addr)->mac_addr31to0 = \
  14055. (((c_macaddr)[0] << 0) | \
  14056. ((c_macaddr)[1] << 8) | \
  14057. ((c_macaddr)[2] << 16) | \
  14058. ((c_macaddr)[3] << 24)); \
  14059. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14060. } while (0)
  14061. /**
  14062. * @brief target -> host monitor mac header indication message
  14063. *
  14064. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14065. *
  14066. * @details
  14067. * The following diagram shows the format of the monitor mac header message
  14068. * sent from the target to the host.
  14069. * This message is primarily sent when promiscuous rx mode is enabled.
  14070. * One message is sent per rx PPDU.
  14071. *
  14072. * |31 24|23 16|15 8|7 0|
  14073. * |-------------------------------------------------------------|
  14074. * | peer_id | reserved0 | msg_type |
  14075. * |-------------------------------------------------------------|
  14076. * | reserved1 | num_mpdu |
  14077. * |-------------------------------------------------------------|
  14078. * | struct hw_rx_desc |
  14079. * | (see wal_rx_desc.h) |
  14080. * |-------------------------------------------------------------|
  14081. * | struct ieee80211_frame_addr4 |
  14082. * | (see ieee80211_defs.h) |
  14083. * |-------------------------------------------------------------|
  14084. * | struct ieee80211_frame_addr4 |
  14085. * | (see ieee80211_defs.h) |
  14086. * |-------------------------------------------------------------|
  14087. * | ...... |
  14088. * |-------------------------------------------------------------|
  14089. *
  14090. * Header fields:
  14091. * - msg_type
  14092. * Bits 7:0
  14093. * Purpose: Identifies this is a monitor mac header indication message.
  14094. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14095. * - peer_id
  14096. * Bits 31:16
  14097. * Purpose: Software peer id given by host during association,
  14098. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14099. * for rx PPDUs received from unassociated peers.
  14100. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14101. * - num_mpdu
  14102. * Bits 15:0
  14103. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14104. * delivered within the message.
  14105. * Value: 1 to 32
  14106. * num_mpdu is limited to a maximum value of 32, due to buffer
  14107. * size limits. For PPDUs with more than 32 MPDUs, only the
  14108. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14109. * the PPDU will be provided.
  14110. */
  14111. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  14112. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  14113. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  14114. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  14115. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  14116. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  14117. do { \
  14118. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  14119. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  14120. } while (0)
  14121. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  14122. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  14123. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  14124. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  14125. do { \
  14126. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  14127. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  14128. } while (0)
  14129. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  14130. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  14131. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  14132. /**
  14133. * @brief target -> host flow pool resize Message
  14134. *
  14135. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  14136. *
  14137. * @details
  14138. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  14139. * the flow pool associated with the specified ID is resized
  14140. *
  14141. * The message would appear as follows:
  14142. *
  14143. * |31 16|15 8|7 0|
  14144. * |---------------------------------+----------------+----------------|
  14145. * | reserved0 | Msg type |
  14146. * |-------------------------------------------------------------------|
  14147. * | flow pool new size | flow pool ID |
  14148. * |-------------------------------------------------------------------|
  14149. *
  14150. * The message is interpreted as follows:
  14151. * b'0:7 - msg_type: This will be set to 0x21
  14152. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  14153. *
  14154. * b'0:15 - flow pool ID: Existing flow pool ID
  14155. *
  14156. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  14157. *
  14158. */
  14159. PREPACK struct htt_flow_pool_resize_t {
  14160. A_UINT32 msg_type:8,
  14161. reserved0:24;
  14162. A_UINT32 flow_pool_id:16,
  14163. flow_pool_new_size:16;
  14164. } POSTPACK;
  14165. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  14166. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  14167. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  14168. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  14169. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  14170. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  14171. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  14172. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  14173. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  14174. do { \
  14175. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  14176. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  14177. } while (0)
  14178. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  14179. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  14180. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  14181. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  14182. do { \
  14183. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  14184. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  14185. } while (0)
  14186. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  14187. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  14188. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  14189. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  14190. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  14191. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  14192. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  14193. /*
  14194. * The read and write indices point to the data within the host buffer.
  14195. * Because the first 4 bytes of the host buffer is used for the read index and
  14196. * the next 4 bytes for the write index, the data itself starts at offset 8.
  14197. * The read index and write index are the byte offsets from the base of the
  14198. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  14199. * Refer the ASCII text picture below.
  14200. */
  14201. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  14202. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  14203. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  14204. /*
  14205. ***************************************************************************
  14206. *
  14207. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14208. *
  14209. ***************************************************************************
  14210. *
  14211. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  14212. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  14213. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  14214. * written into the Host memory region mentioned below.
  14215. *
  14216. * Read index is updated by the Host. At any point of time, the read index will
  14217. * indicate the index that will next be read by the Host. The read index is
  14218. * in units of bytes offset from the base of the meta-data buffer.
  14219. *
  14220. * Write index is updated by the FW. At any point of time, the write index will
  14221. * indicate from where the FW can start writing any new data. The write index is
  14222. * in units of bytes offset from the base of the meta-data buffer.
  14223. *
  14224. * If the Host is not fast enough in reading the CFR data, any new capture data
  14225. * would be dropped if there is no space left to write the new captures.
  14226. *
  14227. * The last 4 bytes of the memory region will have the magic pattern
  14228. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  14229. * not overrun the host buffer.
  14230. *
  14231. * ,--------------------. read and write indices store the
  14232. * | | byte offset from the base of the
  14233. * | ,--------+--------. meta-data buffer to the next
  14234. * | | | | location within the data buffer
  14235. * | | v v that will be read / written
  14236. * ************************************************************************
  14237. * * Read * Write * * Magic *
  14238. * * index * index * CFR data1 ...... CFR data N * pattern *
  14239. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  14240. * ************************************************************************
  14241. * |<---------- data buffer ---------->|
  14242. *
  14243. * |<----------------- meta-data buffer allocated in Host ----------------|
  14244. *
  14245. * Note:
  14246. * - Considering the 4 bytes needed to store the Read index (R) and the
  14247. * Write index (W), the initial value is as follows:
  14248. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  14249. * - Buffer empty condition:
  14250. * R = W
  14251. *
  14252. * Regarding CFR data format:
  14253. * --------------------------
  14254. *
  14255. * Each CFR tone is stored in HW as 16-bits with the following format:
  14256. * {bits[15:12], bits[11:6], bits[5:0]} =
  14257. * {unsigned exponent (4 bits),
  14258. * signed mantissa_real (6 bits),
  14259. * signed mantissa_imag (6 bits)}
  14260. *
  14261. * CFR_real = mantissa_real * 2^(exponent-5)
  14262. * CFR_imag = mantissa_imag * 2^(exponent-5)
  14263. *
  14264. *
  14265. * The CFR data is written to the 16-bit unsigned output array (buff) in
  14266. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  14267. *
  14268. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  14269. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  14270. * .
  14271. * .
  14272. * .
  14273. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  14274. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  14275. */
  14276. /* Bandwidth of peer CFR captures */
  14277. typedef enum {
  14278. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  14279. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  14280. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  14281. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  14282. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  14283. HTT_PEER_CFR_CAPTURE_BW_MAX,
  14284. } HTT_PEER_CFR_CAPTURE_BW;
  14285. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  14286. * was captured
  14287. */
  14288. typedef enum {
  14289. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  14290. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  14291. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  14292. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  14293. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  14294. } HTT_PEER_CFR_CAPTURE_MODE;
  14295. typedef enum {
  14296. /* This message type is currently used for the below purpose:
  14297. *
  14298. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  14299. * wmi_peer_cfr_capture_cmd.
  14300. * If payload_present bit is set to 0 then the associated memory region
  14301. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  14302. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  14303. * message; the CFR dump will be present at the end of the message,
  14304. * after the chan_phy_mode.
  14305. */
  14306. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  14307. /* Always keep this last */
  14308. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  14309. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  14310. /**
  14311. * @brief target -> host CFR dump completion indication message definition
  14312. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  14313. *
  14314. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  14315. *
  14316. * @details
  14317. * The following diagram shows the format of the Channel Frequency Response
  14318. * (CFR) dump completion indication. This inidcation is sent to the Host when
  14319. * the channel capture of a peer is copied by Firmware into the Host memory
  14320. *
  14321. * **************************************************************************
  14322. *
  14323. * Message format when the CFR capture message type is
  14324. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14325. *
  14326. * **************************************************************************
  14327. *
  14328. * |31 16|15 |8|7 0|
  14329. * |----------------------------------------------------------------|
  14330. * header: | reserved |P| msg_type |
  14331. * word 0 | | | |
  14332. * |----------------------------------------------------------------|
  14333. * payload: | cfr_capture_msg_type |
  14334. * word 1 | |
  14335. * |----------------------------------------------------------------|
  14336. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  14337. * word 2 | | | | | | | | |
  14338. * |----------------------------------------------------------------|
  14339. * | mac_addr31to0 |
  14340. * word 3 | |
  14341. * |----------------------------------------------------------------|
  14342. * | unused / reserved | mac_addr47to32 |
  14343. * word 4 | | |
  14344. * |----------------------------------------------------------------|
  14345. * | index |
  14346. * word 5 | |
  14347. * |----------------------------------------------------------------|
  14348. * | length |
  14349. * word 6 | |
  14350. * |----------------------------------------------------------------|
  14351. * | timestamp |
  14352. * word 7 | |
  14353. * |----------------------------------------------------------------|
  14354. * | counter |
  14355. * word 8 | |
  14356. * |----------------------------------------------------------------|
  14357. * | chan_mhz |
  14358. * word 9 | |
  14359. * |----------------------------------------------------------------|
  14360. * | band_center_freq1 |
  14361. * word 10 | |
  14362. * |----------------------------------------------------------------|
  14363. * | band_center_freq2 |
  14364. * word 11 | |
  14365. * |----------------------------------------------------------------|
  14366. * | chan_phy_mode |
  14367. * word 12 | |
  14368. * |----------------------------------------------------------------|
  14369. * where,
  14370. * P - payload present bit (payload_present explained below)
  14371. * req_id - memory request id (mem_req_id explained below)
  14372. * S - status field (status explained below)
  14373. * capbw - capture bandwidth (capture_bw explained below)
  14374. * mode - mode of capture (mode explained below)
  14375. * sts - space time streams (sts_count explained below)
  14376. * chbw - channel bandwidth (channel_bw explained below)
  14377. * captype - capture type (cap_type explained below)
  14378. *
  14379. * The following field definitions describe the format of the CFR dump
  14380. * completion indication sent from the target to the host
  14381. *
  14382. * Header fields:
  14383. *
  14384. * Word 0
  14385. * - msg_type
  14386. * Bits 7:0
  14387. * Purpose: Identifies this as CFR TX completion indication
  14388. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  14389. * - payload_present
  14390. * Bit 8
  14391. * Purpose: Identifies how CFR data is sent to host
  14392. * Value: 0 - If CFR Payload is written to host memory
  14393. * 1 - If CFR Payload is sent as part of HTT message
  14394. * (This is the requirement for SDIO/USB where it is
  14395. * not possible to write CFR data to host memory)
  14396. * - reserved
  14397. * Bits 31:9
  14398. * Purpose: Reserved
  14399. * Value: 0
  14400. *
  14401. * Payload fields:
  14402. *
  14403. * Word 1
  14404. * - cfr_capture_msg_type
  14405. * Bits 31:0
  14406. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  14407. * to specify the format used for the remainder of the message
  14408. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14409. * (currently only MSG_TYPE_1 is defined)
  14410. *
  14411. * Word 2
  14412. * - mem_req_id
  14413. * Bits 6:0
  14414. * Purpose: Contain the mem request id of the region where the CFR capture
  14415. * has been stored - of type WMI_HOST_MEM_REQ_ID
  14416. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  14417. this value is invalid)
  14418. * - status
  14419. * Bit 7
  14420. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  14421. * Value: 1 (True) - Successful; 0 (False) - Not successful
  14422. * - capture_bw
  14423. * Bits 10:8
  14424. * Purpose: Carry the bandwidth of the CFR capture
  14425. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  14426. * - mode
  14427. * Bits 13:11
  14428. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  14429. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  14430. * - sts_count
  14431. * Bits 16:14
  14432. * Purpose: Carry the number of space time streams
  14433. * Value: Number of space time streams
  14434. * - channel_bw
  14435. * Bits 19:17
  14436. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  14437. * measurement
  14438. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  14439. * - cap_type
  14440. * Bits 23:20
  14441. * Purpose: Carry the type of the capture
  14442. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  14443. * - vdev_id
  14444. * Bits 31:24
  14445. * Purpose: Carry the virtual device id
  14446. * Value: vdev ID
  14447. *
  14448. * Word 3
  14449. * - mac_addr31to0
  14450. * Bits 31:0
  14451. * Purpose: Contain the bits 31:0 of the peer MAC address
  14452. * Value: Bits 31:0 of the peer MAC address
  14453. *
  14454. * Word 4
  14455. * - mac_addr47to32
  14456. * Bits 15:0
  14457. * Purpose: Contain the bits 47:32 of the peer MAC address
  14458. * Value: Bits 47:32 of the peer MAC address
  14459. *
  14460. * Word 5
  14461. * - index
  14462. * Bits 31:0
  14463. * Purpose: Contain the index at which this CFR dump was written in the Host
  14464. * allocated memory. This index is the number of bytes from the base address.
  14465. * Value: Index position
  14466. *
  14467. * Word 6
  14468. * - length
  14469. * Bits 31:0
  14470. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  14471. * Value: Length of the CFR capture of the peer
  14472. *
  14473. * Word 7
  14474. * - timestamp
  14475. * Bits 31:0
  14476. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  14477. * clock used for this timestamp is private to the target and not visible to
  14478. * the host i.e., Host can interpret only the relative timestamp deltas from
  14479. * one message to the next, but can't interpret the absolute timestamp from a
  14480. * single message.
  14481. * Value: Timestamp in microseconds
  14482. *
  14483. * Word 8
  14484. * - counter
  14485. * Bits 31:0
  14486. * Purpose: Carry the count of the current CFR capture from FW. This is
  14487. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  14488. * in host memory)
  14489. * Value: Count of the current CFR capture
  14490. *
  14491. * Word 9
  14492. * - chan_mhz
  14493. * Bits 31:0
  14494. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  14495. * Value: Primary 20 channel frequency
  14496. *
  14497. * Word 10
  14498. * - band_center_freq1
  14499. * Bits 31:0
  14500. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  14501. * Value: Center frequency 1 in MHz
  14502. *
  14503. * Word 11
  14504. * - band_center_freq2
  14505. * Bits 31:0
  14506. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  14507. * the VDEV
  14508. * 80plus80 mode
  14509. * Value: Center frequency 2 in MHz
  14510. *
  14511. * Word 12
  14512. * - chan_phy_mode
  14513. * Bits 31:0
  14514. * Purpose: Carry the phy mode of the channel, of the VDEV
  14515. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  14516. */
  14517. PREPACK struct htt_cfr_dump_ind_type_1 {
  14518. A_UINT32 mem_req_id:7,
  14519. status:1,
  14520. capture_bw:3,
  14521. mode:3,
  14522. sts_count:3,
  14523. channel_bw:3,
  14524. cap_type:4,
  14525. vdev_id:8;
  14526. htt_mac_addr addr;
  14527. A_UINT32 index;
  14528. A_UINT32 length;
  14529. A_UINT32 timestamp;
  14530. A_UINT32 counter;
  14531. struct htt_chan_change_msg chan;
  14532. } POSTPACK;
  14533. PREPACK struct htt_cfr_dump_compl_ind {
  14534. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  14535. union {
  14536. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  14537. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  14538. /* If there is a need to change the memory layout and its associated
  14539. * HTT indication format, a new CFR capture message type can be
  14540. * introduced and added into this union.
  14541. */
  14542. };
  14543. } POSTPACK;
  14544. /*
  14545. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  14546. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14547. */
  14548. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  14549. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  14550. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  14551. do { \
  14552. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  14553. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  14554. } while(0)
  14555. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  14556. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  14557. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  14558. /*
  14559. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  14560. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14561. */
  14562. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  14563. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  14564. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  14565. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  14566. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  14567. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  14568. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  14569. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  14570. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  14571. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  14572. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  14573. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  14574. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  14575. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  14576. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  14577. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  14578. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  14579. do { \
  14580. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  14581. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  14582. } while (0)
  14583. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  14584. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  14585. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  14586. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  14587. do { \
  14588. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  14589. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  14590. } while (0)
  14591. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  14592. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  14593. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  14594. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  14595. do { \
  14596. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  14597. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  14598. } while (0)
  14599. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  14600. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  14601. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  14602. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  14603. do { \
  14604. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  14605. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  14606. } while (0)
  14607. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  14608. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  14609. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  14610. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  14611. do { \
  14612. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  14613. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  14614. } while (0)
  14615. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  14616. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  14617. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  14618. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  14619. do { \
  14620. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  14621. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  14622. } while (0)
  14623. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  14624. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  14625. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  14626. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  14627. do { \
  14628. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  14629. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  14630. } while (0)
  14631. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  14632. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  14633. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  14634. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  14635. do { \
  14636. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  14637. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  14638. } while (0)
  14639. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  14640. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  14641. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  14642. /**
  14643. * @brief target -> host peer (PPDU) stats message
  14644. *
  14645. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  14646. *
  14647. * @details
  14648. * This message is generated by FW when FW is sending stats to host
  14649. * about one or more PPDUs that the FW has transmitted to one or more peers.
  14650. * This message is sent autonomously by the target rather than upon request
  14651. * by the host.
  14652. * The following field definitions describe the format of the HTT target
  14653. * to host peer stats indication message.
  14654. *
  14655. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  14656. * or more PPDU stats records.
  14657. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  14658. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  14659. * then the message would start with the
  14660. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  14661. * below.
  14662. *
  14663. * |31 16|15|14|13 11|10 9|8|7 0|
  14664. * |-------------------------------------------------------------|
  14665. * | reserved |MSG_TYPE |
  14666. * |-------------------------------------------------------------|
  14667. * rec 0 | TLV header |
  14668. * rec 0 |-------------------------------------------------------------|
  14669. * rec 0 | ppdu successful bytes |
  14670. * rec 0 |-------------------------------------------------------------|
  14671. * rec 0 | ppdu retry bytes |
  14672. * rec 0 |-------------------------------------------------------------|
  14673. * rec 0 | ppdu failed bytes |
  14674. * rec 0 |-------------------------------------------------------------|
  14675. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  14676. * rec 0 |-------------------------------------------------------------|
  14677. * rec 0 | retried MSDUs | successful MSDUs |
  14678. * rec 0 |-------------------------------------------------------------|
  14679. * rec 0 | TX duration | failed MSDUs |
  14680. * rec 0 |-------------------------------------------------------------|
  14681. * ...
  14682. * |-------------------------------------------------------------|
  14683. * rec N | TLV header |
  14684. * rec N |-------------------------------------------------------------|
  14685. * rec N | ppdu successful bytes |
  14686. * rec N |-------------------------------------------------------------|
  14687. * rec N | ppdu retry bytes |
  14688. * rec N |-------------------------------------------------------------|
  14689. * rec N | ppdu failed bytes |
  14690. * rec N |-------------------------------------------------------------|
  14691. * rec N | peer id | S|SG| BW | BA |A|rate code|
  14692. * rec N |-------------------------------------------------------------|
  14693. * rec N | retried MSDUs | successful MSDUs |
  14694. * rec N |-------------------------------------------------------------|
  14695. * rec N | TX duration | failed MSDUs |
  14696. * rec N |-------------------------------------------------------------|
  14697. *
  14698. * where:
  14699. * A = is A-MPDU flag
  14700. * BA = block-ack failure flags
  14701. * BW = bandwidth spec
  14702. * SG = SGI enabled spec
  14703. * S = skipped rate ctrl
  14704. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  14705. *
  14706. * Header
  14707. * ------
  14708. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  14709. * dword0 - b'8:31 - reserved : Reserved for future use
  14710. *
  14711. * payload include below peer_stats information
  14712. * --------------------------------------------
  14713. * @TLV : HTT_PPDU_STATS_INFO_TLV
  14714. * @tx_success_bytes : total successful bytes in the PPDU.
  14715. * @tx_retry_bytes : total retried bytes in the PPDU.
  14716. * @tx_failed_bytes : total failed bytes in the PPDU.
  14717. * @tx_ratecode : rate code used for the PPDU.
  14718. * @is_ampdu : Indicates PPDU is AMPDU or not.
  14719. * @ba_ack_failed : BA/ACK failed for this PPDU
  14720. * b00 -> BA received
  14721. * b01 -> BA failed once
  14722. * b10 -> BA failed twice, when HW retry is enabled.
  14723. * @bw : BW
  14724. * b00 -> 20 MHz
  14725. * b01 -> 40 MHz
  14726. * b10 -> 80 MHz
  14727. * b11 -> 160 MHz (or 80+80)
  14728. * @sg : SGI enabled
  14729. * @s : skipped ratectrl
  14730. * @peer_id : peer id
  14731. * @tx_success_msdus : successful MSDUs
  14732. * @tx_retry_msdus : retried MSDUs
  14733. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  14734. * @tx_duration : Tx duration for the PPDU (microsecond units)
  14735. */
  14736. /**
  14737. * @brief target -> host backpressure event
  14738. *
  14739. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  14740. *
  14741. * @details
  14742. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  14743. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  14744. * This message will only be sent if the backpressure condition has existed
  14745. * continuously for an initial period (100 ms).
  14746. * Repeat messages with updated information will be sent after each
  14747. * subsequent period (100 ms) as long as the backpressure remains unabated.
  14748. * This message indicates the ring id along with current head and tail index
  14749. * locations (i.e. write and read indices).
  14750. * The backpressure time indicates the time in ms for which continous
  14751. * backpressure has been observed in the ring.
  14752. *
  14753. * The message format is as follows:
  14754. *
  14755. * |31 24|23 16|15 8|7 0|
  14756. * |----------------+----------------+----------------+----------------|
  14757. * | ring_id | ring_type | pdev_id | msg_type |
  14758. * |-------------------------------------------------------------------|
  14759. * | tail_idx | head_idx |
  14760. * |-------------------------------------------------------------------|
  14761. * | backpressure_time_ms |
  14762. * |-------------------------------------------------------------------|
  14763. *
  14764. * The message is interpreted as follows:
  14765. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  14766. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  14767. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  14768. * 1, 2, 3 indicates pdev_id 0,1,2 and
  14769. the msg is for LMAC ring.
  14770. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  14771. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  14772. * htt_backpressure_lmac_ring_id. This represents
  14773. * the ring id for which continous backpressure is seen
  14774. *
  14775. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  14776. * the ring indicated by the ring_id
  14777. *
  14778. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  14779. * the ring indicated by the ring id
  14780. *
  14781. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  14782. * backpressure has been seen in the ring
  14783. * indicated by the ring_id.
  14784. * Units = milliseconds
  14785. */
  14786. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  14787. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  14788. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  14789. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  14790. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  14791. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  14792. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  14793. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  14794. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  14795. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  14796. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  14797. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  14798. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  14799. do { \
  14800. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  14801. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  14802. } while (0)
  14803. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  14804. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  14805. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  14806. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  14807. do { \
  14808. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  14809. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  14810. } while (0)
  14811. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  14812. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  14813. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  14814. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  14815. do { \
  14816. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  14817. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  14818. } while (0)
  14819. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  14820. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  14821. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  14822. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  14823. do { \
  14824. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  14825. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  14826. } while (0)
  14827. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  14828. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  14829. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  14830. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  14831. do { \
  14832. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  14833. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  14834. } while (0)
  14835. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  14836. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  14837. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  14838. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  14839. do { \
  14840. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  14841. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  14842. } while (0)
  14843. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  14844. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  14845. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  14846. enum htt_backpressure_ring_type {
  14847. HTT_SW_RING_TYPE_UMAC,
  14848. HTT_SW_RING_TYPE_LMAC,
  14849. HTT_SW_RING_TYPE_MAX,
  14850. };
  14851. /* Ring id for which the message is sent to host */
  14852. enum htt_backpressure_umac_ringid {
  14853. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  14854. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  14855. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  14856. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  14857. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  14858. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  14859. HTT_SW_RING_IDX_REO_REO2FW_RING,
  14860. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  14861. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  14862. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  14863. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  14864. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  14865. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  14866. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  14867. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  14868. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  14869. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  14870. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  14871. HTT_SW_UMAC_RING_IDX_MAX,
  14872. };
  14873. enum htt_backpressure_lmac_ringid {
  14874. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  14875. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  14876. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  14877. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  14878. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  14879. HTT_SW_RING_IDX_RXDMA2FW_RING,
  14880. HTT_SW_RING_IDX_RXDMA2SW_RING,
  14881. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  14882. HTT_SW_RING_IDX_RXDMA2REO_RING,
  14883. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  14884. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  14885. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  14886. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  14887. HTT_SW_LMAC_RING_IDX_MAX,
  14888. };
  14889. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  14890. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  14891. pdev_id: 8,
  14892. ring_type: 8, /* htt_backpressure_ring_type */
  14893. /*
  14894. * ring_id holds an enum value from either
  14895. * htt_backpressure_umac_ringid or
  14896. * htt_backpressure_lmac_ringid, based on
  14897. * the ring_type setting.
  14898. */
  14899. ring_id: 8;
  14900. A_UINT16 head_idx;
  14901. A_UINT16 tail_idx;
  14902. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  14903. } POSTPACK;
  14904. /*
  14905. * Defines two 32 bit words that can be used by the target to indicate a per
  14906. * user RU allocation and rate information.
  14907. *
  14908. * This information is currently provided in the "sw_response_reference_ptr"
  14909. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  14910. * "rx_ppdu_end_user_stats" TLV.
  14911. *
  14912. * VALID:
  14913. * The consumer of these words must explicitly check the valid bit,
  14914. * and only attempt interpretation of any of the remaining fields if
  14915. * the valid bit is set to 1.
  14916. *
  14917. * VERSION:
  14918. * The consumer of these words must also explicitly check the version bit,
  14919. * and only use the V0 definition if the VERSION field is set to 0.
  14920. *
  14921. * Version 1 is currently undefined, with the exception of the VALID and
  14922. * VERSION fields.
  14923. *
  14924. * Version 0:
  14925. *
  14926. * The fields below are duplicated per BW.
  14927. *
  14928. * The consumer must determine which BW field to use, based on the UL OFDMA
  14929. * PPDU BW indicated by HW.
  14930. *
  14931. * RU_START: RU26 start index for the user.
  14932. * Note that this is always using the RU26 index, regardless
  14933. * of the actual RU assigned to the user
  14934. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  14935. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  14936. *
  14937. * For example, 20MHz (the value in the top row is RU_START)
  14938. *
  14939. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  14940. * RU Size 1 (52): | | | | | |
  14941. * RU Size 2 (106): | | | |
  14942. * RU Size 3 (242): | |
  14943. *
  14944. * RU_SIZE: Indicates the RU size, as defined by enum
  14945. * htt_ul_ofdma_user_info_ru_size.
  14946. *
  14947. * LDPC: LDPC enabled (if 0, BCC is used)
  14948. *
  14949. * DCM: DCM enabled
  14950. *
  14951. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  14952. * |---------------------------------+--------------------------------|
  14953. * |Ver|Valid| FW internal |
  14954. * |---------------------------------+--------------------------------|
  14955. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  14956. * |---------------------------------+--------------------------------|
  14957. */
  14958. enum htt_ul_ofdma_user_info_ru_size {
  14959. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  14960. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  14961. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  14962. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  14963. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  14964. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  14965. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  14966. };
  14967. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  14968. struct htt_ul_ofdma_user_info_v0 {
  14969. A_UINT32 word0;
  14970. A_UINT32 word1;
  14971. };
  14972. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  14973. A_UINT32 w0_fw_rsvd:30; \
  14974. A_UINT32 w0_valid:1; \
  14975. A_UINT32 w0_version:1;
  14976. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  14977. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  14978. };
  14979. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  14980. A_UINT32 w1_nss:3; \
  14981. A_UINT32 w1_mcs:4; \
  14982. A_UINT32 w1_ldpc:1; \
  14983. A_UINT32 w1_dcm:1; \
  14984. A_UINT32 w1_ru_start:7; \
  14985. A_UINT32 w1_ru_size:3; \
  14986. A_UINT32 w1_trig_type:4; \
  14987. A_UINT32 w1_unused:9;
  14988. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  14989. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  14990. };
  14991. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  14992. A_UINT32 w0_fw_rsvd:27; \
  14993. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  14994. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  14995. 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) */
  14996. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  14997. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  14998. };
  14999. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15000. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15001. A_UINT32 w1_trig_type:4; \
  15002. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15003. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15004. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15005. };
  15006. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15007. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15008. union {
  15009. A_UINT32 word0;
  15010. struct {
  15011. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15012. };
  15013. };
  15014. union {
  15015. A_UINT32 word1;
  15016. struct {
  15017. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15018. };
  15019. };
  15020. } POSTPACK;
  15021. /*
  15022. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15023. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15024. * this should be picked.
  15025. */
  15026. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15027. union {
  15028. A_UINT32 word0;
  15029. struct {
  15030. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15031. };
  15032. };
  15033. union {
  15034. A_UINT32 word1;
  15035. struct {
  15036. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15037. };
  15038. };
  15039. } POSTPACK;
  15040. enum HTT_UL_OFDMA_TRIG_TYPE {
  15041. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15042. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15043. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15044. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15045. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15046. };
  15047. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15048. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15049. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15050. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15051. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15052. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15053. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15054. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15055. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15056. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15057. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15058. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15059. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15060. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15061. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15062. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15063. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15064. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15065. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15066. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15067. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15068. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15069. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15070. /*--- word 0 ---*/
  15071. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15072. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15073. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15074. do { \
  15075. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15076. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15077. } while (0)
  15078. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15079. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15080. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15081. do { \
  15082. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15083. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15084. } while (0)
  15085. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15086. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15087. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15088. do { \
  15089. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15090. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15091. } while (0)
  15092. /*--- word 1 ---*/
  15093. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15094. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15095. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15096. do { \
  15097. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15098. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15099. } while (0)
  15100. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15101. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15102. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15103. do { \
  15104. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15105. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15106. } while (0)
  15107. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15108. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15109. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  15110. do { \
  15111. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  15112. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  15113. } while (0)
  15114. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  15115. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  15116. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  15117. do { \
  15118. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  15119. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  15120. } while (0)
  15121. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  15122. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  15123. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  15124. do { \
  15125. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  15126. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  15127. } while (0)
  15128. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  15129. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  15130. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  15131. do { \
  15132. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  15133. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  15134. } while (0)
  15135. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  15136. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  15137. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  15138. do { \
  15139. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  15140. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  15141. } while (0)
  15142. /**
  15143. * @brief target -> host channel calibration data message
  15144. *
  15145. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  15146. *
  15147. * @brief host -> target channel calibration data message
  15148. *
  15149. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  15150. *
  15151. * @details
  15152. * The following field definitions describe the format of the channel
  15153. * calibration data message sent from the target to the host when
  15154. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  15155. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  15156. * The message is defined as htt_chan_caldata_msg followed by a variable
  15157. * number of 32-bit character values.
  15158. *
  15159. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  15160. * |------------------------------------------------------------------|
  15161. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  15162. * |------------------------------------------------------------------|
  15163. * | payload size | mhz |
  15164. * |------------------------------------------------------------------|
  15165. * | center frequency 2 | center frequency 1 |
  15166. * |------------------------------------------------------------------|
  15167. * | check sum |
  15168. * |------------------------------------------------------------------|
  15169. * | payload |
  15170. * |------------------------------------------------------------------|
  15171. * message info field:
  15172. * - MSG_TYPE
  15173. * Bits 7:0
  15174. * Purpose: identifies this as a channel calibration data message
  15175. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  15176. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  15177. * - SUB_TYPE
  15178. * Bits 11:8
  15179. * Purpose: T2H: indicates whether target is providing chan cal data
  15180. * to the host to store, or requesting that the host
  15181. * download previously-stored data.
  15182. * H2T: indicates whether the host is providing the requested
  15183. * channel cal data, or if it is rejecting the data
  15184. * request because it does not have the requested data.
  15185. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  15186. * - CHKSUM_VALID
  15187. * Bit 12
  15188. * Purpose: indicates if the checksum field is valid
  15189. * value:
  15190. * - FRAG
  15191. * Bit 19:16
  15192. * Purpose: indicates the fragment index for message
  15193. * value: 0 for first fragment, 1 for second fragment, ...
  15194. * - APPEND
  15195. * Bit 20
  15196. * Purpose: indicates if this is the last fragment
  15197. * value: 0 = final fragment, 1 = more fragments will be appended
  15198. *
  15199. * channel and payload size field
  15200. * - MHZ
  15201. * Bits 15:0
  15202. * Purpose: indicates the channel primary frequency
  15203. * Value:
  15204. * - PAYLOAD_SIZE
  15205. * Bits 31:16
  15206. * Purpose: indicates the bytes of calibration data in payload
  15207. * Value:
  15208. *
  15209. * center frequency field
  15210. * - CENTER FREQUENCY 1
  15211. * Bits 15:0
  15212. * Purpose: indicates the channel center frequency
  15213. * Value: channel center frequency, in MHz units
  15214. * - CENTER FREQUENCY 2
  15215. * Bits 31:16
  15216. * Purpose: indicates the secondary channel center frequency,
  15217. * only for 11acvht 80plus80 mode
  15218. * Value: secondary channel center frequeny, in MHz units, if applicable
  15219. *
  15220. * checksum field
  15221. * - CHECK_SUM
  15222. * Bits 31:0
  15223. * Purpose: check the payload data, it is just for this fragment.
  15224. * This is intended for the target to check that the channel
  15225. * calibration data returned by the host is the unmodified data
  15226. * that was previously provided to the host by the target.
  15227. * value: checksum of fragment payload
  15228. */
  15229. PREPACK struct htt_chan_caldata_msg {
  15230. /* DWORD 0: message info */
  15231. A_UINT32
  15232. msg_type: 8,
  15233. sub_type: 4 ,
  15234. chksum_valid: 1, /** 1:valid, 0:invalid */
  15235. reserved1: 3,
  15236. frag_idx: 4, /** fragment index for calibration data */
  15237. appending: 1, /** 0: no fragment appending,
  15238. * 1: extra fragment appending */
  15239. reserved2: 11;
  15240. /* DWORD 1: channel and payload size */
  15241. A_UINT32
  15242. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  15243. payload_size: 16; /** unit: bytes */
  15244. /* DWORD 2: center frequency */
  15245. A_UINT32
  15246. band_center_freq1: 16, /** Center frequency 1 in MHz */
  15247. band_center_freq2: 16; /** Center frequency 2 in MHz,
  15248. * valid only for 11acvht 80plus80 mode */
  15249. /* DWORD 3: check sum */
  15250. A_UINT32 chksum;
  15251. /* variable length for calibration data */
  15252. A_UINT32 payload[1/* or more */];
  15253. } POSTPACK;
  15254. /* T2H SUBTYPE */
  15255. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  15256. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  15257. /* H2T SUBTYPE */
  15258. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  15259. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  15260. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  15261. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  15262. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  15263. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  15264. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  15265. do { \
  15266. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  15267. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  15268. } while (0)
  15269. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  15270. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  15271. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  15272. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  15273. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  15274. do { \
  15275. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  15276. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  15277. } while (0)
  15278. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  15279. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  15280. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  15281. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  15282. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  15283. do { \
  15284. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  15285. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  15286. } while (0)
  15287. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  15288. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  15289. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  15290. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  15291. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  15292. do { \
  15293. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  15294. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  15295. } while (0)
  15296. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  15297. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  15298. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  15299. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  15300. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  15301. do { \
  15302. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  15303. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  15304. } while (0)
  15305. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  15306. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  15307. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  15308. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  15309. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  15310. do { \
  15311. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  15312. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  15313. } while (0)
  15314. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  15315. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  15316. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  15317. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  15318. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  15319. do { \
  15320. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  15321. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  15322. } while (0)
  15323. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  15324. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  15325. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  15326. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  15327. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  15328. do { \
  15329. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  15330. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  15331. } while (0)
  15332. /**
  15333. * @brief target -> host FSE CMEM based send
  15334. *
  15335. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  15336. *
  15337. * @details
  15338. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  15339. * FSE placement in CMEM is enabled.
  15340. *
  15341. * This message sends the non-secure CMEM base address.
  15342. * It will be sent to host in response to message
  15343. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  15344. * The message would appear as follows:
  15345. *
  15346. * |31 24|23 16|15 8|7 0|
  15347. * |----------------+----------------+----------------+----------------|
  15348. * | reserved | num_entries | msg_type |
  15349. * |----------------+----------------+----------------+----------------|
  15350. * | base_address_lo |
  15351. * |----------------+----------------+----------------+----------------|
  15352. * | base_address_hi |
  15353. * |-------------------------------------------------------------------|
  15354. *
  15355. * The message is interpreted as follows:
  15356. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  15357. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  15358. * b'8:15 - number_entries: Indicated the number of entries
  15359. * programmed.
  15360. * b'16:31 - reserved.
  15361. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  15362. * CMEM base address
  15363. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  15364. * CMEM base address
  15365. */
  15366. PREPACK struct htt_cmem_base_send_t {
  15367. A_UINT32 msg_type: 8,
  15368. num_entries: 8,
  15369. reserved: 16;
  15370. A_UINT32 base_address_lo;
  15371. A_UINT32 base_address_hi;
  15372. } POSTPACK;
  15373. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  15374. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  15375. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  15376. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  15377. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  15378. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  15379. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  15380. do { \
  15381. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  15382. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15383. } while (0)
  15384. /**
  15385. * @brief - HTT PPDU ID format
  15386. *
  15387. * @details
  15388. * The following field definitions describe the format of the PPDU ID.
  15389. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  15390. *
  15391. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  15392. * +--------------------------------------------------------------------------
  15393. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  15394. * +--------------------------------------------------------------------------
  15395. *
  15396. * sch id :Schedule command id
  15397. * Bits [11 : 0] : monotonically increasing counter to track the
  15398. * PPDU posted to a specific transmit queue.
  15399. *
  15400. * hwq_id: Hardware Queue ID.
  15401. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  15402. *
  15403. * mac_id: MAC ID
  15404. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  15405. *
  15406. * seq_idx: Sequence index.
  15407. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  15408. * a particular TXOP.
  15409. *
  15410. * tqm_cmd: HWSCH/TQM flag.
  15411. * Bit [23] : Always set to 0.
  15412. *
  15413. * seq_cmd_type: Sequence command type.
  15414. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  15415. * Refer to enum HTT_STATS_FTYPE for values.
  15416. */
  15417. PREPACK struct htt_ppdu_id {
  15418. A_UINT32
  15419. sch_id: 12,
  15420. hwq_id: 5,
  15421. mac_id: 2,
  15422. seq_idx: 2,
  15423. reserved1: 2,
  15424. tqm_cmd: 1,
  15425. seq_cmd_type: 6,
  15426. reserved2: 2;
  15427. } POSTPACK;
  15428. #define HTT_PPDU_ID_SCH_ID_S 0
  15429. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  15430. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  15431. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  15432. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  15433. do { \
  15434. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  15435. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  15436. } while (0)
  15437. #define HTT_PPDU_ID_HWQ_ID_S 12
  15438. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  15439. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  15440. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  15441. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  15442. do { \
  15443. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  15444. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  15445. } while (0)
  15446. #define HTT_PPDU_ID_MAC_ID_S 17
  15447. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  15448. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  15449. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  15450. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  15451. do { \
  15452. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  15453. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  15454. } while (0)
  15455. #define HTT_PPDU_ID_SEQ_IDX_S 19
  15456. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  15457. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  15458. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  15459. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  15460. do { \
  15461. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  15462. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  15463. } while (0)
  15464. #define HTT_PPDU_ID_TQM_CMD_S 23
  15465. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  15466. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  15467. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  15468. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  15469. do { \
  15470. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  15471. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  15472. } while (0)
  15473. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  15474. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  15475. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  15476. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  15477. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  15478. do { \
  15479. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  15480. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  15481. } while (0)
  15482. /**
  15483. * @brief target -> RX PEER METADATA V0 format
  15484. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15485. * message from target, and will confirm to the target which peer metadata
  15486. * version to use in the wmi_init message.
  15487. *
  15488. * The following diagram shows the format of the RX PEER METADATA.
  15489. *
  15490. * |31 24|23 16|15 8|7 0|
  15491. * |-----------------------------------------------------------------------|
  15492. * | Reserved | VDEV ID | PEER ID |
  15493. * |-----------------------------------------------------------------------|
  15494. */
  15495. PREPACK struct htt_rx_peer_metadata_v0 {
  15496. A_UINT32
  15497. peer_id: 16,
  15498. vdev_id: 8,
  15499. reserved1: 8;
  15500. } POSTPACK;
  15501. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  15502. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  15503. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  15504. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  15505. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  15506. do { \
  15507. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  15508. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  15509. } while (0)
  15510. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  15511. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  15512. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  15513. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  15514. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  15515. do { \
  15516. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  15517. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  15518. } while (0)
  15519. /**
  15520. * @brief target -> RX PEER METADATA V1 format
  15521. * Host will know the peer metadata version from the wmi_service_ready_ext2
  15522. * message from target, and will confirm to the target which peer metadata
  15523. * version to use in the wmi_init message.
  15524. *
  15525. * The following diagram shows the format of the RX PEER METADATA V1 format.
  15526. *
  15527. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  15528. * |-----------------------------------------------------------------------|
  15529. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  15530. * |-----------------------------------------------------------------------|
  15531. */
  15532. PREPACK struct htt_rx_peer_metadata_v1 {
  15533. A_UINT32
  15534. peer_id: 13,
  15535. ml_peer_valid: 1,
  15536. reserved1: 2,
  15537. vdev_id: 8,
  15538. lmac_id: 2,
  15539. chip_id: 3,
  15540. reserved2: 3;
  15541. } POSTPACK;
  15542. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  15543. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  15544. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  15545. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  15546. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  15547. do { \
  15548. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  15549. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  15550. } while (0)
  15551. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  15552. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  15553. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  15554. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  15555. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  15556. do { \
  15557. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  15558. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  15559. } while (0)
  15560. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  15561. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  15562. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  15563. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  15564. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  15565. do { \
  15566. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  15567. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  15568. } while (0)
  15569. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  15570. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  15571. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  15572. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  15573. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  15574. do { \
  15575. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  15576. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  15577. } while (0)
  15578. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  15579. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  15580. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  15581. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  15582. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  15583. do { \
  15584. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  15585. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  15586. } while (0)
  15587. /*
  15588. * In some systems, the host SW wants to specify priorities between
  15589. * different MSDU / flow queues within the same peer-TID.
  15590. * The below enums are used for the host to identify to the target
  15591. * which MSDU queue's priority it wants to adjust.
  15592. */
  15593. /*
  15594. * The MSDUQ index describe index of TCL HW, where each index is
  15595. * used for queuing particular types of MSDUs.
  15596. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  15597. */
  15598. enum HTT_MSDUQ_INDEX {
  15599. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  15600. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  15601. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  15602. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  15603. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  15604. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  15605. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  15606. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  15607. HTT_MSDUQ_MAX_INDEX,
  15608. };
  15609. /* MSDU qtype definition */
  15610. enum HTT_MSDU_QTYPE {
  15611. /*
  15612. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  15613. * relative priority. Instead, the relative priority of CRIT_0 versus
  15614. * CRIT_1 is controlled by the FW, through the configuration parameters
  15615. * it applies to the queues.
  15616. */
  15617. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  15618. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  15619. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  15620. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  15621. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  15622. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  15623. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  15624. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  15625. /* New MSDU_QTYPE should be added above this line */
  15626. /*
  15627. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  15628. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  15629. * any host/target message definitions. The QTYPE_MAX value can
  15630. * only be used internally within the host or within the target.
  15631. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  15632. * it must regard the unexpected value as a default qtype value,
  15633. * or ignore it.
  15634. */
  15635. HTT_MSDU_QTYPE_MAX,
  15636. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  15637. };
  15638. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  15639. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  15640. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  15641. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  15642. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  15643. };
  15644. /**
  15645. * @brief target -> host mlo timestamp offset indication
  15646. *
  15647. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15648. *
  15649. * @details
  15650. * The following field definitions describe the format of the HTT target
  15651. * to host mlo timestamp offset indication message.
  15652. *
  15653. *
  15654. * |31 16|15 12|11 10|9 8|7 0 |
  15655. * |----------------------------------------------------------------------|
  15656. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  15657. * |----------------------------------------------------------------------|
  15658. * | Sync time stamp lo in us |
  15659. * |----------------------------------------------------------------------|
  15660. * | Sync time stamp hi in us |
  15661. * |----------------------------------------------------------------------|
  15662. * | mlo time stamp offset lo in us |
  15663. * |----------------------------------------------------------------------|
  15664. * | mlo time stamp offset hi in us |
  15665. * |----------------------------------------------------------------------|
  15666. * | mlo time stamp offset clocks in clock ticks |
  15667. * |----------------------------------------------------------------------|
  15668. * |31 26|25 16|15 0 |
  15669. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  15670. * | | compensation in clks | |
  15671. * |----------------------------------------------------------------------|
  15672. * |31 22|21 0 |
  15673. * | rsvd 3 | mlo time stamp comp timer period |
  15674. * |----------------------------------------------------------------------|
  15675. * The message is interpreted as follows:
  15676. *
  15677. * dword0 - b'0:7 - msg_type: This will be set to
  15678. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  15679. * value: 0x28
  15680. *
  15681. * dword0 - b'9:8 - pdev_id
  15682. *
  15683. * dword0 - b'11:10 - chip_id
  15684. *
  15685. * dword0 - b'15:12 - rsvd1: Reserved for future use
  15686. *
  15687. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  15688. *
  15689. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  15690. * which last sync interrupt was received
  15691. *
  15692. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  15693. * which last sync interrupt was received
  15694. *
  15695. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  15696. *
  15697. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  15698. *
  15699. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  15700. *
  15701. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  15702. *
  15703. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  15704. * for sub us resolution
  15705. *
  15706. * dword6 - b'31:26 - rsvd2: Reserved for future use
  15707. *
  15708. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  15709. * is applied, in us
  15710. *
  15711. * dword7 - b'31:22 - rsvd3: Reserved for future use
  15712. */
  15713. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  15714. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  15715. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  15716. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  15717. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  15718. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  15719. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  15720. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  15721. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  15722. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  15723. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  15724. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  15725. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  15726. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  15727. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  15728. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  15729. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  15730. do { \
  15731. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  15732. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  15733. } while (0)
  15734. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  15735. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  15736. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  15737. do { \
  15738. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  15739. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  15740. } while (0)
  15741. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  15742. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  15743. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  15744. do { \
  15745. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  15746. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  15747. } while (0)
  15748. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  15749. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  15750. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  15751. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  15752. do { \
  15753. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  15754. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  15755. } while (0)
  15756. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  15757. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  15758. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  15759. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  15760. do { \
  15761. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  15762. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  15763. } while (0)
  15764. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  15765. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  15766. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  15767. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  15768. do { \
  15769. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  15770. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  15771. } while (0)
  15772. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  15773. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  15774. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  15775. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  15776. do { \
  15777. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  15778. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  15779. } while (0)
  15780. typedef struct {
  15781. A_UINT32 msg_type: 8, /* bits 7:0 */
  15782. pdev_id: 2, /* bits 9:8 */
  15783. chip_id: 2, /* bits 11:10 */
  15784. reserved1: 4, /* bits 15:12 */
  15785. mac_clk_freq_mhz: 16; /* bits 31:16 */
  15786. A_UINT32 sync_timestamp_lo_us;
  15787. A_UINT32 sync_timestamp_hi_us;
  15788. A_UINT32 mlo_timestamp_offset_lo_us;
  15789. A_UINT32 mlo_timestamp_offset_hi_us;
  15790. A_UINT32 mlo_timestamp_offset_clks;
  15791. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  15792. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  15793. reserved2: 6; /* bits 31:26 */
  15794. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  15795. reserved3: 10; /* bits 31:22 */
  15796. } htt_t2h_mlo_offset_ind_t;
  15797. /*
  15798. * @brief target -> host VDEV TX RX STATS
  15799. *
  15800. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  15801. *
  15802. * @details
  15803. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  15804. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  15805. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  15806. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  15807. * periodically by target even in the absence of any further HTT request
  15808. * messages from host.
  15809. *
  15810. * The message is formatted as follows:
  15811. *
  15812. * |31 16|15 8|7 0|
  15813. * |---------------------------------+----------------+----------------|
  15814. * | payload_size | pdev_id | msg_type |
  15815. * |---------------------------------+----------------+----------------|
  15816. * | reserved0 |
  15817. * |-------------------------------------------------------------------|
  15818. * | reserved1 |
  15819. * |-------------------------------------------------------------------|
  15820. * | reserved2 |
  15821. * |-------------------------------------------------------------------|
  15822. * | |
  15823. * | VDEV specific Tx Rx stats info |
  15824. * | |
  15825. * |-------------------------------------------------------------------|
  15826. *
  15827. * The message is interpreted as follows:
  15828. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  15829. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  15830. * b'8:15 - pdev_id
  15831. * b'16:31 - size in bytes of the payload that follows the 16-byte
  15832. * message header fields (msg_type through reserved2)
  15833. * dword1 - b'0:31 - reserved0.
  15834. * dword2 - b'0:31 - reserved1.
  15835. * dword3 - b'0:31 - reserved2.
  15836. */
  15837. typedef struct {
  15838. A_UINT32 msg_type: 8,
  15839. pdev_id: 8,
  15840. payload_size: 16;
  15841. A_UINT32 reserved0;
  15842. A_UINT32 reserved1;
  15843. A_UINT32 reserved2;
  15844. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  15845. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  15846. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  15847. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  15848. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  15849. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  15850. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  15851. do { \
  15852. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  15853. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  15854. } while (0)
  15855. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  15856. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  15857. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  15858. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  15859. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  15860. do { \
  15861. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  15862. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  15863. } while (0)
  15864. /* SOC related stats */
  15865. typedef struct {
  15866. htt_tlv_hdr_t tlv_hdr;
  15867. /* When TQM is not able to find the peers during Tx, then it drops the packets
  15868. * This can be due to either the peer is deleted or deletion is ongoing
  15869. * */
  15870. A_UINT32 inv_peers_msdu_drop_count_lo;
  15871. A_UINT32 inv_peers_msdu_drop_count_hi;
  15872. } htt_t2h_soc_txrx_stats_common_tlv;
  15873. /* VDEV HW Tx/Rx stats */
  15874. typedef struct {
  15875. htt_tlv_hdr_t tlv_hdr;
  15876. A_UINT32 vdev_id;
  15877. /* Rx msdu byte cnt */
  15878. A_UINT32 rx_msdu_byte_cnt_lo;
  15879. A_UINT32 rx_msdu_byte_cnt_hi;
  15880. /* Rx msdu cnt */
  15881. A_UINT32 rx_msdu_cnt_lo;
  15882. A_UINT32 rx_msdu_cnt_hi;
  15883. /* tx msdu byte cnt */
  15884. A_UINT32 tx_msdu_byte_cnt_lo;
  15885. A_UINT32 tx_msdu_byte_cnt_hi;
  15886. /* tx msdu cnt */
  15887. A_UINT32 tx_msdu_cnt_lo;
  15888. A_UINT32 tx_msdu_cnt_hi;
  15889. /* tx excessive retry discarded msdu cnt */
  15890. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  15891. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  15892. /* TX congestion ctrl msdu drop cnt */
  15893. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  15894. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  15895. /* discarded tx msdus cnt coz of time to live expiry */
  15896. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  15897. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  15898. /* tx excessive retry discarded msdu byte cnt */
  15899. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  15900. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  15901. /* TX congestion ctrl msdu drop byte cnt */
  15902. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  15903. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  15904. /* discarded tx msdus byte cnt coz of time to live expiry */
  15905. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  15906. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  15907. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  15908. /*
  15909. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  15910. *
  15911. * @details
  15912. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  15913. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  15914. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  15915. * the default MSDU queues of the peer-TID specified in the
  15916. * SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  15917. * If the default MSDU queues of the specified peer-TID are not linked to
  15918. * a service class, the status field of the SAWF_DEF_QUEUES_MAP_REPORT_CONF
  15919. * will specify that no such mapping exists of the default MSDU queues to a
  15920. * service class.
  15921. *
  15922. * |31 16|15 12|11 8|7 0|
  15923. * |------------------------------+------+-------+--------------|
  15924. * | peer ID | rsvd | TID | msg type |
  15925. * |------------------------------+--------------+--------------|
  15926. * | reserved | svc class ID | status |
  15927. * |------------------------------------------------------------|
  15928. * Header fields:
  15929. * dword0 - b'7:0 - msg_type: This will be set to
  15930. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  15931. * b'11:8 - TID
  15932. * b'31:16 - peer ID
  15933. * dword1 - b'7:0 - status (htt_t2h_sawf_def_queues_map_report_status)
  15934. * b'15:8 - svc class ID (only valid if status == MAPPED)
  15935. */
  15936. enum htt_t2h_sawf_def_queues_map_report_status {
  15937. /* MAPPED:
  15938. * The default MSDU queues for the peer-TID are linked to a service class.
  15939. * The svc_class_id field shows which service class the default MSDU queues
  15940. * are associated with.
  15941. */
  15942. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_STATUS_MAPPED = 0,
  15943. /* UNMAPPED:
  15944. * The default MSDU queues for the peer-TID are not linked to any
  15945. * service class.
  15946. */
  15947. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_STATUS_UNMAPPED = 1,
  15948. /* INVALID_IDS:
  15949. * One or more of pdev_id, vdev_id, peer_id, and TID were invalid.
  15950. */
  15951. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_INVALID_IDS = 2,
  15952. };
  15953. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  15954. A_UINT32 msg_type :8,
  15955. tid :4,
  15956. reserved0 :4,
  15957. peer_id :16;
  15958. A_UINT32 status :8,
  15959. svc_class_id :8,
  15960. reserved1 :16;
  15961. } POSTPACK;
  15962. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_BYTES 8
  15963. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x00000F00
  15964. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 8
  15965. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  15966. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  15967. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  15968. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  15969. do { \
  15970. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  15971. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S));\
  15972. } while (0)
  15973. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  15974. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  15975. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  15976. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  15977. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  15978. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  15979. do { \
  15980. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  15981. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  15982. } while (0)
  15983. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_M 0x000000FF
  15984. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S 0
  15985. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_GET(_var) \
  15986. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_M) >> \
  15987. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S)
  15988. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_SET(_var, _val) \
  15989. do { \
  15990. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS, _val); \
  15991. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_STATUS_S)); \
  15992. } while (0)
  15993. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  15994. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  15995. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  15996. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  15997. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  15998. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  15999. do { \
  16000. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16001. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16002. } while (0)
  16003. #endif