htt.h 884 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196
  1. /*
  2. * Copyright (c) 2011-2021 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
  6. *
  7. *
  8. * Permission to use, copy, modify, and/or distribute this software for
  9. * any purpose with or without fee is hereby granted, provided that the
  10. * above copyright notice and this permission notice appear in all
  11. * copies.
  12. *
  13. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  14. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  15. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  16. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  17. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  18. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  19. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  20. * PERFORMANCE OF THIS SOFTWARE.
  21. */
  22. /*
  23. * This file was originally distributed by Qualcomm Atheros, Inc.
  24. * under proprietary terms before Copyright ownership was assigned
  25. * to the Linux Foundation.
  26. */
  27. /**
  28. * @file htt.h
  29. *
  30. * @details the public header file of HTT layer
  31. */
  32. #ifndef _HTT_H_
  33. #define _HTT_H_
  34. #include <htt_deps.h>
  35. #include <htt_common.h>
  36. /*
  37. * Unless explicitly specified to use 64 bits to represent physical addresses
  38. * (or more precisely, bus addresses), default to 32 bits.
  39. */
  40. #ifndef HTT_PADDR64
  41. #define HTT_PADDR64 0
  42. #endif
  43. #ifndef offsetof
  44. #define offsetof(type, field) ((unsigned int)(&((type *)0)->field))
  45. #endif
  46. /*
  47. * HTT version history:
  48. * 1.0 initial numbered version
  49. * 1.1 modifications to STATS messages.
  50. * These modifications are not backwards compatible, but since the
  51. * STATS messages themselves are non-essential (they are for debugging),
  52. * the 1.1 version of the HTT message library as a whole is compatible
  53. * with the 1.0 version.
  54. * 1.2 reset mask IE added to STATS_REQ message
  55. * 1.3 stat config IE added to STATS_REQ message
  56. *----
  57. * 2.0 FW rx PPDU desc added to RX_IND message
  58. * 2.1 Enable msdu_ext/frag_desc banking change for WIFI2.0
  59. *----
  60. * 3.0 Remove HTT_H2T_MSG_TYPE_MGMT_TX message
  61. * 3.1 Added HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND message
  62. * 3.2 Added HTT_H2T_MSG_TYPE_WDI_IPA_CFG,
  63. * HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST messages
  64. * 3.3 Added HTT_H2T_MSG_TYPE_AGGR_CFG_EX message
  65. * 3.4 Added tx_compl_req flag in HTT tx descriptor
  66. * 3.5 Added flush and fail stats in rx_reorder stats structure
  67. * 3.6 Added frag flag in HTT RX INORDER PADDR IND header
  68. * 3.7 Made changes to support EOS Mac_core 3.0
  69. * 3.8 Added txq_group information element definition;
  70. * added optional txq_group suffix to TX_CREDIT_UPDATE_IND message
  71. * 3.9 Added HTT_T2H CHAN_CHANGE message;
  72. * Allow buffer addresses in bus-address format to be stored as
  73. * either 32 bits or 64 bits.
  74. * 3.10 Add optional TLV extensions to the VERSION_REQ and VERSION_CONF
  75. * messages to specify which HTT options to use.
  76. * Initial TLV options cover:
  77. * - whether to use 32 or 64 bits to represent LL bus addresses
  78. * - whether to use TX_COMPL_IND or TX_CREDIT_UPDATE_IND in HL systems
  79. * - how many tx queue groups to use
  80. * 3.11 Expand rx debug stats:
  81. * - Expand the rx_reorder_stats struct with stats about successful and
  82. * failed rx buffer allcoations.
  83. * - Add a new rx_remote_buffer_mgmt_stats struct with stats about
  84. * the supply, allocation, use, and recycling of rx buffers for the
  85. * "remote ring" of rx buffers in host member in LL systems.
  86. * Add RX_REMOTE_RING_BUFFER_INFO stats type for uploading these stats.
  87. * 3.12 Add "rx offload packet error" message with initial "MIC error" subtype
  88. * 3.13 Add constants + macros to support 64-bit address format for the
  89. * tx fragments descriptor, the rx ring buffer, and the rx ring
  90. * index shadow register.
  91. * 3.14 Add a method for the host to provide detailed per-frame tx specs:
  92. * - Add htt_tx_msdu_desc_ext_t struct def.
  93. * - Add TLV to specify whether the target supports the HTT tx MSDU
  94. * extension descriptor.
  95. * - Change a reserved bit in the HTT tx MSDU descriptor to an
  96. * "extension" bit, to specify whether a HTT tx MSDU extension
  97. * descriptor is present.
  98. * 3.15 Add HW rx desc info to per-MSDU info elems in RX_IN_ORD_PADDR_IND msg.
  99. * (This allows the host to obtain key information about the MSDU
  100. * from a memory location already in the cache, rather than taking a
  101. * cache miss for each MSDU by reading the HW rx descs.)
  102. * 3.16 Add htt_pkt_type_eth2 and define pkt_subtype flags to indicate
  103. * whether a copy-engine classification result is appended to TX_FRM.
  104. * 3.17 Add a version of the WDI_IPA_CFG message; add RX_RING2 to WDI_IPA_CFG
  105. * 3.18 Add a PEER_DEL tx completion indication status, for HL cleanup of
  106. * tx frames in the target after the peer has already been deleted.
  107. * 3.19 Add HTT_DBG_STATS_RX_RATE_INFO_V2 and HTT_DBG_STATS_TX_RATE_INFO_V2
  108. * 3.20 Expand rx_reorder_stats.
  109. * 3.21 Add optional rx channel spec to HL RX_IND.
  110. * 3.22 Expand rx_reorder_stats
  111. * (distinguish duplicates within vs. outside block ack window)
  112. * 3.23 Add HTT_T2H_MSG_TYPE_RATE_REPORT to report peer justified rate.
  113. * The justified rate is calculated by two steps. The first is to multiply
  114. * user-rate by (1 - PER) and the other is to smooth the step 1's result
  115. * by a low pass filter.
  116. * This change allows HL download scheduling to consider the WLAN rate
  117. * that will be used for transmitting the downloaded frames.
  118. * 3.24 Expand rx_reorder_stats
  119. * (add counter for decrypt / MIC errors)
  120. * 3.25 Expand rx_reorder_stats
  121. * (add counter of frames received into both local + remote rings)
  122. * 3.26 Add stats struct for counting rx of tx BF, MU, SU, and NDPA frames
  123. * (HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT, rx_txbf_musu_ndpa_pkts_stats)
  124. * 3.27 Add a new interface for flow-control. The following t2h messages have
  125. * been included: HTT_T2H_MSG_TYPE_FLOW_POOL_MAP and
  126. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  127. * 3.28 Add a new interface for ring interface change. The following two h2t
  128. * and one t2h messages have been included:
  129. * HTT_H2T_MSG_TYPE_SRING_SETUP, HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG,
  130. * and HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  131. * 3.29 Add definitions of htt_tx_msdu_desc_ext2_t descriptor and other
  132. * information elements passed from the host to a Lithium target,
  133. * Add definitions of the HTT_H2T ADD_WDS_ENTRY and DELETE_WDS_ENTRY
  134. * messages and the HTT_T2H MAP_FLOW_INFO message (for use with Lithium
  135. * targets).
  136. * 3.30 Add pktlog flag inside HTT_T2H RX_IN_ORD_PADDR_IND message
  137. * 3.31 Add HTT_H2T_MSG_TYPE_RFS_CONFIG
  138. * 3.32 Add HTT_WDI_IPA_OPCODE_SHARING_STATS, HTT_WDI_IPA_OPCODE_SET_QUOTA and
  139. * HTT_WDI_IPA_OPCODE_IND_QUOTA for getting quota and reporting WiFi
  140. * sharing stats
  141. * 3.33 Add HTT_TX_COMPL_IND_STAT_DROP and HTT_TX_COMPL_IND_STAT_HOST_INSPECT
  142. * 3.34 Add HW_PEER_ID field to PEER_MAP
  143. * 3.35 Revise bitfield defs of HTT_SRING_SETUP message
  144. * (changes are not backwards compatible, but HTT_SRING_SETUP message is
  145. * not yet in use)
  146. * 3.36 Add HTT_H2T_MSG_TYPE_EXT_STATS_REQ and HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  147. * 3.37 Add HTT_PEER_TYPE and htt_mac_addr defs
  148. * 3.38 Add holes_no_filled field to rx_reorder_stats
  149. * 3.39 Add host_inspected flag to htt_tx_tcl_vdev_metadata
  150. * 3.40 Add optional timestamps in the HTT tx completion
  151. * 3.41 Add optional tx power spec in the HTT tx completion (for DSRC use)
  152. * 3.42 Add PPDU_STATS_CFG + PPDU_STATS_IND
  153. * 3.43 Add HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR defs
  154. * 3.44 Add htt_tx_wbm_completion_v2
  155. * 3.45 Add host_tx_desc_pool flag in htt_tx_msdu_desc_ext2_t
  156. * 3.46 Add MAC ID and payload size fields to HTT_T2H_MSG_TYPE_PKTLOG header
  157. * 3.47 Add HTT_T2H PEER_MAP_V2 and PEER_UNMAP_V2
  158. * 3.48 Add pdev ID field to HTT_T2H_MSG_TYPE_PPDU_STATS_IND and
  159. * HTT_T2H_MSG_TYPE_PKTLOG
  160. * 3.49 Add HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND def
  161. * 3.50 Add learning_frame flag to htt_tx_msdu_desc_ext2_t
  162. * 3.51 Add SW peer ID and TID num to HTT TX WBM COMPLETION
  163. * 3.52 Add HTT_T2H FLOW_POOL_RESIZE msg def
  164. * 3.53 Update HTT_T2H FLOW_POOL_RESIZE msg def
  165. * 3.54 Define mcast and mcast_valid flags within htt_tx_wbm_transmit_status
  166. * 3.55 Add initiator / responder flags to RX_DELBA indication
  167. * 3.56 Fix HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE bit-mask defs
  168. * 3.57 Add support for in-band data within HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  169. * 3.58 Add optional MSDU ack RSSI array to end of HTT_T2H TX_COMPL_IND msg
  170. * 3.59 Add HTT_RXDMA_HOST_BUF_RING2 def
  171. * 3.60 Add HTT_T2H_MSG_TYPE_PEER_STATS_IND def
  172. * 3.61 Add rx offset fields to HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG msg
  173. * 3.62 Add antenna mask to reserved space in htt_rx_ppdu_desc_t
  174. * 3.63 Add HTT_HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND def
  175. * 3.64 Add struct htt_tx_compl_ind_append_tx_tsf64 and add tx_tsf64
  176. * array to the end of HTT_T2H TX_COMPL_IND msg
  177. * 3.65 Add fields in htt_tx_msdu_desc_ext2_t to allow the host to provide
  178. * a "cookie" to identify a MSDU, and to specify to not apply aggregation
  179. * for a MSDU.
  180. * 3.66 Add HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND msg.
  181. * Add PKT_CAPTURE_MODE flag within HTT_T2H TX_I_ORD_PADDR_IND msg.
  182. * 3.67 Add drop threshold field to HTT_H2T RX_RING_SELECTION_CFG msg.
  183. * 3.68 Add ipa_drop threshold fields to HTT_H2T_MSG_TYPE_SRING_SETUP
  184. * 3.69 Add htt_ul_ofdma_user_info_v0 defs
  185. * 3.70 Add AST1-AST3 fields to HTT_T2H PEER_MAP_V2 msg
  186. * 3.71 Add rx offload engine / flow search engine htt setup message defs for
  187. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG, HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  188. * 3.72 Add tx_retry_cnt fields to htt_tx_offload_deliver_ind_hdr_t and
  189. * htt_tx_data_hdr_information
  190. * 3.73 Add channel pre-calibration data upload and download messages defs for
  191. * HTT_T2H_MSG_TYPE_CHAN_CALDATA and HTT_H2T_MSG_TYPE_CHAN_CALDATA
  192. * 3.74 Add HTT_T2H_MSG_TYPE_RX_FISA_CFG msg.
  193. * 3.75 Add fp_ndp and mo_ndp flags in HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG.
  194. * 3.76 Add HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG msg.
  195. * 3.77 Add HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE msg.
  196. * 3.78 Add htt_ppdu_id def.
  197. * 3.79 Add HTT_NUM_AC_WMM def.
  198. * 3.80 Add add WDS_FREE_COUNT bitfield in T2H PEER_UNMAP_V2 msg.
  199. * 3.81 Add ppdu_start_tsf field in HTT_TX_WBM_COMPLETION_V2.
  200. * 3.82 Add WIN_SIZE field to HTT_T2H_MSG_TYPE_RX_DELBA msg.
  201. * 3.83 Shrink seq_idx field in HTT PPDU ID from 3 bits to 2.
  202. * 3.84 Add fisa_control_bits_v2 def.
  203. * 3.85 Add HTT_RX_PEER_META_DATA defs.
  204. * 3.86 Add HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND def.
  205. * 3.87 Add on-chip AST index field to PEER_MAP_V2 msg.
  206. * 3.88 Add HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE def.
  207. * 3.89 Add MSDU queue enumerations.
  208. * 3.90 Add HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND def.
  209. * 3.91 Add HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP, _UNMAP defs.
  210. * 3.92 Add HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG def.
  211. * 3.93 Add HTT_T2H_MSG_TYPE_PEER_MAP_V3 def.
  212. * 3.94 Add HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  213. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND defs.
  214. * 3.95 Add HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  215. * 3.96 Modify HTT_H2T_MSG_TYPE_TX_MONITOR_CFG def.
  216. * 3.97 Add tx MSDU drop byte count fields in vdev_txrx_stats_hw_stats TLV.
  217. * 3.98 Add htt_tx_tcl_metadata_v2 def.
  218. * 3.99 Add HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ, _UNMAP_REQ, _MAP_REPORT_REQ and
  219. * HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF defs.
  220. * 3.100 Add htt_tx_wbm_completion_v3 def.
  221. * 3.101 Add HTT_UL_OFDMA_USER_INFO_V1_BITMAP defs.
  222. * 3.102 Add HTT_H2T_MSG_TYPE_MSI_SETUP def.
  223. * 3.103 Add HTT_T2H_SAWF_MSDUQ_INFO_IND defs.
  224. * 3.104 Add mgmt/ctrl/data specs in rx ring cfg.
  225. * 3.105 Add HTT_H2T STREAMING_STATS_REQ + HTT_T2H STREAMING_STATS_IND defs.
  226. * 3.106 Add HTT_T2H_PPDU_ID_FMT_IND def.
  227. * 3.107 Add traffic_end_indication bitfield in htt_tx_msdu_desc_ext2_t.
  228. * 3.108 Add HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP def.
  229. * 3.109 Add HTT_T2H RX_ADDBA_EXTN,RX_DELBA_EXTN defs.
  230. * 3.110 Add more word_mask fields in htt_tx_monitor_cfg_t.
  231. * 3.111 Add RXPCU filter enable flag in RX_RING_SELECTION_CFG msg.
  232. */
  233. #define HTT_CURRENT_VERSION_MAJOR 3
  234. #define HTT_CURRENT_VERSION_MINOR 111
  235. #define HTT_NUM_TX_FRAG_DESC 1024
  236. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  237. #define HTT_CHECK_SET_VAL(field, val) \
  238. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  239. /* macros to assist in sign-extending fields from HTT messages */
  240. #define HTT_SIGN_BIT_MASK(field) \
  241. ((field ## _M + (1 << field ## _S)) >> 1)
  242. #define HTT_SIGN_BIT(_val, field) \
  243. (_val & HTT_SIGN_BIT_MASK(field))
  244. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  245. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  246. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  247. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  248. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  249. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  250. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  251. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  252. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  253. /*
  254. * TEMPORARY:
  255. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  256. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  257. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  258. * updated.
  259. */
  260. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  261. /*
  262. * TEMPORARY:
  263. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  264. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  265. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  266. * updated.
  267. */
  268. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  269. /**
  270. * htt_dbg_stats_type -
  271. * bit positions for each stats type within a stats type bitmask
  272. * The bitmask contains 24 bits.
  273. */
  274. enum htt_dbg_stats_type {
  275. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  276. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  277. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  278. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  279. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  280. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  281. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  282. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  283. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  284. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  285. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  286. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  287. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  288. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  289. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  290. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  291. /* bits 16-23 currently reserved */
  292. /* keep this last */
  293. HTT_DBG_NUM_STATS
  294. };
  295. /*=== HTT option selection TLVs ===
  296. * Certain HTT messages have alternatives or options.
  297. * For such cases, the host and target need to agree on which option to use.
  298. * Option specification TLVs can be appended to the VERSION_REQ and
  299. * VERSION_CONF messages to select options other than the default.
  300. * These TLVs are entirely optional - if they are not provided, there is a
  301. * well-defined default for each option. If they are provided, they can be
  302. * provided in any order. Each TLV can be present or absent independent of
  303. * the presence / absence of other TLVs.
  304. *
  305. * The HTT option selection TLVs use the following format:
  306. * |31 16|15 8|7 0|
  307. * |---------------------------------+----------------+----------------|
  308. * | value (payload) | length | tag |
  309. * |-------------------------------------------------------------------|
  310. * The value portion need not be only 2 bytes; it can be extended by any
  311. * integer number of 4-byte units. The total length of the TLV, including
  312. * the tag and length fields, must be a multiple of 4 bytes. The length
  313. * field specifies the total TLV size in 4-byte units. Thus, the typical
  314. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  315. * field, would store 0x1 in its length field, to show that the TLV occupies
  316. * a single 4-byte unit.
  317. */
  318. /*--- TLV header format - applies to all HTT option TLVs ---*/
  319. enum HTT_OPTION_TLV_TAGS {
  320. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  321. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  322. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  323. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  324. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  325. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  326. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  327. };
  328. #define HTT_TCL_METADATA_VER_SZ 4
  329. PREPACK struct htt_option_tlv_header_t {
  330. A_UINT8 tag;
  331. A_UINT8 length;
  332. } POSTPACK;
  333. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  334. #define HTT_OPTION_TLV_TAG_S 0
  335. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  336. #define HTT_OPTION_TLV_LENGTH_S 8
  337. /*
  338. * value0 - 16 bit value field stored in word0
  339. * The TLV's value field may be longer than 2 bytes, in which case
  340. * the remainder of the value is stored in word1, word2, etc.
  341. */
  342. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  343. #define HTT_OPTION_TLV_VALUE0_S 16
  344. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  345. do { \
  346. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  347. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  348. } while (0)
  349. #define HTT_OPTION_TLV_TAG_GET(word) \
  350. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  351. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  352. do { \
  353. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  354. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  355. } while (0)
  356. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  357. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  358. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  359. do { \
  360. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  361. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  362. } while (0)
  363. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  364. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  365. /*--- format of specific HTT option TLVs ---*/
  366. /*
  367. * HTT option TLV for specifying LL bus address size
  368. * Some chips require bus addresses used by the target to access buffers
  369. * within the host's memory to be 32 bits; others require bus addresses
  370. * used by the target to access buffers within the host's memory to be
  371. * 64 bits.
  372. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  373. * a suffix to the VERSION_CONF message to specify which bus address format
  374. * the target requires.
  375. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  376. * default to providing bus addresses to the target in 32-bit format.
  377. */
  378. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  379. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  380. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  381. };
  382. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  383. struct htt_option_tlv_header_t hdr;
  384. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  385. } POSTPACK;
  386. /*
  387. * HTT option TLV for specifying whether HL systems should indicate
  388. * over-the-air tx completion for individual frames, or should instead
  389. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  390. * requests an OTA tx completion for a particular tx frame.
  391. * This option does not apply to LL systems, where the TX_COMPL_IND
  392. * is mandatory.
  393. * This option is primarily intended for HL systems in which the tx frame
  394. * downloads over the host --> target bus are as slow as or slower than
  395. * the transmissions over the WLAN PHY. For cases where the bus is faster
  396. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  397. * and consequently will send one TX_COMPL_IND message that covers several
  398. * tx frames. For cases where the WLAN PHY is faster than the bus,
  399. * the target will end up transmitting very short A-MPDUs, and consequently
  400. * sending many TX_COMPL_IND messages, which each cover a very small number
  401. * of tx frames.
  402. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  403. * a suffix to the VERSION_REQ message to request whether the host desires to
  404. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  405. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  406. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  407. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  408. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  409. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  410. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  411. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  412. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  413. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  414. * TLV.
  415. */
  416. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  417. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  418. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  419. };
  420. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  421. struct htt_option_tlv_header_t hdr;
  422. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  423. } POSTPACK;
  424. /*
  425. * HTT option TLV for specifying how many tx queue groups the target
  426. * may establish.
  427. * This TLV specifies the maximum value the target may send in the
  428. * txq_group_id field of any TXQ_GROUP information elements sent by
  429. * the target to the host. This allows the host to pre-allocate an
  430. * appropriate number of tx queue group structs.
  431. *
  432. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  433. * a suffix to the VERSION_REQ message to specify whether the host supports
  434. * tx queue groups at all, and if so if there is any limit on the number of
  435. * tx queue groups that the host supports.
  436. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  437. * a suffix to the VERSION_CONF message. If the host has specified in the
  438. * VER_REQ message a limit on the number of tx queue groups the host can
  439. * support, the target shall limit its specification of the maximum tx groups
  440. * to be no larger than this host-specified limit.
  441. *
  442. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  443. * shall preallocate 4 tx queue group structs, and the target shall not
  444. * specify a txq_group_id larger than 3.
  445. */
  446. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  447. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  448. /*
  449. * values 1 through N specify the max number of tx queue groups
  450. * the sender supports
  451. */
  452. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  453. };
  454. /* TEMPORARY backwards-compatibility alias for a typo fix -
  455. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  456. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  457. * to support the old name (with the typo) until all references to the
  458. * old name are replaced with the new name.
  459. */
  460. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  461. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  462. struct htt_option_tlv_header_t hdr;
  463. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  464. } POSTPACK;
  465. /*
  466. * HTT option TLV for specifying whether the target supports an extended
  467. * version of the HTT tx descriptor. If the target provides this TLV
  468. * and specifies in the TLV that the target supports an extended version
  469. * of the HTT tx descriptor, the target must check the "extension" bit in
  470. * the HTT tx descriptor, and if the extension bit is set, to expect a
  471. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  472. * descriptor. Furthermore, the target must provide room for the HTT
  473. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  474. * This option is intended for systems where the host needs to explicitly
  475. * control the transmission parameters such as tx power for individual
  476. * tx frames.
  477. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  478. * as a suffix to the VERSION_CONF message to explicitly specify whether
  479. * the target supports the HTT tx MSDU extension descriptor.
  480. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  481. * by the host as lack of target support for the HTT tx MSDU extension
  482. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  483. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  484. * the HTT tx MSDU extension descriptor.
  485. * The host is not required to provide the HTT tx MSDU extension descriptor
  486. * just because the target supports it; the target must check the
  487. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  488. * extension descriptor is present.
  489. */
  490. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  491. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  492. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  493. };
  494. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  495. struct htt_option_tlv_header_t hdr;
  496. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  497. } POSTPACK;
  498. /*
  499. * For the tcl data command V2 and higher support added a new
  500. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  501. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  502. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  503. * HTT option TLV for specifying which version of the TCL metadata struct
  504. * should be used:
  505. * V1 -> use htt_tx_tcl_metadata struct
  506. * V2 -> use htt_tx_tcl_metadata_v2 struct
  507. * Old FW will only support V1.
  508. * New FW will support V2. New FW will still support V1, at least during
  509. * a transition period.
  510. * Similarly, old host will only support V1, and new host will support V1 + V2.
  511. *
  512. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  513. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  514. * of TCL metadata the host supports. If the host doesn't provide a
  515. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  516. * is implicitly understood that the host only supports V1.
  517. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  518. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  519. * the host shall use. The target shall only select one of the versions
  520. * supported by the host. If the target doesn't provide a
  521. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  522. * is implicitly understood that the V1 TCL metadata shall be used.
  523. */
  524. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  525. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  526. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  527. };
  528. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  529. struct htt_option_tlv_header_t hdr;
  530. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  531. } POSTPACK;
  532. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  533. HTT_OPTION_TLV_VALUE0_SET(word, value)
  534. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  535. HTT_OPTION_TLV_VALUE0_GET(word)
  536. typedef struct {
  537. union {
  538. /* BIT [11 : 0] :- tag
  539. * BIT [23 : 12] :- length
  540. * BIT [31 : 24] :- reserved
  541. */
  542. A_UINT32 tag__length;
  543. /*
  544. * The following struct is not endian-portable.
  545. * It is suitable for use within the target, which is known to be
  546. * little-endian.
  547. * The host should use the above endian-portable macros to access
  548. * the tag and length bitfields in an endian-neutral manner.
  549. */
  550. struct {
  551. A_UINT32 tag : 12, /* BIT [11 : 0] */
  552. length : 12, /* BIT [23 : 12] */
  553. reserved : 8; /* BIT [31 : 24] */
  554. };
  555. };
  556. } htt_tlv_hdr_t;
  557. /** HTT stats TLV tag values */
  558. typedef enum {
  559. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  560. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  561. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  562. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  563. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  564. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  565. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  566. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  567. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  568. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  569. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  570. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  571. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  572. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  573. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  574. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  575. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  576. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  577. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  578. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  579. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  580. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  581. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  582. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  583. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  584. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  585. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  586. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  587. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  588. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  589. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  590. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  591. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  592. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  593. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  594. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  595. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  596. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  597. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  598. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  599. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  600. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  601. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  602. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  603. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  604. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  605. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  606. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  607. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  608. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  609. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  610. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  611. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  612. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  613. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  614. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  615. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  616. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  617. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  618. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  619. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  620. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  621. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  622. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  623. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  624. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  625. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  626. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  627. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  628. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  629. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  630. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  631. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  632. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  633. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  634. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  635. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  636. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  637. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  638. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  639. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  640. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  641. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  642. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  643. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  644. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  645. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  646. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  647. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  648. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  649. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  650. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  651. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  652. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  653. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  654. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  655. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  656. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  657. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  658. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  659. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  660. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  661. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  662. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  663. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  664. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  665. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  666. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  667. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  668. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  669. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  670. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  671. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  672. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  673. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  674. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  675. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  676. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  677. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  678. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  679. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  680. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  681. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  682. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  683. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  684. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  685. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  686. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  687. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  688. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  689. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  690. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  691. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  692. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  693. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  694. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  695. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  696. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  697. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  698. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  699. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  700. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  701. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  702. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  703. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  704. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  705. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  706. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  707. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  708. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  709. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  710. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  711. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  712. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  713. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  714. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  715. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  716. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  717. HTT_STATS_PDEV_PUNCTURE_STATS_TAG = 158, /* htt_pdev_puncture_stats_tlv */
  718. HTT_STATS_ML_PEER_DETAILS_TAG = 159, /* htt_ml_peer_details_tlv */
  719. HTT_STATS_ML_PEER_EXT_DETAILS_TAG = 160, /* htt_ml_peer_ext_details_tlv */
  720. HTT_STATS_ML_LINK_INFO_DETAILS_TAG = 161, /* htt_ml_link_info_tlv */
  721. HTT_STATS_TX_PDEV_PPDU_DUR_TAG = 162, /* htt_tx_pdev_ppdu_dur_stats_tlv */
  722. HTT_STATS_RX_PDEV_PPDU_DUR_TAG = 163, /* htt_rx_pdev_ppdu_dur_stats_tlv */
  723. HTT_STATS_ODD_PDEV_MANDATORY_TAG = 164, /* htt_odd_mandatory_pdev_stats_tlv */
  724. HTT_STATS_PDEV_SCHED_ALGO_OFDMA_STATS_TAG = 165, /* htt_pdev_sched_algo_ofdma_stats_tlv */
  725. HTT_DBG_ODD_MANDATORY_MUMIMO_TAG = 166, /* htt_odd_mandatory_mumimo_pdev_stats_tlv */
  726. HTT_DBG_ODD_MANDATORY_MUOFDMA_TAG = 167, /* htt_odd_mandatory_muofdma_pdev_stats_tlv */
  727. HTT_STATS_LATENCY_PROF_CAL_STATS_TAG = 168, /* htt_latency_prof_cal_stats_tlv */
  728. HTT_STATS_TX_PDEV_MUEDCA_PARAMS_STATS_TAG = 169, /* htt_tx_pdev_muedca_params_stats_tlv_v */
  729. HTT_STATS_PDEV_BW_MGR_STATS_TAG = 170, /* htt_pdev_bw_mgr_stats_tlv */
  730. HTT_STATS_TX_PDEV_AP_EDCA_PARAMS_STATS_TAG = 171, /* htt_tx_pdev_ap_edca_params_stats_tlv_v */
  731. HTT_STATS_TXBF_OFDMA_AX_STEER_MPDU_STATS_TAG = 172, /* htt_txbf_ofdma_ax_steer_mpdu_stats_tlv */
  732. HTT_STATS_TXBF_OFDMA_BE_STEER_MPDU_STATS_TAG = 173, /* htt_txbf_ofdma_be_steer_mpdu_stats_tlv */
  733. HTT_STATS_MAX_TAG,
  734. } htt_stats_tlv_tag_t;
  735. /* retain deprecated enum name as an alias for the current enum name */
  736. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  737. #define HTT_STATS_TLV_TAG_M 0x00000fff
  738. #define HTT_STATS_TLV_TAG_S 0
  739. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  740. #define HTT_STATS_TLV_LENGTH_S 12
  741. #define HTT_STATS_TLV_TAG_GET(_var) \
  742. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  743. HTT_STATS_TLV_TAG_S)
  744. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  745. do { \
  746. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  747. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  748. } while (0)
  749. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  750. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  751. HTT_STATS_TLV_LENGTH_S)
  752. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  753. do { \
  754. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  755. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  756. } while (0)
  757. /*=== host -> target messages ===============================================*/
  758. enum htt_h2t_msg_type {
  759. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  760. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  761. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  762. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  763. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  764. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  765. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  766. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  767. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  768. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  769. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  770. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  771. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  772. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  773. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  774. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  775. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  776. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  777. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  778. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  779. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  780. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  781. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  782. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  783. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  784. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  785. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  786. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  787. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  788. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  789. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  790. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  791. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  792. HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP = 0x21,
  793. /* keep this last */
  794. HTT_H2T_NUM_MSGS
  795. };
  796. /*
  797. * HTT host to target message type -
  798. * stored in bits 7:0 of the first word of the message
  799. */
  800. #define HTT_H2T_MSG_TYPE_M 0xff
  801. #define HTT_H2T_MSG_TYPE_S 0
  802. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  803. do { \
  804. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  805. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  806. } while (0)
  807. #define HTT_H2T_MSG_TYPE_GET(word) \
  808. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  809. /**
  810. * @brief host -> target version number request message definition
  811. *
  812. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  813. *
  814. *
  815. * |31 24|23 16|15 8|7 0|
  816. * |----------------+----------------+----------------+----------------|
  817. * | reserved | msg type |
  818. * |-------------------------------------------------------------------|
  819. * : option request TLV (optional) |
  820. * :...................................................................:
  821. *
  822. * The VER_REQ message may consist of a single 4-byte word, or may be
  823. * extended with TLVs that specify which HTT options the host is requesting
  824. * from the target.
  825. * The following option TLVs may be appended to the VER_REQ message:
  826. * - HL_SUPPRESS_TX_COMPL_IND
  827. * - HL_MAX_TX_QUEUE_GROUPS
  828. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  829. * may be appended to the VER_REQ message (but only one TLV of each type).
  830. *
  831. * Header fields:
  832. * - MSG_TYPE
  833. * Bits 7:0
  834. * Purpose: identifies this as a version number request message
  835. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  836. */
  837. #define HTT_VER_REQ_BYTES 4
  838. /* TBDXXX: figure out a reasonable number */
  839. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  840. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  841. /**
  842. * @brief HTT tx MSDU descriptor
  843. *
  844. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  845. *
  846. * @details
  847. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  848. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  849. * the target firmware needs for the FW's tx processing, particularly
  850. * for creating the HW msdu descriptor.
  851. * The same HTT tx descriptor is used for HL and LL systems, though
  852. * a few fields within the tx descriptor are used only by LL or
  853. * only by HL.
  854. * The HTT tx descriptor is defined in two manners: by a struct with
  855. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  856. * definitions.
  857. * The target should use the struct def, for simplicitly and clarity,
  858. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  859. * neutral. Specifically, the host shall use the get/set macros built
  860. * around the mask + shift defs.
  861. */
  862. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  863. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  864. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  865. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  866. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  867. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  868. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  869. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  870. #define HTT_TX_VDEV_ID_WORD 0
  871. #define HTT_TX_VDEV_ID_MASK 0x3f
  872. #define HTT_TX_VDEV_ID_SHIFT 16
  873. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  874. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  875. #define HTT_TX_MSDU_LEN_DWORD 1
  876. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  877. /*
  878. * HTT_VAR_PADDR macros
  879. * Allow physical / bus addresses to be either a single 32-bit value,
  880. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  881. */
  882. #define HTT_VAR_PADDR32(var_name) \
  883. A_UINT32 var_name
  884. #define HTT_VAR_PADDR64_LE(var_name) \
  885. struct { \
  886. /* little-endian: lo precedes hi */ \
  887. A_UINT32 lo; \
  888. A_UINT32 hi; \
  889. } var_name
  890. /*
  891. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  892. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  893. * addresses are stored in a XXX-bit field.
  894. * This macro is used to define both htt_tx_msdu_desc32_t and
  895. * htt_tx_msdu_desc64_t structs.
  896. */
  897. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  898. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  899. { \
  900. /* DWORD 0: flags and meta-data */ \
  901. A_UINT32 \
  902. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  903. \
  904. /* pkt_subtype - \
  905. * Detailed specification of the tx frame contents, extending the \
  906. * general specification provided by pkt_type. \
  907. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  908. * pkt_type | pkt_subtype \
  909. * ============================================================== \
  910. * 802.3 | bit 0:3 - Reserved \
  911. * | bit 4: 0x0 - Copy-Engine Classification Results \
  912. * | not appended to the HTT message \
  913. * | 0x1 - Copy-Engine Classification Results \
  914. * | appended to the HTT message in the \
  915. * | format: \
  916. * | [HTT tx desc, frame header, \
  917. * | CE classification results] \
  918. * | The CE classification results begin \
  919. * | at the next 4-byte boundary after \
  920. * | the frame header. \
  921. * ------------+------------------------------------------------- \
  922. * Eth2 | bit 0:3 - Reserved \
  923. * | bit 4: 0x0 - Copy-Engine Classification Results \
  924. * | not appended to the HTT message \
  925. * | 0x1 - Copy-Engine Classification Results \
  926. * | appended to the HTT message. \
  927. * | See the above specification of the \
  928. * | CE classification results location. \
  929. * ------------+------------------------------------------------- \
  930. * native WiFi | bit 0:3 - Reserved \
  931. * | bit 4: 0x0 - Copy-Engine Classification Results \
  932. * | not appended to the HTT message \
  933. * | 0x1 - Copy-Engine Classification Results \
  934. * | appended to the HTT message. \
  935. * | See the above specification of the \
  936. * | CE classification results location. \
  937. * ------------+------------------------------------------------- \
  938. * mgmt | 0x0 - 802.11 MAC header absent \
  939. * | 0x1 - 802.11 MAC header present \
  940. * ------------+------------------------------------------------- \
  941. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  942. * | 0x1 - 802.11 MAC header present \
  943. * | bit 1: 0x0 - allow aggregation \
  944. * | 0x1 - don't allow aggregation \
  945. * | bit 2: 0x0 - perform encryption \
  946. * | 0x1 - don't perform encryption \
  947. * | bit 3: 0x0 - perform tx classification / queuing \
  948. * | 0x1 - don't perform tx classification; \
  949. * | insert the frame into the "misc" \
  950. * | tx queue \
  951. * | bit 4: 0x0 - Copy-Engine Classification Results \
  952. * | not appended to the HTT message \
  953. * | 0x1 - Copy-Engine Classification Results \
  954. * | appended to the HTT message. \
  955. * | See the above specification of the \
  956. * | CE classification results location. \
  957. */ \
  958. pkt_subtype: 5, \
  959. \
  960. /* pkt_type - \
  961. * General specification of the tx frame contents. \
  962. * The htt_pkt_type enum should be used to specify and check the \
  963. * value of this field. \
  964. */ \
  965. pkt_type: 3, \
  966. \
  967. /* vdev_id - \
  968. * ID for the vdev that is sending this tx frame. \
  969. * For certain non-standard packet types, e.g. pkt_type == raw \
  970. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  971. * This field is used primarily for determining where to queue \
  972. * broadcast and multicast frames. \
  973. */ \
  974. vdev_id: 6, \
  975. /* ext_tid - \
  976. * The extended traffic ID. \
  977. * If the TID is unknown, the extended TID is set to \
  978. * HTT_TX_EXT_TID_INVALID. \
  979. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  980. * value of the QoS TID. \
  981. * If the tx frame is non-QoS data, then the extended TID is set to \
  982. * HTT_TX_EXT_TID_NON_QOS. \
  983. * If the tx frame is multicast or broadcast, then the extended TID \
  984. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  985. */ \
  986. ext_tid: 5, \
  987. \
  988. /* postponed - \
  989. * This flag indicates whether the tx frame has been downloaded to \
  990. * the target before but discarded by the target, and now is being \
  991. * downloaded again; or if this is a new frame that is being \
  992. * downloaded for the first time. \
  993. * This flag allows the target to determine the correct order for \
  994. * transmitting new vs. old frames. \
  995. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  996. * This flag only applies to HL systems, since in LL systems, \
  997. * the tx flow control is handled entirely within the target. \
  998. */ \
  999. postponed: 1, \
  1000. \
  1001. /* extension - \
  1002. * This flag indicates whether a HTT tx MSDU extension descriptor \
  1003. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  1004. * \
  1005. * 0x0 - no extension MSDU descriptor is present \
  1006. * 0x1 - an extension MSDU descriptor immediately follows the \
  1007. * regular MSDU descriptor \
  1008. */ \
  1009. extension: 1, \
  1010. \
  1011. /* cksum_offload - \
  1012. * This flag indicates whether checksum offload is enabled or not \
  1013. * for this frame. Target FW use this flag to turn on HW checksumming \
  1014. * 0x0 - No checksum offload \
  1015. * 0x1 - L3 header checksum only \
  1016. * 0x2 - L4 checksum only \
  1017. * 0x3 - L3 header checksum + L4 checksum \
  1018. */ \
  1019. cksum_offload: 2, \
  1020. \
  1021. /* tx_comp_req - \
  1022. * This flag indicates whether Tx Completion \
  1023. * from fw is required or not. \
  1024. * This flag is only relevant if tx completion is not \
  1025. * universally enabled. \
  1026. * For all LL systems, tx completion is mandatory, \
  1027. * so this flag will be irrelevant. \
  1028. * For HL systems tx completion is optional, but HL systems in which \
  1029. * the bus throughput exceeds the WLAN throughput will \
  1030. * probably want to always use tx completion, and thus \
  1031. * would not check this flag. \
  1032. * This flag is required when tx completions are not used universally, \
  1033. * but are still required for certain tx frames for which \
  1034. * an OTA delivery acknowledgment is needed by the host. \
  1035. * In practice, this would be for HL systems in which the \
  1036. * bus throughput is less than the WLAN throughput. \
  1037. * \
  1038. * 0x0 - Tx Completion Indication from Fw not required \
  1039. * 0x1 - Tx Completion Indication from Fw is required \
  1040. */ \
  1041. tx_compl_req: 1; \
  1042. \
  1043. \
  1044. /* DWORD 1: MSDU length and ID */ \
  1045. A_UINT32 \
  1046. len: 16, /* MSDU length, in bytes */ \
  1047. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1048. * and this id is used to calculate fragmentation \
  1049. * descriptor pointer inside the target based on \
  1050. * the base address, configured inside the target. \
  1051. */ \
  1052. \
  1053. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1054. /* frags_desc_ptr - \
  1055. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1056. * where the tx frame's fragments reside in memory. \
  1057. * This field only applies to LL systems, since in HL systems the \
  1058. * (degenerate single-fragment) fragmentation descriptor is created \
  1059. * within the target. \
  1060. */ \
  1061. _paddr__frags_desc_ptr_; \
  1062. \
  1063. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1064. /* \
  1065. * Peer ID : Target can use this value to know which peer-id packet \
  1066. * destined to. \
  1067. * It's intended to be specified by host in case of NAWDS. \
  1068. */ \
  1069. A_UINT16 peerid; \
  1070. \
  1071. /* \
  1072. * Channel frequency: This identifies the desired channel \
  1073. * frequency (in mhz) for tx frames. This is used by FW to help \
  1074. * determine when it is safe to transmit or drop frames for \
  1075. * off-channel operation. \
  1076. * The default value of zero indicates to FW that the corresponding \
  1077. * VDEV's home channel (if there is one) is the desired channel \
  1078. * frequency. \
  1079. */ \
  1080. A_UINT16 chanfreq; \
  1081. \
  1082. /* Reason reserved is commented is increasing the htt structure size \
  1083. * leads to some weird issues. \
  1084. * A_UINT32 reserved_dword3_bits0_31; \
  1085. */ \
  1086. } POSTPACK
  1087. /* define a htt_tx_msdu_desc32_t type */
  1088. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1089. /* define a htt_tx_msdu_desc64_t type */
  1090. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1091. /*
  1092. * Make htt_tx_msdu_desc_t be an alias for either
  1093. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1094. */
  1095. #if HTT_PADDR64
  1096. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1097. #else
  1098. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1099. #endif
  1100. /* decriptor information for Management frame*/
  1101. /*
  1102. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1103. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1104. */
  1105. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1106. extern A_UINT32 mgmt_hdr_len;
  1107. PREPACK struct htt_mgmt_tx_desc_t {
  1108. A_UINT32 msg_type;
  1109. #if HTT_PADDR64
  1110. A_UINT64 frag_paddr; /* DMAble address of the data */
  1111. #else
  1112. A_UINT32 frag_paddr; /* DMAble address of the data */
  1113. #endif
  1114. A_UINT32 desc_id; /* returned to host during completion
  1115. * to free the meory*/
  1116. A_UINT32 len; /* Fragment length */
  1117. A_UINT32 vdev_id; /* virtual device ID*/
  1118. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1119. } POSTPACK;
  1120. PREPACK struct htt_mgmt_tx_compl_ind {
  1121. A_UINT32 desc_id;
  1122. A_UINT32 status;
  1123. } POSTPACK;
  1124. /*
  1125. * This SDU header size comes from the summation of the following:
  1126. * 1. Max of:
  1127. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1128. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1129. * b. 802.11 header, for raw frames: 36 bytes
  1130. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1131. * QoS header, HT header)
  1132. * c. 802.3 header, for ethernet frames: 14 bytes
  1133. * (destination address, source address, ethertype / length)
  1134. * 2. Max of:
  1135. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1136. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1137. * 3. 802.1Q VLAN header: 4 bytes
  1138. * 4. LLC/SNAP header: 8 bytes
  1139. */
  1140. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1141. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1142. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1143. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1144. A_COMPILE_TIME_ASSERT(
  1145. htt_encap_hdr_size_max_check_nwifi,
  1146. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1147. A_COMPILE_TIME_ASSERT(
  1148. htt_encap_hdr_size_max_check_enet,
  1149. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1150. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1151. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1152. #define HTT_TX_HDR_SIZE_802_1Q 4
  1153. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1154. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1155. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1156. HTT_TX_HDR_SIZE_802_1Q + \
  1157. HTT_TX_HDR_SIZE_LLC_SNAP)
  1158. #define HTT_HL_TX_FRM_HDR_LEN \
  1159. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1160. #define HTT_LL_TX_FRM_HDR_LEN \
  1161. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1162. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1163. /* dword 0 */
  1164. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1165. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1166. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1167. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1168. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1169. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1170. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1171. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1172. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1173. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1174. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1175. #define HTT_TX_DESC_PKT_TYPE_S 13
  1176. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1177. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1178. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1179. #define HTT_TX_DESC_VDEV_ID_S 16
  1180. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1181. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1182. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1183. #define HTT_TX_DESC_EXT_TID_S 22
  1184. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1185. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1186. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1187. #define HTT_TX_DESC_POSTPONED_S 27
  1188. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1189. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1190. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1191. #define HTT_TX_DESC_EXTENSION_S 28
  1192. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1193. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1194. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1195. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1196. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1197. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1198. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1199. #define HTT_TX_DESC_TX_COMP_S 31
  1200. /* dword 1 */
  1201. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1202. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1203. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1204. #define HTT_TX_DESC_FRM_LEN_S 0
  1205. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1206. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1207. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1208. #define HTT_TX_DESC_FRM_ID_S 16
  1209. /* dword 2 */
  1210. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1211. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1212. /* for systems using 64-bit format for bus addresses */
  1213. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1214. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1215. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1216. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1217. /* for systems using 32-bit format for bus addresses */
  1218. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1219. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1220. /* dword 3 */
  1221. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1222. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1223. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1224. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1225. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1226. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1227. #if HTT_PADDR64
  1228. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1229. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1230. #else
  1231. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1232. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1233. #endif
  1234. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1235. #define HTT_TX_DESC_PEER_ID_S 0
  1236. /*
  1237. * TEMPORARY:
  1238. * The original definitions for the PEER_ID fields contained typos
  1239. * (with _DESC_PADDR appended to this PEER_ID field name).
  1240. * Retain deprecated original names for PEER_ID fields until all code that
  1241. * refers to them has been updated.
  1242. */
  1243. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1244. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1245. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1246. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1247. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1248. HTT_TX_DESC_PEER_ID_M
  1249. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1250. HTT_TX_DESC_PEER_ID_S
  1251. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1252. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1253. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1254. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1255. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1256. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1257. #if HTT_PADDR64
  1258. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1259. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1260. #else
  1261. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1262. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1263. #endif
  1264. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1265. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1266. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1267. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1268. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1269. do { \
  1270. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1271. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1272. } while (0)
  1273. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1274. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1275. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1276. do { \
  1277. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1278. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1279. } while (0)
  1280. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1281. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1282. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1283. do { \
  1284. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1285. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1286. } while (0)
  1287. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1288. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1289. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1290. do { \
  1291. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1292. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1293. } while (0)
  1294. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1295. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1296. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1297. do { \
  1298. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1299. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1300. } while (0)
  1301. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1302. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1303. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1304. do { \
  1305. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1306. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1307. } while (0)
  1308. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1309. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1310. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1311. do { \
  1312. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1313. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1314. } while (0)
  1315. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1316. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1317. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1318. do { \
  1319. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1320. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1321. } while (0)
  1322. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1323. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1324. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1325. do { \
  1326. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1327. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1328. } while (0)
  1329. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1330. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1331. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1332. do { \
  1333. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1334. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1335. } while (0)
  1336. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1337. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1338. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1339. do { \
  1340. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1341. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1342. } while (0)
  1343. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1344. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1345. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1346. do { \
  1347. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1348. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1349. } while (0)
  1350. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1351. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1352. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1353. do { \
  1354. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1355. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1356. } while (0)
  1357. /* enums used in the HTT tx MSDU extension descriptor */
  1358. enum {
  1359. htt_tx_guard_interval_regular = 0,
  1360. htt_tx_guard_interval_short = 1,
  1361. };
  1362. enum {
  1363. htt_tx_preamble_type_ofdm = 0,
  1364. htt_tx_preamble_type_cck = 1,
  1365. htt_tx_preamble_type_ht = 2,
  1366. htt_tx_preamble_type_vht = 3,
  1367. };
  1368. enum {
  1369. htt_tx_bandwidth_5MHz = 0,
  1370. htt_tx_bandwidth_10MHz = 1,
  1371. htt_tx_bandwidth_20MHz = 2,
  1372. htt_tx_bandwidth_40MHz = 3,
  1373. htt_tx_bandwidth_80MHz = 4,
  1374. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1375. };
  1376. /**
  1377. * @brief HTT tx MSDU extension descriptor
  1378. * @details
  1379. * If the target supports HTT tx MSDU extension descriptors, the host has
  1380. * the option of appending the following struct following the regular
  1381. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1382. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1383. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1384. * tx specs for each frame.
  1385. */
  1386. PREPACK struct htt_tx_msdu_desc_ext_t {
  1387. /* DWORD 0: flags */
  1388. A_UINT32
  1389. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1390. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1391. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1392. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1393. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1394. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1395. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1396. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1397. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1398. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1399. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1400. /* DWORD 1: tx power, tx rate, tx BW */
  1401. A_UINT32
  1402. /* pwr -
  1403. * Specify what power the tx frame needs to be transmitted at.
  1404. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1405. * The value needs to be appropriately sign-extended when extracting
  1406. * the value from the message and storing it in a variable that is
  1407. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1408. * automatically handles this sign-extension.)
  1409. * If the transmission uses multiple tx chains, this power spec is
  1410. * the total transmit power, assuming incoherent combination of
  1411. * per-chain power to produce the total power.
  1412. */
  1413. pwr: 8,
  1414. /* mcs_mask -
  1415. * Specify the allowable values for MCS index (modulation and coding)
  1416. * to use for transmitting the frame.
  1417. *
  1418. * For HT / VHT preamble types, this mask directly corresponds to
  1419. * the HT or VHT MCS indices that are allowed. For each bit N set
  1420. * within the mask, MCS index N is allowed for transmitting the frame.
  1421. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1422. * rates versus OFDM rates, so the host has the option of specifying
  1423. * that the target must transmit the frame with CCK or OFDM rates
  1424. * (not HT or VHT), but leaving the decision to the target whether
  1425. * to use CCK or OFDM.
  1426. *
  1427. * For CCK and OFDM, the bits within this mask are interpreted as
  1428. * follows:
  1429. * bit 0 -> CCK 1 Mbps rate is allowed
  1430. * bit 1 -> CCK 2 Mbps rate is allowed
  1431. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1432. * bit 3 -> CCK 11 Mbps rate is allowed
  1433. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1434. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1435. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1436. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1437. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1438. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1439. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1440. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1441. *
  1442. * The MCS index specification needs to be compatible with the
  1443. * bandwidth mask specification. For example, a MCS index == 9
  1444. * specification is inconsistent with a preamble type == VHT,
  1445. * Nss == 1, and channel bandwidth == 20 MHz.
  1446. *
  1447. * Furthermore, the host has only a limited ability to specify to
  1448. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1449. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1450. */
  1451. mcs_mask: 12,
  1452. /* nss_mask -
  1453. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1454. * Each bit in this mask corresponds to a Nss value:
  1455. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1456. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1457. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1458. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1459. * The values in the Nss mask must be suitable for the recipient, e.g.
  1460. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1461. * recipient which only supports 2x2 MIMO.
  1462. */
  1463. nss_mask: 4,
  1464. /* guard_interval -
  1465. * Specify a htt_tx_guard_interval enum value to indicate whether
  1466. * the transmission should use a regular guard interval or a
  1467. * short guard interval.
  1468. */
  1469. guard_interval: 1,
  1470. /* preamble_type_mask -
  1471. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1472. * may choose from for transmitting this frame.
  1473. * The bits in this mask correspond to the values in the
  1474. * htt_tx_preamble_type enum. For example, to allow the target
  1475. * to transmit the frame as either CCK or OFDM, this field would
  1476. * be set to
  1477. * (1 << htt_tx_preamble_type_ofdm) |
  1478. * (1 << htt_tx_preamble_type_cck)
  1479. */
  1480. preamble_type_mask: 4,
  1481. reserved1_31_29: 3; /* unused, set to 0x0 */
  1482. /* DWORD 2: tx chain mask, tx retries */
  1483. A_UINT32
  1484. /* chain_mask - specify which chains to transmit from */
  1485. chain_mask: 4,
  1486. /* retry_limit -
  1487. * Specify the maximum number of transmissions, including the
  1488. * initial transmission, to attempt before giving up if no ack
  1489. * is received.
  1490. * If the tx rate is specified, then all retries shall use the
  1491. * same rate as the initial transmission.
  1492. * If no tx rate is specified, the target can choose whether to
  1493. * retain the original rate during the retransmissions, or to
  1494. * fall back to a more robust rate.
  1495. */
  1496. retry_limit: 4,
  1497. /* bandwidth_mask -
  1498. * Specify what channel widths may be used for the transmission.
  1499. * A value of zero indicates "don't care" - the target may choose
  1500. * the transmission bandwidth.
  1501. * The bits within this mask correspond to the htt_tx_bandwidth
  1502. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1503. * The bandwidth_mask must be consistent with the preamble_type_mask
  1504. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1505. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1506. */
  1507. bandwidth_mask: 6,
  1508. reserved2_31_14: 18; /* unused, set to 0x0 */
  1509. /* DWORD 3: tx expiry time (TSF) LSBs */
  1510. A_UINT32 expire_tsf_lo;
  1511. /* DWORD 4: tx expiry time (TSF) MSBs */
  1512. A_UINT32 expire_tsf_hi;
  1513. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1514. } POSTPACK;
  1515. /* DWORD 0 */
  1516. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1517. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1518. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1519. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1520. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1521. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1522. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1523. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1524. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1525. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1526. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1527. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1528. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1529. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1530. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1531. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1532. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1533. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1535. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1536. /* DWORD 1 */
  1537. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1538. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1539. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1540. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1541. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1542. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1543. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1544. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1545. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1546. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1547. /* DWORD 2 */
  1548. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1549. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1550. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1551. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1552. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1553. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1554. /* DWORD 0 */
  1555. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1556. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1557. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1558. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1559. do { \
  1560. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1561. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1562. } while (0)
  1563. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1564. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1565. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1566. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1567. do { \
  1568. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1569. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1570. } while (0)
  1571. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1572. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1573. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1574. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1575. do { \
  1576. HTT_CHECK_SET_VAL( \
  1577. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1578. ((_var) |= ((_val) \
  1579. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1580. } while (0)
  1581. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1582. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1583. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1584. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1585. do { \
  1586. HTT_CHECK_SET_VAL( \
  1587. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1588. ((_var) |= ((_val) \
  1589. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1590. } while (0)
  1591. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1592. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1593. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1594. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1595. do { \
  1596. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1597. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1598. } while (0)
  1599. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1600. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1601. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1602. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1603. do { \
  1604. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1605. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1606. } while (0)
  1607. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1608. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1609. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1610. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1611. do { \
  1612. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1613. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1614. } while (0)
  1615. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1616. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1617. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1618. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1619. do { \
  1620. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1621. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1622. } while (0)
  1623. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1624. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1625. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1626. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1627. do { \
  1628. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1629. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1630. } while (0)
  1631. /* DWORD 1 */
  1632. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1633. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1634. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1635. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1636. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1637. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1638. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1639. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1640. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1641. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1642. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1643. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1644. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1645. do { \
  1646. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1647. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1648. } while (0)
  1649. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1650. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1651. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1652. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1653. do { \
  1654. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1655. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1656. } while (0)
  1657. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1658. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1659. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1660. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1661. do { \
  1662. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1663. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1664. } while (0)
  1665. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1666. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1667. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1668. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1669. do { \
  1670. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1671. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1672. } while (0)
  1673. /* DWORD 2 */
  1674. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1675. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1676. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1677. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1678. do { \
  1679. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1680. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1681. } while (0)
  1682. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1683. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1684. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1685. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1686. do { \
  1687. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1688. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1689. } while (0)
  1690. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1691. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1692. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1693. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1694. do { \
  1695. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1696. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1697. } while (0)
  1698. typedef enum {
  1699. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1700. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1701. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1702. } htt_11ax_ltf_subtype_t;
  1703. typedef enum {
  1704. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1705. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1706. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1707. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1708. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1709. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1710. } htt_tx_ext2_preamble_type_t;
  1711. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1712. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1713. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1714. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1715. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1716. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1717. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1718. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1719. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1720. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1721. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1722. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1723. /**
  1724. * @brief HTT tx MSDU extension descriptor v2
  1725. * @details
  1726. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1727. * is received as tcl_exit_base->host_meta_info in firmware.
  1728. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1729. * are already part of tcl_exit_base.
  1730. */
  1731. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1732. /* DWORD 0: flags */
  1733. A_UINT32
  1734. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1735. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1736. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1737. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1738. valid_retries : 1, /* if set, tx retries spec is valid */
  1739. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1740. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1741. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1742. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1743. valid_key_flags : 1, /* if set, key flags is valid */
  1744. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1745. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1746. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1747. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1748. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1749. 1 = ENCRYPT,
  1750. 2 ~ 3 - Reserved */
  1751. /* retry_limit -
  1752. * Specify the maximum number of transmissions, including the
  1753. * initial transmission, to attempt before giving up if no ack
  1754. * is received.
  1755. * If the tx rate is specified, then all retries shall use the
  1756. * same rate as the initial transmission.
  1757. * If no tx rate is specified, the target can choose whether to
  1758. * retain the original rate during the retransmissions, or to
  1759. * fall back to a more robust rate.
  1760. */
  1761. retry_limit : 4,
  1762. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1763. * Valid only for 11ax preamble types HE_SU
  1764. * and HE_EXT_SU
  1765. */
  1766. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1767. * Valid only for 11ax preamble types HE_SU
  1768. * and HE_EXT_SU
  1769. */
  1770. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1771. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1772. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1773. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1774. */
  1775. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1776. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1777. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1778. * Use cases:
  1779. * Any time firmware uses TQM-BYPASS for Data
  1780. * TID, firmware expect host to set this bit.
  1781. */
  1782. /* DWORD 1: tx power, tx rate */
  1783. A_UINT32
  1784. power : 8, /* unit of the power field is 0.5 dbm
  1785. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1786. * signed value ranging from -64dbm to 63.5 dbm
  1787. */
  1788. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1789. * Setting more than one MCS isn't currently
  1790. * supported by the target (but is supported
  1791. * in the interface in case in the future
  1792. * the target supports specifications of
  1793. * a limited set of MCS values.
  1794. */
  1795. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1796. * Setting more than one Nss isn't currently
  1797. * supported by the target (but is supported
  1798. * in the interface in case in the future
  1799. * the target supports specifications of
  1800. * a limited set of Nss values.
  1801. */
  1802. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1803. update_peer_cache : 1; /* When set these custom values will be
  1804. * used for all packets, until the next
  1805. * update via this ext header.
  1806. * This is to make sure not all packets
  1807. * need to include this header.
  1808. */
  1809. /* DWORD 2: tx chain mask, tx retries */
  1810. A_UINT32
  1811. /* chain_mask - specify which chains to transmit from */
  1812. chain_mask : 8,
  1813. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1814. * TODO: Update Enum values for key_flags
  1815. */
  1816. /*
  1817. * Channel frequency: This identifies the desired channel
  1818. * frequency (in MHz) for tx frames. This is used by FW to help
  1819. * determine when it is safe to transmit or drop frames for
  1820. * off-channel operation.
  1821. * The default value of zero indicates to FW that the corresponding
  1822. * VDEV's home channel (if there is one) is the desired channel
  1823. * frequency.
  1824. */
  1825. chanfreq : 16;
  1826. /* DWORD 3: tx expiry time (TSF) LSBs */
  1827. A_UINT32 expire_tsf_lo;
  1828. /* DWORD 4: tx expiry time (TSF) MSBs */
  1829. A_UINT32 expire_tsf_hi;
  1830. /* DWORD 5: flags to control routing / processing of the MSDU */
  1831. A_UINT32
  1832. /* learning_frame
  1833. * When this flag is set, this frame will be dropped by FW
  1834. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1835. */
  1836. learning_frame : 1,
  1837. /* send_as_standalone
  1838. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1839. * i.e. with no A-MSDU or A-MPDU aggregation.
  1840. * The scope is extended to other use-cases.
  1841. */
  1842. send_as_standalone : 1,
  1843. /* is_host_opaque_valid
  1844. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1845. * with valid information.
  1846. */
  1847. is_host_opaque_valid : 1,
  1848. traffic_end_indication: 1,
  1849. rsvd0 : 28;
  1850. /* DWORD 6 : Host opaque cookie for special frames */
  1851. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1852. rsvd1 : 16;
  1853. /*
  1854. * This structure can be expanded further up to 40 bytes
  1855. * by adding further DWORDs as needed.
  1856. */
  1857. } POSTPACK;
  1858. /* DWORD 0 */
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1864. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1865. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1866. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1867. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1868. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1869. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1870. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1871. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1872. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1873. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1874. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1875. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1876. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1877. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1878. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1879. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1880. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1881. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1882. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1883. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1884. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1885. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1886. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1887. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1888. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1889. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1890. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1891. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1892. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1893. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1894. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1895. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1896. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1897. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1898. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1899. /* DWORD 1 */
  1900. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1901. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1902. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1903. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1904. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1905. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1906. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1907. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1908. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1909. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1910. /* DWORD 2 */
  1911. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1912. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1913. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1914. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1915. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1916. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1917. /* DWORD 5 */
  1918. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1919. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1920. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1921. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1922. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1923. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1924. /* DWORD 6 */
  1925. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1926. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1927. /* DWORD 0 */
  1928. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1929. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1930. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1931. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1932. do { \
  1933. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1934. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1935. } while (0)
  1936. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1937. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1938. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1939. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1940. do { \
  1941. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1942. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1943. } while (0)
  1944. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1945. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1946. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1947. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1948. do { \
  1949. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1950. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1951. } while (0)
  1952. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1953. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1954. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1955. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1956. do { \
  1957. HTT_CHECK_SET_VAL( \
  1958. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1959. ((_var) |= ((_val) \
  1960. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1961. } while (0)
  1962. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1963. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1964. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1965. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1966. do { \
  1967. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1968. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1969. } while (0)
  1970. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1971. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1972. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1973. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1974. do { \
  1975. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1976. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1977. } while (0)
  1978. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1979. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1980. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1981. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1982. do { \
  1983. HTT_CHECK_SET_VAL( \
  1984. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1985. ((_var) |= ((_val) \
  1986. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1987. } while (0)
  1988. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1989. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1990. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1991. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1992. do { \
  1993. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1994. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1995. } while (0)
  1996. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1997. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1998. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1999. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  2000. do { \
  2001. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  2002. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  2003. } while (0)
  2004. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  2005. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  2006. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  2007. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  2008. do { \
  2009. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  2010. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  2011. } while (0)
  2012. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  2013. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  2014. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  2015. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  2016. do { \
  2017. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  2018. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  2019. } while (0)
  2020. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2021. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2022. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2023. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2024. do { \
  2025. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2026. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2027. } while (0)
  2028. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2029. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2030. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2031. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2032. do { \
  2033. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2034. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2035. } while (0)
  2036. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2037. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2038. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2039. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2040. do { \
  2041. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2042. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2043. } while (0)
  2044. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2045. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2046. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2047. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2048. do { \
  2049. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2050. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2051. } while (0)
  2052. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2053. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2054. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2055. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2056. do { \
  2057. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2058. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2059. } while (0)
  2060. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2061. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2062. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2063. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2064. do { \
  2065. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2066. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2067. } while (0)
  2068. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2069. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2070. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2071. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2072. do { \
  2073. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2074. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2075. } while (0)
  2076. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2077. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2078. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2079. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2080. do { \
  2081. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2082. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2083. } while (0)
  2084. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2085. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2086. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2087. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2088. do { \
  2089. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2090. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2091. } while (0)
  2092. /* DWORD 1 */
  2093. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2094. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2095. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2096. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2097. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2098. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2099. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2100. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2101. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2102. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2103. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2104. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2105. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2106. do { \
  2107. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2108. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2109. } while (0)
  2110. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2111. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2112. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2113. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2114. do { \
  2115. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2116. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2117. } while (0)
  2118. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2119. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2120. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2121. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2122. do { \
  2123. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2124. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2125. } while (0)
  2126. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2127. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2128. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2129. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2130. do { \
  2131. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2132. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2133. } while (0)
  2134. /* DWORD 2 */
  2135. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2136. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2137. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2138. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2139. do { \
  2140. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2141. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2142. } while (0)
  2143. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2144. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2145. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2146. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2147. do { \
  2148. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2149. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2150. } while (0)
  2151. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2152. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2153. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2154. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2155. do { \
  2156. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2157. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2158. } while (0)
  2159. /* DWORD 5 */
  2160. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2161. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2162. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2163. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2164. do { \
  2165. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2166. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2167. } while (0)
  2168. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2169. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2170. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2171. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2172. do { \
  2173. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2174. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2175. } while (0)
  2176. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2177. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2178. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2179. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2180. do { \
  2181. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2182. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2183. } while (0)
  2184. /* DWORD 6 */
  2185. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2186. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2187. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2188. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2189. do { \
  2190. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2191. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2192. } while (0)
  2193. typedef enum {
  2194. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2195. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2196. } htt_tcl_metadata_type;
  2197. /**
  2198. * @brief HTT TCL command number format
  2199. * @details
  2200. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2201. * available to firmware as tcl_exit_base->tcl_status_number.
  2202. * For regular / multicast packets host will send vdev and mac id and for
  2203. * NAWDS packets, host will send peer id.
  2204. * A_UINT32 is used to avoid endianness conversion problems.
  2205. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2206. */
  2207. typedef struct {
  2208. A_UINT32
  2209. type: 1, /* vdev_id based or peer_id based */
  2210. rsvd: 31;
  2211. } htt_tx_tcl_vdev_or_peer_t;
  2212. typedef struct {
  2213. A_UINT32
  2214. type: 1, /* vdev_id based or peer_id based */
  2215. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2216. vdev_id: 8,
  2217. pdev_id: 2,
  2218. host_inspected:1,
  2219. rsvd: 19;
  2220. } htt_tx_tcl_vdev_metadata;
  2221. typedef struct {
  2222. A_UINT32
  2223. type: 1, /* vdev_id based or peer_id based */
  2224. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2225. peer_id: 14,
  2226. rsvd: 16;
  2227. } htt_tx_tcl_peer_metadata;
  2228. PREPACK struct htt_tx_tcl_metadata {
  2229. union {
  2230. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2231. htt_tx_tcl_vdev_metadata vdev_meta;
  2232. htt_tx_tcl_peer_metadata peer_meta;
  2233. };
  2234. } POSTPACK;
  2235. /* DWORD 0 */
  2236. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2237. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2238. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2239. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2240. /* VDEV metadata */
  2241. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2242. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2243. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2244. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2245. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2246. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2247. /* PEER metadata */
  2248. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2249. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2250. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2251. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2252. HTT_TX_TCL_METADATA_TYPE_S)
  2253. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2254. do { \
  2255. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2256. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2257. } while (0)
  2258. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2259. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2260. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2261. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2262. do { \
  2263. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2264. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2265. } while (0)
  2266. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2267. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2268. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2269. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2270. do { \
  2271. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2272. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2273. } while (0)
  2274. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2275. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2276. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2277. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2278. do { \
  2279. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2280. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2281. } while (0)
  2282. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2283. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2284. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2285. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2286. do { \
  2287. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2288. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2289. } while (0)
  2290. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2291. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2292. HTT_TX_TCL_METADATA_PEER_ID_S)
  2293. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2294. do { \
  2295. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2296. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2297. } while (0)
  2298. /*------------------------------------------------------------------
  2299. * V2 Version of TCL Data Command
  2300. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2301. * MLO global_seq all flavours of TCL Data Cmd.
  2302. *-----------------------------------------------------------------*/
  2303. typedef enum {
  2304. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2305. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2306. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2307. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2308. } htt_tcl_metadata_type_v2;
  2309. /**
  2310. * @brief HTT TCL command number format
  2311. * @details
  2312. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2313. * available to firmware as tcl_exit_base->tcl_status_number.
  2314. * A_UINT32 is used to avoid endianness conversion problems.
  2315. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2316. */
  2317. typedef struct {
  2318. A_UINT32
  2319. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2320. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2321. vdev_id: 8,
  2322. pdev_id: 2,
  2323. host_inspected:1,
  2324. rsvd: 2,
  2325. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2326. } htt_tx_tcl_vdev_metadata_v2;
  2327. typedef struct {
  2328. A_UINT32
  2329. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2330. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2331. peer_id: 13,
  2332. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2333. } htt_tx_tcl_peer_metadata_v2;
  2334. typedef struct {
  2335. A_UINT32
  2336. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2337. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2338. svc_class_id: 8,
  2339. rsvd: 5,
  2340. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2341. } htt_tx_tcl_svc_class_id_metadata;
  2342. typedef struct {
  2343. A_UINT32
  2344. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2345. host_inspected: 1,
  2346. global_seq_no: 12,
  2347. rsvd: 1,
  2348. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2349. } htt_tx_tcl_global_seq_metadata;
  2350. PREPACK struct htt_tx_tcl_metadata_v2 {
  2351. union {
  2352. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2353. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2354. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2355. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2356. };
  2357. } POSTPACK;
  2358. /* DWORD 0 */
  2359. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2360. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2361. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2362. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2363. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2364. /* VDEV V2 metadata */
  2365. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2366. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2367. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2368. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2369. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2370. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2371. /* PEER V2 metadata */
  2372. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2373. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2374. /* SVC_CLASS_ID metadata */
  2375. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2376. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2377. /* Global Seq no metadata */
  2378. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2379. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2380. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2381. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2382. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2383. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2384. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2385. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2386. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2387. do { \
  2388. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2389. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2390. } while (0)
  2391. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2392. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2393. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2394. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2395. do { \
  2396. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2397. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2398. } while (0)
  2399. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2400. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2401. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2402. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2403. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2404. do { \
  2405. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2406. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2407. } while (0)
  2408. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2409. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2410. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2411. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2412. do { \
  2413. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2414. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2415. } while (0)
  2416. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2417. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2418. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2419. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2420. do { \
  2421. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2422. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2423. } while (0)
  2424. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2425. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2426. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2427. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2428. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2429. do { \
  2430. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2431. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2432. } while (0)
  2433. /*----- Get and Set V2 type field in Service Class fields ----*/
  2434. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2435. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2436. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2437. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2438. do { \
  2439. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2440. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2441. } while (0)
  2442. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2443. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2444. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2445. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2446. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2447. do { \
  2448. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2449. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2450. } while (0)
  2451. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2452. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2453. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2454. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2455. do { \
  2456. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2457. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2458. } while (0)
  2459. /*------------------------------------------------------------------
  2460. * End V2 Version of TCL Data Command
  2461. *-----------------------------------------------------------------*/
  2462. typedef enum {
  2463. HTT_TX_FW2WBM_TX_STATUS_OK,
  2464. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2465. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2466. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2467. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2468. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2469. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2470. HTT_TX_FW2WBM_TX_STATUS_MAX
  2471. } htt_tx_fw2wbm_tx_status_t;
  2472. typedef enum {
  2473. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2474. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2475. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2476. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2477. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2478. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2479. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2480. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2481. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2482. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2483. } htt_tx_fw2wbm_reinject_reason_t;
  2484. /**
  2485. * @brief HTT TX WBM Completion from firmware to host
  2486. * @details
  2487. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2488. * DWORD 3 and 4 for software based completions (Exception frames and
  2489. * TQM bypass frames)
  2490. * For software based completions, wbm_release_ring->release_source_module will
  2491. * be set to release_source_fw
  2492. */
  2493. PREPACK struct htt_tx_wbm_completion {
  2494. A_UINT32
  2495. sch_cmd_id: 24,
  2496. exception_frame: 1, /* If set, this packet was queued via exception path */
  2497. rsvd0_31_25: 7;
  2498. A_UINT32
  2499. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2500. * reception of an ACK or BA, this field indicates
  2501. * the RSSI of the received ACK or BA frame.
  2502. * When the frame is removed as result of a direct
  2503. * remove command from the SW, this field is set
  2504. * to 0x0 (which is never a valid value when real
  2505. * RSSI is available).
  2506. * Units: dB w.r.t noise floor
  2507. */
  2508. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2509. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2510. rsvd1_31_16: 16;
  2511. } POSTPACK;
  2512. /* DWORD 0 */
  2513. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2514. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2515. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2516. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2517. /* DWORD 1 */
  2518. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2519. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2520. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2521. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2522. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2523. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2524. /* DWORD 0 */
  2525. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2526. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2527. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2528. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2529. do { \
  2530. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2531. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2532. } while (0)
  2533. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2534. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2535. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2536. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2537. do { \
  2538. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2539. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2540. } while (0)
  2541. /* DWORD 1 */
  2542. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2543. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2544. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2545. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2546. do { \
  2547. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2548. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2549. } while (0)
  2550. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2551. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2552. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2553. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2554. do { \
  2555. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2556. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2557. } while (0)
  2558. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2559. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2560. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2561. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2562. do { \
  2563. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2564. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2565. } while (0)
  2566. /**
  2567. * @brief HTT TX WBM Completion from firmware to host
  2568. * @details
  2569. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2570. * (WBM) offload HW.
  2571. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2572. * For software based completions, release_source_module will
  2573. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2574. * struct wbm_release_ring and then switch to this after looking at
  2575. * release_source_module.
  2576. */
  2577. PREPACK struct htt_tx_wbm_completion_v2 {
  2578. A_UINT32
  2579. used_by_hw0; /* Refer to struct wbm_release_ring */
  2580. A_UINT32
  2581. used_by_hw1; /* Refer to struct wbm_release_ring */
  2582. A_UINT32
  2583. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2584. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2585. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2586. exception_frame: 1,
  2587. rsvd0: 12, /* For future use */
  2588. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2589. rsvd1: 1; /* For future use */
  2590. A_UINT32
  2591. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2592. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2593. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2594. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2595. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2596. */
  2597. A_UINT32
  2598. data1: 32;
  2599. A_UINT32
  2600. data2: 32;
  2601. A_UINT32
  2602. used_by_hw3; /* Refer to struct wbm_release_ring */
  2603. } POSTPACK;
  2604. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2605. /* DWORD 3 */
  2606. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2607. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2608. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2609. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2610. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2611. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2612. /* DWORD 3 */
  2613. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2614. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2615. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2616. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2617. do { \
  2618. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2619. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2620. } while (0)
  2621. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2622. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2623. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2624. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2625. do { \
  2626. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2627. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2628. } while (0)
  2629. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2630. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2631. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2632. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2633. do { \
  2634. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2635. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2636. } while (0)
  2637. /**
  2638. * @brief HTT TX WBM Completion from firmware to host (V3)
  2639. * @details
  2640. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2641. * (WBM) offload HW.
  2642. * This structure is passed from firmware to host overlaid on wbm_release_ring
  2643. * For software based completions, release_source_module will
  2644. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2645. * struct wbm_release_ring and then switch to this after looking at
  2646. * release_source_module.
  2647. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2648. * by new generations of targets.
  2649. */
  2650. PREPACK struct htt_tx_wbm_completion_v3 {
  2651. A_UINT32
  2652. used_by_hw0; /* Refer to struct wbm_release_ring */
  2653. A_UINT32
  2654. used_by_hw1; /* Refer to struct wbm_release_ring */
  2655. A_UINT32
  2656. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2657. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2658. used_by_hw3: 15;
  2659. A_UINT32
  2660. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2661. exception_frame: 1,
  2662. rsvd0: 27; /* For future use */
  2663. A_UINT32
  2664. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2665. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2666. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2667. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2668. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2669. */
  2670. A_UINT32
  2671. data1: 32;
  2672. A_UINT32
  2673. data2: 32;
  2674. A_UINT32
  2675. rsvd1: 20,
  2676. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2677. } POSTPACK;
  2678. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2679. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2680. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2681. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2682. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2683. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2684. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2685. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2686. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2687. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2688. do { \
  2689. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2690. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2691. } while (0)
  2692. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2693. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2694. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2695. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2696. do { \
  2697. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2698. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2699. } while (0)
  2700. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2701. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2702. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2703. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2704. do { \
  2705. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2706. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2707. } while (0)
  2708. typedef enum {
  2709. TX_FRAME_TYPE_UNDEFINED = 0,
  2710. TX_FRAME_TYPE_EAPOL = 1,
  2711. } htt_tx_wbm_status_frame_type;
  2712. /**
  2713. * @brief HTT TX WBM transmit status from firmware to host
  2714. * @details
  2715. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2716. * (WBM) offload HW.
  2717. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2718. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2719. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2720. */
  2721. PREPACK struct htt_tx_wbm_transmit_status {
  2722. A_UINT32
  2723. sch_cmd_id: 24,
  2724. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2725. * reception of an ACK or BA, this field indicates
  2726. * the RSSI of the received ACK or BA frame.
  2727. * When the frame is removed as result of a direct
  2728. * remove command from the SW, this field is set
  2729. * to 0x0 (which is never a valid value when real
  2730. * RSSI is available).
  2731. * Units: dB w.r.t noise floor
  2732. */
  2733. A_UINT32
  2734. sw_peer_id: 16,
  2735. tid_num: 5,
  2736. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2737. * and tid_num fields contain valid data.
  2738. * If this "valid" flag is not set, the
  2739. * sw_peer_id and tid_num fields must be ignored.
  2740. */
  2741. mcast: 1,
  2742. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2743. * contains valid data.
  2744. */
  2745. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2746. reserved: 4;
  2747. A_UINT32
  2748. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2749. * packets in the wbm completion path
  2750. */
  2751. } POSTPACK;
  2752. /* DWORD 4 */
  2753. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2754. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2755. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2756. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2757. /* DWORD 5 */
  2758. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2759. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2760. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2761. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2762. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2763. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2764. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2765. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2766. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2767. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2768. /* DWORD 4 */
  2769. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2770. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2771. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2772. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2773. do { \
  2774. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2775. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2776. } while (0)
  2777. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2778. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2779. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2780. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2781. do { \
  2782. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2783. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2784. } while (0)
  2785. /* DWORD 5 */
  2786. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2787. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2788. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2789. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2790. do { \
  2791. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2792. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2793. } while (0)
  2794. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2795. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2796. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2797. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2798. do { \
  2799. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2800. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2801. } while (0)
  2802. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2803. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2804. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2805. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2806. do { \
  2807. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2808. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2809. } while (0)
  2810. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2811. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2812. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2813. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2814. do { \
  2815. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2816. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2817. } while (0)
  2818. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2819. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2820. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2821. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2822. do { \
  2823. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2824. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2825. } while (0)
  2826. /**
  2827. * @brief HTT TX WBM reinject status from firmware to host
  2828. * @details
  2829. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2830. * (WBM) offload HW.
  2831. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2832. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2833. */
  2834. PREPACK struct htt_tx_wbm_reinject_status {
  2835. A_UINT32
  2836. reserved0: 32;
  2837. A_UINT32
  2838. reserved1: 32;
  2839. A_UINT32
  2840. reserved2: 32;
  2841. } POSTPACK;
  2842. /**
  2843. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2844. * @details
  2845. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2846. * (WBM) offload HW.
  2847. * This structure is passed from firmware to host overlaid on wbm_release_ring.
  2848. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2849. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2850. * STA side.
  2851. */
  2852. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2853. A_UINT32
  2854. mec_sa_addr_31_0;
  2855. A_UINT32
  2856. mec_sa_addr_47_32: 16,
  2857. sa_ast_index: 16;
  2858. A_UINT32
  2859. vdev_id: 8,
  2860. reserved0: 24;
  2861. } POSTPACK;
  2862. /* DWORD 4 - mec_sa_addr_31_0 */
  2863. /* DWORD 5 */
  2864. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2865. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2866. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2867. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2868. /* DWORD 6 */
  2869. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2870. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2871. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2872. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2873. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2874. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2875. do { \
  2876. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2877. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2878. } while (0)
  2879. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2880. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2881. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2882. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2883. do { \
  2884. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2885. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2886. } while (0)
  2887. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2888. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2889. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2890. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2891. do { \
  2892. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2893. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2894. } while (0)
  2895. typedef enum {
  2896. TX_FLOW_PRIORITY_BE,
  2897. TX_FLOW_PRIORITY_HIGH,
  2898. TX_FLOW_PRIORITY_LOW,
  2899. } htt_tx_flow_priority_t;
  2900. typedef enum {
  2901. TX_FLOW_LATENCY_SENSITIVE,
  2902. TX_FLOW_LATENCY_INSENSITIVE,
  2903. } htt_tx_flow_latency_t;
  2904. typedef enum {
  2905. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2906. TX_FLOW_INTERACTIVE_TRAFFIC,
  2907. TX_FLOW_PERIODIC_TRAFFIC,
  2908. TX_FLOW_BURSTY_TRAFFIC,
  2909. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2910. } htt_tx_flow_traffic_pattern_t;
  2911. /**
  2912. * @brief HTT TX Flow search metadata format
  2913. * @details
  2914. * Host will set this metadata in flow table's flow search entry along with
  2915. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2916. * firmware and TQM ring if the flow search entry wins.
  2917. * This metadata is available to firmware in that first MSDU's
  2918. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2919. * to one of the available flows for specific tid and returns the tqm flow
  2920. * pointer as part of htt_tx_map_flow_info message.
  2921. */
  2922. PREPACK struct htt_tx_flow_metadata {
  2923. A_UINT32
  2924. rsvd0_1_0: 2,
  2925. tid: 4,
  2926. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2927. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2928. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2929. * Else choose final tid based on latency, priority.
  2930. */
  2931. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2932. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2933. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2934. } POSTPACK;
  2935. /* DWORD 0 */
  2936. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2937. #define HTT_TX_FLOW_METADATA_TID_S 2
  2938. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2939. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2940. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2941. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2942. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2943. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2944. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2945. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2946. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2947. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2948. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2949. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2950. /* DWORD 0 */
  2951. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2952. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2953. HTT_TX_FLOW_METADATA_TID_S)
  2954. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2955. do { \
  2956. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2957. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2958. } while (0)
  2959. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2960. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2961. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2962. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2963. do { \
  2964. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2965. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2966. } while (0)
  2967. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2968. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2969. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2970. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2971. do { \
  2972. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2973. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2974. } while (0)
  2975. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2976. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2977. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2978. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2979. do { \
  2980. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2981. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2982. } while (0)
  2983. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2984. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2985. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2986. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2987. do { \
  2988. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2989. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2990. } while (0)
  2991. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2992. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2993. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2994. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2995. do { \
  2996. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2997. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2998. } while (0)
  2999. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  3000. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  3001. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  3002. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  3003. do { \
  3004. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  3005. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  3006. } while (0)
  3007. /**
  3008. * @brief host -> target ADD WDS Entry
  3009. *
  3010. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  3011. *
  3012. * @brief host -> target DELETE WDS Entry
  3013. *
  3014. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  3015. *
  3016. * @details
  3017. * HTT wds entry from source port learning
  3018. * Host will learn wds entries from rx and send this message to firmware
  3019. * to enable firmware to configure/delete AST entries for wds clients.
  3020. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3021. * and when SA's entry is deleted, firmware removes this AST entry
  3022. *
  3023. * The message would appear as follows:
  3024. *
  3025. * |31 30|29 |17 16|15 8|7 0|
  3026. * |----------------+----------------+----------------+----------------|
  3027. * | rsvd0 |PDVID| vdev_id | msg_type |
  3028. * |-------------------------------------------------------------------|
  3029. * | sa_addr_31_0 |
  3030. * |-------------------------------------------------------------------|
  3031. * | | ta_peer_id | sa_addr_47_32 |
  3032. * |-------------------------------------------------------------------|
  3033. * Where PDVID = pdev_id
  3034. *
  3035. * The message is interpreted as follows:
  3036. *
  3037. * dword0 - b'0:7 - msg_type: This will be set to
  3038. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3039. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3040. *
  3041. * dword0 - b'8:15 - vdev_id
  3042. *
  3043. * dword0 - b'16:17 - pdev_id
  3044. *
  3045. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3046. *
  3047. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3048. *
  3049. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3050. *
  3051. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3052. */
  3053. PREPACK struct htt_wds_entry {
  3054. A_UINT32
  3055. msg_type: 8,
  3056. vdev_id: 8,
  3057. pdev_id: 2,
  3058. rsvd0: 14;
  3059. A_UINT32 sa_addr_31_0;
  3060. A_UINT32
  3061. sa_addr_47_32: 16,
  3062. ta_peer_id: 14,
  3063. rsvd2: 2;
  3064. } POSTPACK;
  3065. /* DWORD 0 */
  3066. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3067. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3068. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3069. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3070. /* DWORD 2 */
  3071. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3072. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3073. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3074. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3075. /* DWORD 0 */
  3076. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3077. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3078. HTT_WDS_ENTRY_VDEV_ID_S)
  3079. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3080. do { \
  3081. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3082. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3083. } while (0)
  3084. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3085. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3086. HTT_WDS_ENTRY_PDEV_ID_S)
  3087. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3088. do { \
  3089. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3090. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3091. } while (0)
  3092. /* DWORD 2 */
  3093. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3094. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3095. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3096. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3097. do { \
  3098. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3099. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3100. } while (0)
  3101. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3102. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3103. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3104. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3105. do { \
  3106. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3107. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3108. } while (0)
  3109. /**
  3110. * @brief MAC DMA rx ring setup specification
  3111. *
  3112. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3113. *
  3114. * @details
  3115. * To allow for dynamic rx ring reconfiguration and to avoid race
  3116. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3117. * it uses. Instead, it sends this message to the target, indicating how
  3118. * the rx ring used by the host should be set up and maintained.
  3119. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3120. * specifications.
  3121. *
  3122. * |31 16|15 8|7 0|
  3123. * |---------------------------------------------------------------|
  3124. * header: | reserved | num rings | msg type |
  3125. * |---------------------------------------------------------------|
  3126. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3127. #if HTT_PADDR64
  3128. * | FW_IDX shadow register physical address (bits 63:32) |
  3129. #endif
  3130. * |---------------------------------------------------------------|
  3131. * | rx ring base physical address (bits 31:0) |
  3132. #if HTT_PADDR64
  3133. * | rx ring base physical address (bits 63:32) |
  3134. #endif
  3135. * |---------------------------------------------------------------|
  3136. * | rx ring buffer size | rx ring length |
  3137. * |---------------------------------------------------------------|
  3138. * | FW_IDX initial value | enabled flags |
  3139. * |---------------------------------------------------------------|
  3140. * | MSDU payload offset | 802.11 header offset |
  3141. * |---------------------------------------------------------------|
  3142. * | PPDU end offset | PPDU start offset |
  3143. * |---------------------------------------------------------------|
  3144. * | MPDU end offset | MPDU start offset |
  3145. * |---------------------------------------------------------------|
  3146. * | MSDU end offset | MSDU start offset |
  3147. * |---------------------------------------------------------------|
  3148. * | frag info offset | rx attention offset |
  3149. * |---------------------------------------------------------------|
  3150. * payload 2, if present, has the same format as payload 1
  3151. * Header fields:
  3152. * - MSG_TYPE
  3153. * Bits 7:0
  3154. * Purpose: identifies this as an rx ring configuration message
  3155. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3156. * - NUM_RINGS
  3157. * Bits 15:8
  3158. * Purpose: indicates whether the host is setting up one rx ring or two
  3159. * Value: 1 or 2
  3160. * Payload:
  3161. * for systems using 64-bit format for bus addresses:
  3162. * - IDX_SHADOW_REG_PADDR_LO
  3163. * Bits 31:0
  3164. * Value: lower 4 bytes of physical address of the host's
  3165. * FW_IDX shadow register
  3166. * - IDX_SHADOW_REG_PADDR_HI
  3167. * Bits 31:0
  3168. * Value: upper 4 bytes of physical address of the host's
  3169. * FW_IDX shadow register
  3170. * - RING_BASE_PADDR_LO
  3171. * Bits 31:0
  3172. * Value: lower 4 bytes of physical address of the host's rx ring
  3173. * - RING_BASE_PADDR_HI
  3174. * Bits 31:0
  3175. * Value: uppper 4 bytes of physical address of the host's rx ring
  3176. * for systems using 32-bit format for bus addresses:
  3177. * - IDX_SHADOW_REG_PADDR
  3178. * Bits 31:0
  3179. * Value: physical address of the host's FW_IDX shadow register
  3180. * - RING_BASE_PADDR
  3181. * Bits 31:0
  3182. * Value: physical address of the host's rx ring
  3183. * - RING_LEN
  3184. * Bits 15:0
  3185. * Value: number of elements in the rx ring
  3186. * - RING_BUF_SZ
  3187. * Bits 31:16
  3188. * Value: size of the buffers referenced by the rx ring, in byte units
  3189. * - ENABLED_FLAGS
  3190. * Bits 15:0
  3191. * Value: 1-bit flags to show whether different rx fields are enabled
  3192. * bit 0: 802.11 header enabled (1) or disabled (0)
  3193. * bit 1: MSDU payload enabled (1) or disabled (0)
  3194. * bit 2: PPDU start enabled (1) or disabled (0)
  3195. * bit 3: PPDU end enabled (1) or disabled (0)
  3196. * bit 4: MPDU start enabled (1) or disabled (0)
  3197. * bit 5: MPDU end enabled (1) or disabled (0)
  3198. * bit 6: MSDU start enabled (1) or disabled (0)
  3199. * bit 7: MSDU end enabled (1) or disabled (0)
  3200. * bit 8: rx attention enabled (1) or disabled (0)
  3201. * bit 9: frag info enabled (1) or disabled (0)
  3202. * bit 10: unicast rx enabled (1) or disabled (0)
  3203. * bit 11: multicast rx enabled (1) or disabled (0)
  3204. * bit 12: ctrl rx enabled (1) or disabled (0)
  3205. * bit 13: mgmt rx enabled (1) or disabled (0)
  3206. * bit 14: null rx enabled (1) or disabled (0)
  3207. * bit 15: phy data rx enabled (1) or disabled (0)
  3208. * - IDX_INIT_VAL
  3209. * Bits 31:16
  3210. * Purpose: Specify the initial value for the FW_IDX.
  3211. * Value: the number of buffers initially present in the host's rx ring
  3212. * - OFFSET_802_11_HDR
  3213. * Bits 15:0
  3214. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3215. * - OFFSET_MSDU_PAYLOAD
  3216. * Bits 31:16
  3217. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3218. * - OFFSET_PPDU_START
  3219. * Bits 15:0
  3220. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3221. * - OFFSET_PPDU_END
  3222. * Bits 31:16
  3223. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3224. * - OFFSET_MPDU_START
  3225. * Bits 15:0
  3226. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3227. * - OFFSET_MPDU_END
  3228. * Bits 31:16
  3229. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3230. * - OFFSET_MSDU_START
  3231. * Bits 15:0
  3232. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3233. * - OFFSET_MSDU_END
  3234. * Bits 31:16
  3235. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3236. * - OFFSET_RX_ATTN
  3237. * Bits 15:0
  3238. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3239. * - OFFSET_FRAG_INFO
  3240. * Bits 31:16
  3241. * Value: offset in QUAD-bytes of frag info table
  3242. */
  3243. /* header fields */
  3244. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3245. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3246. /* payload fields */
  3247. /* for systems using a 64-bit format for bus addresses */
  3248. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3249. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3250. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3251. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3252. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3253. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3254. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3255. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3256. /* for systems using a 32-bit format for bus addresses */
  3257. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3258. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3259. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3260. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3261. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3262. #define HTT_RX_RING_CFG_LEN_S 0
  3263. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3264. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3265. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3266. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3267. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3268. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3269. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3270. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3271. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3272. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3273. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3274. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3275. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3276. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3277. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3278. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3279. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3280. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3281. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3282. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3283. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3284. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3285. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3286. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3287. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3288. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3289. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3290. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3291. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3292. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3293. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3294. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3295. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3296. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3297. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3298. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3299. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3300. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3301. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3302. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3303. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3304. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3305. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3306. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3307. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3308. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3309. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3310. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3311. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3312. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3313. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3314. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3315. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3316. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3317. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3318. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3319. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3320. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3321. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3322. #if HTT_PADDR64
  3323. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3324. #else
  3325. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3326. #endif
  3327. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3328. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3329. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3330. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3331. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3332. do { \
  3333. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3334. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3335. } while (0)
  3336. /* degenerate case for 32-bit fields */
  3337. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3338. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3339. ((_var) = (_val))
  3340. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3341. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3342. ((_var) = (_val))
  3343. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3344. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3345. ((_var) = (_val))
  3346. /* degenerate case for 32-bit fields */
  3347. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3348. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3349. ((_var) = (_val))
  3350. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3351. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3352. ((_var) = (_val))
  3353. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3354. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3355. ((_var) = (_val))
  3356. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3357. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3358. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3359. do { \
  3360. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3361. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3362. } while (0)
  3363. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3364. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3365. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3366. do { \
  3367. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3368. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3369. } while (0)
  3370. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3371. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3372. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3373. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3374. do { \
  3375. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3376. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3377. } while (0)
  3378. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3379. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3380. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3381. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3382. do { \
  3383. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3384. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3385. } while (0)
  3386. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3387. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3388. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3389. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3390. do { \
  3391. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3392. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3393. } while (0)
  3394. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3395. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3396. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3397. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3398. do { \
  3399. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3400. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3401. } while (0)
  3402. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3403. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3404. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3405. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3406. do { \
  3407. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3408. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3409. } while (0)
  3410. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3411. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3412. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3413. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3414. do { \
  3415. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3416. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3417. } while (0)
  3418. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3419. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3420. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3421. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3422. do { \
  3423. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3424. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3425. } while (0)
  3426. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3427. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3428. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3429. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3430. do { \
  3431. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3432. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3433. } while (0)
  3434. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3435. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3436. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3437. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3438. do { \
  3439. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3440. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3441. } while (0)
  3442. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3443. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3444. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3445. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3446. do { \
  3447. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3448. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3449. } while (0)
  3450. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3451. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3452. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3453. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3454. do { \
  3455. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3456. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3457. } while (0)
  3458. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3459. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3460. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3461. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3462. do { \
  3463. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3464. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3465. } while (0)
  3466. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3467. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3468. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3469. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3470. do { \
  3471. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3472. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3473. } while (0)
  3474. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3475. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3476. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3477. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3478. do { \
  3479. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3480. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3481. } while (0)
  3482. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3483. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3484. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3485. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3486. do { \
  3487. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3488. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3489. } while (0)
  3490. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3491. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3492. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3493. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3494. do { \
  3495. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3496. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3497. } while (0)
  3498. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3499. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3500. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3501. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3502. do { \
  3503. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3504. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3505. } while (0)
  3506. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3507. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3508. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3509. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3510. do { \
  3511. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3512. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3513. } while (0)
  3514. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3515. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3516. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3517. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3518. do { \
  3519. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3520. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3521. } while (0)
  3522. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3523. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3524. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3525. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3526. do { \
  3527. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3528. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3529. } while (0)
  3530. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3531. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3532. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3533. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3534. do { \
  3535. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3536. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3537. } while (0)
  3538. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3539. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3540. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3541. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3542. do { \
  3543. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3544. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3545. } while (0)
  3546. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3547. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3548. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3549. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3550. do { \
  3551. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3552. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3553. } while (0)
  3554. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3555. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3556. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3557. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3558. do { \
  3559. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3560. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3561. } while (0)
  3562. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3563. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3564. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3565. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3566. do { \
  3567. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3568. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3569. } while (0)
  3570. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3571. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3572. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3573. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3574. do { \
  3575. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3576. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3577. } while (0)
  3578. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3579. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3580. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3581. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3582. do { \
  3583. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3584. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3585. } while (0)
  3586. /**
  3587. * @brief host -> target FW statistics retrieve
  3588. *
  3589. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3590. *
  3591. * @details
  3592. * The following field definitions describe the format of the HTT host
  3593. * to target FW stats retrieve message. The message specifies the type of
  3594. * stats host wants to retrieve.
  3595. *
  3596. * |31 24|23 16|15 8|7 0|
  3597. * |-----------------------------------------------------------|
  3598. * | stats types request bitmask | msg type |
  3599. * |-----------------------------------------------------------|
  3600. * | stats types reset bitmask | reserved |
  3601. * |-----------------------------------------------------------|
  3602. * | stats type | config value |
  3603. * |-----------------------------------------------------------|
  3604. * | cookie LSBs |
  3605. * |-----------------------------------------------------------|
  3606. * | cookie MSBs |
  3607. * |-----------------------------------------------------------|
  3608. * Header fields:
  3609. * - MSG_TYPE
  3610. * Bits 7:0
  3611. * Purpose: identifies this is a stats upload request message
  3612. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3613. * - UPLOAD_TYPES
  3614. * Bits 31:8
  3615. * Purpose: identifies which types of FW statistics to upload
  3616. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3617. * - RESET_TYPES
  3618. * Bits 31:8
  3619. * Purpose: identifies which types of FW statistics to reset
  3620. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3621. * - CFG_VAL
  3622. * Bits 23:0
  3623. * Purpose: give an opaque configuration value to the specified stats type
  3624. * Value: stats-type specific configuration value
  3625. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3626. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3627. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3628. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3629. * - CFG_STAT_TYPE
  3630. * Bits 31:24
  3631. * Purpose: specify which stats type (if any) the config value applies to
  3632. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3633. * a valid configuration specification
  3634. * - COOKIE_LSBS
  3635. * Bits 31:0
  3636. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3637. * message with its preceding host->target stats request message.
  3638. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3639. * - COOKIE_MSBS
  3640. * Bits 31:0
  3641. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3642. * message with its preceding host->target stats request message.
  3643. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3644. */
  3645. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3646. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3647. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3648. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3649. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3650. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3651. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3652. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3653. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3654. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3655. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3656. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3657. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3658. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3659. do { \
  3660. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3661. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3662. } while (0)
  3663. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3664. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3665. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3666. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3667. do { \
  3668. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3669. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3670. } while (0)
  3671. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3672. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3673. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3674. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3675. do { \
  3676. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3677. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3678. } while (0)
  3679. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3680. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3681. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3682. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3683. do { \
  3684. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3685. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3686. } while (0)
  3687. /**
  3688. * @brief host -> target HTT out-of-band sync request
  3689. *
  3690. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3691. *
  3692. * @details
  3693. * The HTT SYNC tells the target to suspend processing of subsequent
  3694. * HTT host-to-target messages until some other target agent locally
  3695. * informs the target HTT FW that the current sync counter is equal to
  3696. * or greater than (in a modulo sense) the sync counter specified in
  3697. * the SYNC message.
  3698. * This allows other host-target components to synchronize their operation
  3699. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3700. * security key has been downloaded to and activated by the target.
  3701. * In the absence of any explicit synchronization counter value
  3702. * specification, the target HTT FW will use zero as the default current
  3703. * sync value.
  3704. *
  3705. * |31 24|23 16|15 8|7 0|
  3706. * |-----------------------------------------------------------|
  3707. * | reserved | sync count | msg type |
  3708. * |-----------------------------------------------------------|
  3709. * Header fields:
  3710. * - MSG_TYPE
  3711. * Bits 7:0
  3712. * Purpose: identifies this as a sync message
  3713. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3714. * - SYNC_COUNT
  3715. * Bits 15:8
  3716. * Purpose: specifies what sync value the HTT FW will wait for from
  3717. * an out-of-band specification to resume its operation
  3718. * Value: in-band sync counter value to compare against the out-of-band
  3719. * counter spec.
  3720. * The HTT target FW will suspend its host->target message processing
  3721. * as long as
  3722. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3723. */
  3724. #define HTT_H2T_SYNC_MSG_SZ 4
  3725. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3726. #define HTT_H2T_SYNC_COUNT_S 8
  3727. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3728. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3729. HTT_H2T_SYNC_COUNT_S)
  3730. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3731. do { \
  3732. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3733. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3734. } while (0)
  3735. /**
  3736. * @brief host -> target HTT aggregation configuration
  3737. *
  3738. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3739. */
  3740. #define HTT_AGGR_CFG_MSG_SZ 4
  3741. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3742. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3743. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3744. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3745. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3746. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3747. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3748. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3749. do { \
  3750. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3751. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3752. } while (0)
  3753. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3754. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3755. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3756. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3757. do { \
  3758. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3759. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3760. } while (0)
  3761. /**
  3762. * @brief host -> target HTT configure max amsdu info per vdev
  3763. *
  3764. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3765. *
  3766. * @details
  3767. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3768. *
  3769. * |31 21|20 16|15 8|7 0|
  3770. * |-----------------------------------------------------------|
  3771. * | reserved | vdev id | max amsdu | msg type |
  3772. * |-----------------------------------------------------------|
  3773. * Header fields:
  3774. * - MSG_TYPE
  3775. * Bits 7:0
  3776. * Purpose: identifies this as a aggr cfg ex message
  3777. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3778. * - MAX_NUM_AMSDU_SUBFRM
  3779. * Bits 15:8
  3780. * Purpose: max MSDUs per A-MSDU
  3781. * - VDEV_ID
  3782. * Bits 20:16
  3783. * Purpose: ID of the vdev to which this limit is applied
  3784. */
  3785. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3786. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3787. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3788. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3789. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3790. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3791. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3792. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3793. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3794. do { \
  3795. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3796. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3797. } while (0)
  3798. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3799. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3800. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3801. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3802. do { \
  3803. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3804. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3805. } while (0)
  3806. /**
  3807. * @brief HTT WDI_IPA Config Message
  3808. *
  3809. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3810. *
  3811. * @details
  3812. * The HTT WDI_IPA config message is created/sent by host at driver
  3813. * init time. It contains information about data structures used on
  3814. * WDI_IPA TX and RX path.
  3815. * TX CE ring is used for pushing packet metadata from IPA uC
  3816. * to WLAN FW
  3817. * TX Completion ring is used for generating TX completions from
  3818. * WLAN FW to IPA uC
  3819. * RX Indication ring is used for indicating RX packets from FW
  3820. * to IPA uC
  3821. * RX Ring2 is used as either completion ring or as second
  3822. * indication ring. when Ring2 is used as completion ring, IPA uC
  3823. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3824. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3825. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3826. * indicated in RX Indication ring. Please see WDI_IPA specification
  3827. * for more details.
  3828. * |31 24|23 16|15 8|7 0|
  3829. * |----------------+----------------+----------------+----------------|
  3830. * | tx pkt pool size | Rsvd | msg_type |
  3831. * |-------------------------------------------------------------------|
  3832. * | tx comp ring base (bits 31:0) |
  3833. #if HTT_PADDR64
  3834. * | tx comp ring base (bits 63:32) |
  3835. #endif
  3836. * |-------------------------------------------------------------------|
  3837. * | tx comp ring size |
  3838. * |-------------------------------------------------------------------|
  3839. * | tx comp WR_IDX physical address (bits 31:0) |
  3840. #if HTT_PADDR64
  3841. * | tx comp WR_IDX physical address (bits 63:32) |
  3842. #endif
  3843. * |-------------------------------------------------------------------|
  3844. * | tx CE WR_IDX physical address (bits 31:0) |
  3845. #if HTT_PADDR64
  3846. * | tx CE WR_IDX physical address (bits 63:32) |
  3847. #endif
  3848. * |-------------------------------------------------------------------|
  3849. * | rx indication ring base (bits 31:0) |
  3850. #if HTT_PADDR64
  3851. * | rx indication ring base (bits 63:32) |
  3852. #endif
  3853. * |-------------------------------------------------------------------|
  3854. * | rx indication ring size |
  3855. * |-------------------------------------------------------------------|
  3856. * | rx ind RD_IDX physical address (bits 31:0) |
  3857. #if HTT_PADDR64
  3858. * | rx ind RD_IDX physical address (bits 63:32) |
  3859. #endif
  3860. * |-------------------------------------------------------------------|
  3861. * | rx ind WR_IDX physical address (bits 31:0) |
  3862. #if HTT_PADDR64
  3863. * | rx ind WR_IDX physical address (bits 63:32) |
  3864. #endif
  3865. * |-------------------------------------------------------------------|
  3866. * |-------------------------------------------------------------------|
  3867. * | rx ring2 base (bits 31:0) |
  3868. #if HTT_PADDR64
  3869. * | rx ring2 base (bits 63:32) |
  3870. #endif
  3871. * |-------------------------------------------------------------------|
  3872. * | rx ring2 size |
  3873. * |-------------------------------------------------------------------|
  3874. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3875. #if HTT_PADDR64
  3876. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3877. #endif
  3878. * |-------------------------------------------------------------------|
  3879. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3880. #if HTT_PADDR64
  3881. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3882. #endif
  3883. * |-------------------------------------------------------------------|
  3884. *
  3885. * Header fields:
  3886. * Header fields:
  3887. * - MSG_TYPE
  3888. * Bits 7:0
  3889. * Purpose: Identifies this as WDI_IPA config message
  3890. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3891. * - TX_PKT_POOL_SIZE
  3892. * Bits 15:0
  3893. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3894. * WDI_IPA TX path
  3895. * For systems using 32-bit format for bus addresses:
  3896. * - TX_COMP_RING_BASE_ADDR
  3897. * Bits 31:0
  3898. * Purpose: TX Completion Ring base address in DDR
  3899. * - TX_COMP_RING_SIZE
  3900. * Bits 31:0
  3901. * Purpose: TX Completion Ring size (must be power of 2)
  3902. * - TX_COMP_WR_IDX_ADDR
  3903. * Bits 31:0
  3904. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3905. * updates the Write Index for WDI_IPA TX completion ring
  3906. * - TX_CE_WR_IDX_ADDR
  3907. * Bits 31:0
  3908. * Purpose: DDR address where IPA uC
  3909. * updates the WR Index for TX CE ring
  3910. * (needed for fusion platforms)
  3911. * - RX_IND_RING_BASE_ADDR
  3912. * Bits 31:0
  3913. * Purpose: RX Indication Ring base address in DDR
  3914. * - RX_IND_RING_SIZE
  3915. * Bits 31:0
  3916. * Purpose: RX Indication Ring size
  3917. * - RX_IND_RD_IDX_ADDR
  3918. * Bits 31:0
  3919. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3920. * RX indication ring
  3921. * - RX_IND_WR_IDX_ADDR
  3922. * Bits 31:0
  3923. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3924. * updates the Write Index for WDI_IPA RX indication ring
  3925. * - RX_RING2_BASE_ADDR
  3926. * Bits 31:0
  3927. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3928. * - RX_RING2_SIZE
  3929. * Bits 31:0
  3930. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3931. * - RX_RING2_RD_IDX_ADDR
  3932. * Bits 31:0
  3933. * Purpose: If Second RX ring is Indication ring, DDR address where
  3934. * IPA uC updates the Read Index for Ring2.
  3935. * If Second RX ring is completion ring, this is NOT used
  3936. * - RX_RING2_WR_IDX_ADDR
  3937. * Bits 31:0
  3938. * Purpose: If Second RX ring is Indication ring, DDR address where
  3939. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3940. * If second RX ring is completion ring, DDR address where
  3941. * IPA uC updates the Write Index for Ring 2.
  3942. * For systems using 64-bit format for bus addresses:
  3943. * - TX_COMP_RING_BASE_ADDR_LO
  3944. * Bits 31:0
  3945. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3946. * - TX_COMP_RING_BASE_ADDR_HI
  3947. * Bits 31:0
  3948. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3949. * - TX_COMP_RING_SIZE
  3950. * Bits 31:0
  3951. * Purpose: TX Completion Ring size (must be power of 2)
  3952. * - TX_COMP_WR_IDX_ADDR_LO
  3953. * Bits 31:0
  3954. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3955. * Lower 4 bytes of DDR address where WIFI FW
  3956. * updates the Write Index for WDI_IPA TX completion ring
  3957. * - TX_COMP_WR_IDX_ADDR_HI
  3958. * Bits 31:0
  3959. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3960. * Higher 4 bytes of DDR address where WIFI FW
  3961. * updates the Write Index for WDI_IPA TX completion ring
  3962. * - TX_CE_WR_IDX_ADDR_LO
  3963. * Bits 31:0
  3964. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3965. * updates the WR Index for TX CE ring
  3966. * (needed for fusion platforms)
  3967. * - TX_CE_WR_IDX_ADDR_HI
  3968. * Bits 31:0
  3969. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3970. * updates the WR Index for TX CE ring
  3971. * (needed for fusion platforms)
  3972. * - RX_IND_RING_BASE_ADDR_LO
  3973. * Bits 31:0
  3974. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3975. * - RX_IND_RING_BASE_ADDR_HI
  3976. * Bits 31:0
  3977. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3978. * - RX_IND_RING_SIZE
  3979. * Bits 31:0
  3980. * Purpose: RX Indication Ring size
  3981. * - RX_IND_RD_IDX_ADDR_LO
  3982. * Bits 31:0
  3983. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3984. * for WDI_IPA RX indication ring
  3985. * - RX_IND_RD_IDX_ADDR_HI
  3986. * Bits 31:0
  3987. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3988. * for WDI_IPA RX indication ring
  3989. * - RX_IND_WR_IDX_ADDR_LO
  3990. * Bits 31:0
  3991. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3992. * Lower 4 bytes of DDR address where WIFI FW
  3993. * updates the Write Index for WDI_IPA RX indication ring
  3994. * - RX_IND_WR_IDX_ADDR_HI
  3995. * Bits 31:0
  3996. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3997. * Higher 4 bytes of DDR address where WIFI FW
  3998. * updates the Write Index for WDI_IPA RX indication ring
  3999. * - RX_RING2_BASE_ADDR_LO
  4000. * Bits 31:0
  4001. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4002. * - RX_RING2_BASE_ADDR_HI
  4003. * Bits 31:0
  4004. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  4005. * - RX_RING2_SIZE
  4006. * Bits 31:0
  4007. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  4008. * - RX_RING2_RD_IDX_ADDR_LO
  4009. * Bits 31:0
  4010. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4011. * DDR address where IPA uC updates the Read Index for Ring2.
  4012. * If Second RX ring is completion ring, this is NOT used
  4013. * - RX_RING2_RD_IDX_ADDR_HI
  4014. * Bits 31:0
  4015. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4016. * DDR address where IPA uC updates the Read Index for Ring2.
  4017. * If Second RX ring is completion ring, this is NOT used
  4018. * - RX_RING2_WR_IDX_ADDR_LO
  4019. * Bits 31:0
  4020. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4021. * DDR address where WIFI FW updates the Write Index
  4022. * for WDI_IPA RX ring2
  4023. * If second RX ring is completion ring, lower 4 bytes of
  4024. * DDR address where IPA uC updates the Write Index for Ring 2.
  4025. * - RX_RING2_WR_IDX_ADDR_HI
  4026. * Bits 31:0
  4027. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4028. * DDR address where WIFI FW updates the Write Index
  4029. * for WDI_IPA RX ring2
  4030. * If second RX ring is completion ring, higher 4 bytes of
  4031. * DDR address where IPA uC updates the Write Index for Ring 2.
  4032. */
  4033. #if HTT_PADDR64
  4034. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4035. #else
  4036. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4037. #endif
  4038. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4039. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4040. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4041. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4042. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4043. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4044. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4045. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4046. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4047. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4048. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4049. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4050. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4051. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4052. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4053. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4054. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4055. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4056. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4057. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4058. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4059. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4060. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4061. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4062. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4063. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4064. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4065. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4066. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4067. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4068. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4069. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4070. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4071. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4072. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4073. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4074. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4075. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4076. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4077. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4078. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4079. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4080. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4081. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4082. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4083. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4084. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4085. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4086. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4087. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4088. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4089. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4090. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4091. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4092. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4093. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4094. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4095. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4096. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4097. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4098. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4099. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4100. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4101. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4102. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4103. do { \
  4104. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4105. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4106. } while (0)
  4107. /* for systems using 32-bit format for bus addr */
  4108. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4109. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4110. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4111. do { \
  4112. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4113. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4114. } while (0)
  4115. /* for systems using 64-bit format for bus addr */
  4116. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4117. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4118. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4119. do { \
  4120. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4121. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4122. } while (0)
  4123. /* for systems using 64-bit format for bus addr */
  4124. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4125. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4126. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4127. do { \
  4128. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4129. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4130. } while (0)
  4131. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4132. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4133. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4134. do { \
  4135. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4136. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4137. } while (0)
  4138. /* for systems using 32-bit format for bus addr */
  4139. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4140. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4141. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4142. do { \
  4143. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4144. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4145. } while (0)
  4146. /* for systems using 64-bit format for bus addr */
  4147. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4148. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4149. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4150. do { \
  4151. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4152. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4153. } while (0)
  4154. /* for systems using 64-bit format for bus addr */
  4155. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4156. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4157. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4158. do { \
  4159. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4160. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4161. } while (0)
  4162. /* for systems using 32-bit format for bus addr */
  4163. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4164. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4165. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4166. do { \
  4167. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4168. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4169. } while (0)
  4170. /* for systems using 64-bit format for bus addr */
  4171. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4172. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4173. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4174. do { \
  4175. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4176. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4177. } while (0)
  4178. /* for systems using 64-bit format for bus addr */
  4179. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4180. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4181. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4182. do { \
  4183. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4184. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4185. } while (0)
  4186. /* for systems using 32-bit format for bus addr */
  4187. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4188. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4189. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4190. do { \
  4191. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4192. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4193. } while (0)
  4194. /* for systems using 64-bit format for bus addr */
  4195. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4196. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4197. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4198. do { \
  4199. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4200. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4201. } while (0)
  4202. /* for systems using 64-bit format for bus addr */
  4203. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4204. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4205. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4206. do { \
  4207. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4208. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4209. } while (0)
  4210. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4211. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4212. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4213. do { \
  4214. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4215. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4216. } while (0)
  4217. /* for systems using 32-bit format for bus addr */
  4218. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4219. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4220. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4221. do { \
  4222. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4223. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4224. } while (0)
  4225. /* for systems using 64-bit format for bus addr */
  4226. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4227. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4228. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4229. do { \
  4230. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4231. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4232. } while (0)
  4233. /* for systems using 64-bit format for bus addr */
  4234. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4235. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4236. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4237. do { \
  4238. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4239. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4240. } while (0)
  4241. /* for systems using 32-bit format for bus addr */
  4242. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4243. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4244. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4245. do { \
  4246. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4247. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4248. } while (0)
  4249. /* for systems using 64-bit format for bus addr */
  4250. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4251. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4252. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4253. do { \
  4254. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4255. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4256. } while (0)
  4257. /* for systems using 64-bit format for bus addr */
  4258. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4259. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4260. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4261. do { \
  4262. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4263. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4264. } while (0)
  4265. /* for systems using 32-bit format for bus addr */
  4266. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4267. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4268. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4269. do { \
  4270. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4271. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4272. } while (0)
  4273. /* for systems using 64-bit format for bus addr */
  4274. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4275. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4276. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4277. do { \
  4278. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4279. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4280. } while (0)
  4281. /* for systems using 64-bit format for bus addr */
  4282. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4283. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4284. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4285. do { \
  4286. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4287. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4288. } while (0)
  4289. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4290. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4291. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4292. do { \
  4293. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4294. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4295. } while (0)
  4296. /* for systems using 32-bit format for bus addr */
  4297. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4298. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4299. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4300. do { \
  4301. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4302. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4303. } while (0)
  4304. /* for systems using 64-bit format for bus addr */
  4305. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4306. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4307. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4308. do { \
  4309. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4310. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4311. } while (0)
  4312. /* for systems using 64-bit format for bus addr */
  4313. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4314. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4315. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4316. do { \
  4317. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4318. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4319. } while (0)
  4320. /* for systems using 32-bit format for bus addr */
  4321. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4322. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4323. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4324. do { \
  4325. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4326. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4327. } while (0)
  4328. /* for systems using 64-bit format for bus addr */
  4329. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4330. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4331. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4332. do { \
  4333. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4334. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4335. } while (0)
  4336. /* for systems using 64-bit format for bus addr */
  4337. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4338. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4339. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4340. do { \
  4341. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4342. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4343. } while (0)
  4344. /*
  4345. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4346. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4347. * addresses are stored in a XXX-bit field.
  4348. * This macro is used to define both htt_wdi_ipa_config32_t and
  4349. * htt_wdi_ipa_config64_t structs.
  4350. */
  4351. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4352. _paddr__tx_comp_ring_base_addr_, \
  4353. _paddr__tx_comp_wr_idx_addr_, \
  4354. _paddr__tx_ce_wr_idx_addr_, \
  4355. _paddr__rx_ind_ring_base_addr_, \
  4356. _paddr__rx_ind_rd_idx_addr_, \
  4357. _paddr__rx_ind_wr_idx_addr_, \
  4358. _paddr__rx_ring2_base_addr_,\
  4359. _paddr__rx_ring2_rd_idx_addr_,\
  4360. _paddr__rx_ring2_wr_idx_addr_) \
  4361. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4362. { \
  4363. /* DWORD 0: flags and meta-data */ \
  4364. A_UINT32 \
  4365. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4366. reserved: 8, \
  4367. tx_pkt_pool_size: 16;\
  4368. /* DWORD 1 */\
  4369. _paddr__tx_comp_ring_base_addr_;\
  4370. /* DWORD 2 (or 3)*/\
  4371. A_UINT32 tx_comp_ring_size;\
  4372. /* DWORD 3 (or 4)*/\
  4373. _paddr__tx_comp_wr_idx_addr_;\
  4374. /* DWORD 4 (or 6)*/\
  4375. _paddr__tx_ce_wr_idx_addr_;\
  4376. /* DWORD 5 (or 8)*/\
  4377. _paddr__rx_ind_ring_base_addr_;\
  4378. /* DWORD 6 (or 10)*/\
  4379. A_UINT32 rx_ind_ring_size;\
  4380. /* DWORD 7 (or 11)*/\
  4381. _paddr__rx_ind_rd_idx_addr_;\
  4382. /* DWORD 8 (or 13)*/\
  4383. _paddr__rx_ind_wr_idx_addr_;\
  4384. /* DWORD 9 (or 15)*/\
  4385. _paddr__rx_ring2_base_addr_;\
  4386. /* DWORD 10 (or 17) */\
  4387. A_UINT32 rx_ring2_size;\
  4388. /* DWORD 11 (or 18) */\
  4389. _paddr__rx_ring2_rd_idx_addr_;\
  4390. /* DWORD 12 (or 20) */\
  4391. _paddr__rx_ring2_wr_idx_addr_;\
  4392. } POSTPACK
  4393. /* define a htt_wdi_ipa_config32_t type */
  4394. 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));
  4395. /* define a htt_wdi_ipa_config64_t type */
  4396. 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));
  4397. #if HTT_PADDR64
  4398. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4399. #else
  4400. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4401. #endif
  4402. enum htt_wdi_ipa_op_code {
  4403. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4404. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4405. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4406. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4407. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4408. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4409. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4410. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4411. /* keep this last */
  4412. HTT_WDI_IPA_OPCODE_MAX
  4413. };
  4414. /**
  4415. * @brief HTT WDI_IPA Operation Request Message
  4416. *
  4417. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4418. *
  4419. * @details
  4420. * HTT WDI_IPA Operation Request message is sent by host
  4421. * to either suspend or resume WDI_IPA TX or RX path.
  4422. * |31 24|23 16|15 8|7 0|
  4423. * |----------------+----------------+----------------+----------------|
  4424. * | op_code | Rsvd | msg_type |
  4425. * |-------------------------------------------------------------------|
  4426. *
  4427. * Header fields:
  4428. * - MSG_TYPE
  4429. * Bits 7:0
  4430. * Purpose: Identifies this as WDI_IPA Operation Request message
  4431. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4432. * - OP_CODE
  4433. * Bits 31:16
  4434. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4435. * value: = enum htt_wdi_ipa_op_code
  4436. */
  4437. PREPACK struct htt_wdi_ipa_op_request_t
  4438. {
  4439. /* DWORD 0: flags and meta-data */
  4440. A_UINT32
  4441. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4442. reserved: 8,
  4443. op_code: 16;
  4444. } POSTPACK;
  4445. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4446. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4447. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4448. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4449. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4450. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4451. do { \
  4452. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4453. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4454. } while (0)
  4455. /*
  4456. * @brief host -> target HTT_MSI_SETUP message
  4457. *
  4458. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4459. *
  4460. * @details
  4461. * After target is booted up, host can send MSI setup message so that
  4462. * target sets up HW registers based on setup message.
  4463. *
  4464. * The message would appear as follows:
  4465. * |31 24|23 16|15|14 8|7 0|
  4466. * |---------------+-----------------+-----------------+-----------------|
  4467. * | reserved | msi_type | pdev_id | msg_type |
  4468. * |---------------------------------------------------------------------|
  4469. * | msi_addr_lo |
  4470. * |---------------------------------------------------------------------|
  4471. * | msi_addr_hi |
  4472. * |---------------------------------------------------------------------|
  4473. * | msi_data |
  4474. * |---------------------------------------------------------------------|
  4475. *
  4476. * The message is interpreted as follows:
  4477. * dword0 - b'0:7 - msg_type: This will be set to
  4478. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4479. * b'8:15 - pdev_id:
  4480. * 0 (for rings at SOC/UMAC level),
  4481. * 1/2/3 mac id (for rings at LMAC level)
  4482. * b'16:23 - msi_type: identify which msi registers need to be setup
  4483. * more details can be got from enum htt_msi_setup_type
  4484. * b'24:31 - reserved
  4485. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4486. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4487. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4488. */
  4489. PREPACK struct htt_msi_setup_t {
  4490. A_UINT32 msg_type: 8,
  4491. pdev_id: 8,
  4492. msi_type: 8,
  4493. reserved: 8;
  4494. A_UINT32 msi_addr_lo;
  4495. A_UINT32 msi_addr_hi;
  4496. A_UINT32 msi_data;
  4497. } POSTPACK;
  4498. enum htt_msi_setup_type {
  4499. HTT_PPDU_END_MSI_SETUP_TYPE,
  4500. /* Insert new types here*/
  4501. };
  4502. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4503. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4504. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4505. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4506. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4507. HTT_MSI_SETUP_PDEV_ID_S)
  4508. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4509. do { \
  4510. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4511. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4512. } while (0)
  4513. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4514. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4515. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4516. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4517. HTT_MSI_SETUP_MSI_TYPE_S)
  4518. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4519. do { \
  4520. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4521. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4522. } while (0)
  4523. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4524. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4525. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4526. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4527. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4528. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4529. do { \
  4530. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4531. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4532. } while (0)
  4533. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4534. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4535. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4536. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4537. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4538. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4539. do { \
  4540. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4541. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4542. } while (0)
  4543. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4544. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4545. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4546. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4547. HTT_MSI_SETUP_MSI_DATA_S)
  4548. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4549. do { \
  4550. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4551. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4552. } while (0)
  4553. /*
  4554. * @brief host -> target HTT_SRING_SETUP message
  4555. *
  4556. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4557. *
  4558. * @details
  4559. * After target is booted up, Host can send SRING setup message for
  4560. * each host facing LMAC SRING. Target setups up HW registers based
  4561. * on setup message and confirms back to Host if response_required is set.
  4562. * Host should wait for confirmation message before sending new SRING
  4563. * setup message
  4564. *
  4565. * The message would appear as follows:
  4566. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4567. * |--------------- +-----------------+-----------------+-----------------|
  4568. * | ring_type | ring_id | pdev_id | msg_type |
  4569. * |----------------------------------------------------------------------|
  4570. * | ring_base_addr_lo |
  4571. * |----------------------------------------------------------------------|
  4572. * | ring_base_addr_hi |
  4573. * |----------------------------------------------------------------------|
  4574. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4575. * |----------------------------------------------------------------------|
  4576. * | ring_head_offset32_remote_addr_lo |
  4577. * |----------------------------------------------------------------------|
  4578. * | ring_head_offset32_remote_addr_hi |
  4579. * |----------------------------------------------------------------------|
  4580. * | ring_tail_offset32_remote_addr_lo |
  4581. * |----------------------------------------------------------------------|
  4582. * | ring_tail_offset32_remote_addr_hi |
  4583. * |----------------------------------------------------------------------|
  4584. * | ring_msi_addr_lo |
  4585. * |----------------------------------------------------------------------|
  4586. * | ring_msi_addr_hi |
  4587. * |----------------------------------------------------------------------|
  4588. * | ring_msi_data |
  4589. * |----------------------------------------------------------------------|
  4590. * | intr_timer_th |IM| intr_batch_counter_th |
  4591. * |----------------------------------------------------------------------|
  4592. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4593. * |----------------------------------------------------------------------|
  4594. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4595. * |----------------------------------------------------------------------|
  4596. * Where
  4597. * IM = sw_intr_mode
  4598. * RR = response_required
  4599. * PTCF = prefetch_timer_cfg
  4600. * IP = IPA drop flag
  4601. *
  4602. * The message is interpreted as follows:
  4603. * dword0 - b'0:7 - msg_type: This will be set to
  4604. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4605. * b'8:15 - pdev_id:
  4606. * 0 (for rings at SOC/UMAC level),
  4607. * 1/2/3 mac id (for rings at LMAC level)
  4608. * b'16:23 - ring_id: identify which ring is to setup,
  4609. * more details can be got from enum htt_srng_ring_id
  4610. * b'24:31 - ring_type: identify type of host rings,
  4611. * more details can be got from enum htt_srng_ring_type
  4612. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4613. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4614. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4615. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4616. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4617. * SW_TO_HW_RING.
  4618. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4619. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4620. * Lower 32 bits of memory address of the remote variable
  4621. * storing the 4-byte word offset that identifies the head
  4622. * element within the ring.
  4623. * (The head offset variable has type A_UINT32.)
  4624. * Valid for HW_TO_SW and SW_TO_SW rings.
  4625. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4626. * Upper 32 bits of memory address of the remote variable
  4627. * storing the 4-byte word offset that identifies the head
  4628. * element within the ring.
  4629. * (The head offset variable has type A_UINT32.)
  4630. * Valid for HW_TO_SW and SW_TO_SW rings.
  4631. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4632. * Lower 32 bits of memory address of the remote variable
  4633. * storing the 4-byte word offset that identifies the tail
  4634. * element within the ring.
  4635. * (The tail offset variable has type A_UINT32.)
  4636. * Valid for HW_TO_SW and SW_TO_SW rings.
  4637. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4638. * Upper 32 bits of memory address of the remote variable
  4639. * storing the 4-byte word offset that identifies the tail
  4640. * element within the ring.
  4641. * (The tail offset variable has type A_UINT32.)
  4642. * Valid for HW_TO_SW and SW_TO_SW rings.
  4643. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4644. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4645. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4646. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4647. * dword10 - b'0:31 - ring_msi_data: MSI data
  4648. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4649. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4650. * dword11 - b'0:14 - intr_batch_counter_th:
  4651. * batch counter threshold is in units of 4-byte words.
  4652. * HW internally maintains and increments batch count.
  4653. * (see SRING spec for detail description).
  4654. * When batch count reaches threshold value, an interrupt
  4655. * is generated by HW.
  4656. * b'15 - sw_intr_mode:
  4657. * This configuration shall be static.
  4658. * Only programmed at power up.
  4659. * 0: generate pulse style sw interrupts
  4660. * 1: generate level style sw interrupts
  4661. * b'16:31 - intr_timer_th:
  4662. * The timer init value when timer is idle or is
  4663. * initialized to start downcounting.
  4664. * In 8us units (to cover a range of 0 to 524 ms)
  4665. * dword12 - b'0:15 - intr_low_threshold:
  4666. * Used only by Consumer ring to generate ring_sw_int_p.
  4667. * Ring entries low threshold water mark, that is used
  4668. * in combination with the interrupt timer as well as
  4669. * the the clearing of the level interrupt.
  4670. * b'16:18 - prefetch_timer_cfg:
  4671. * Used only by Consumer ring to set timer mode to
  4672. * support Application prefetch handling.
  4673. * The external tail offset/pointer will be updated
  4674. * at following intervals:
  4675. * 3'b000: (Prefetch feature disabled; used only for debug)
  4676. * 3'b001: 1 usec
  4677. * 3'b010: 4 usec
  4678. * 3'b011: 8 usec (default)
  4679. * 3'b100: 16 usec
  4680. * Others: Reserved
  4681. * b'19 - response_required:
  4682. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4683. * b'20 - ipa_drop_flag:
  4684. Indicates that host will config ipa drop threshold percentage
  4685. * b'21:31 - reserved: reserved for future use
  4686. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4687. * b'8:15 - ipa drop high threshold percentage:
  4688. * b'16:31 - Reserved
  4689. */
  4690. PREPACK struct htt_sring_setup_t {
  4691. A_UINT32 msg_type: 8,
  4692. pdev_id: 8,
  4693. ring_id: 8,
  4694. ring_type: 8;
  4695. A_UINT32 ring_base_addr_lo;
  4696. A_UINT32 ring_base_addr_hi;
  4697. A_UINT32 ring_size: 16,
  4698. ring_entry_size: 8,
  4699. ring_misc_cfg_flag: 8;
  4700. A_UINT32 ring_head_offset32_remote_addr_lo;
  4701. A_UINT32 ring_head_offset32_remote_addr_hi;
  4702. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4703. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4704. A_UINT32 ring_msi_addr_lo;
  4705. A_UINT32 ring_msi_addr_hi;
  4706. A_UINT32 ring_msi_data;
  4707. A_UINT32 intr_batch_counter_th: 15,
  4708. sw_intr_mode: 1,
  4709. intr_timer_th: 16;
  4710. A_UINT32 intr_low_threshold: 16,
  4711. prefetch_timer_cfg: 3,
  4712. response_required: 1,
  4713. ipa_drop_flag: 1,
  4714. reserved1: 11;
  4715. A_UINT32 ipa_drop_low_threshold: 8,
  4716. ipa_drop_high_threshold: 8,
  4717. reserved: 16;
  4718. } POSTPACK;
  4719. enum htt_srng_ring_type {
  4720. HTT_HW_TO_SW_RING = 0,
  4721. HTT_SW_TO_HW_RING,
  4722. HTT_SW_TO_SW_RING,
  4723. /* Insert new ring types above this line */
  4724. };
  4725. enum htt_srng_ring_id {
  4726. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4727. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4728. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4729. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4730. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4731. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4732. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4733. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4734. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4735. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4736. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4737. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4738. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4739. HTT_LPASS_TO_FW_RXBUF_RING, /* new LPASS to FW refill ring to recycle rx buffers */
  4740. HTT_HOST3_TO_FW_RXBUF_RING, /* used by host for EasyMesh feature */
  4741. /* Add Other SRING which can't be directly configured by host software above this line */
  4742. };
  4743. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4744. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4745. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4746. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4747. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4748. HTT_SRING_SETUP_PDEV_ID_S)
  4749. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4750. do { \
  4751. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4752. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4753. } while (0)
  4754. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4755. #define HTT_SRING_SETUP_RING_ID_S 16
  4756. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4757. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4758. HTT_SRING_SETUP_RING_ID_S)
  4759. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4760. do { \
  4761. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4762. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4763. } while (0)
  4764. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4765. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4766. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4767. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4768. HTT_SRING_SETUP_RING_TYPE_S)
  4769. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4770. do { \
  4771. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4772. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4773. } while (0)
  4774. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4775. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4776. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4777. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4778. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4779. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4780. do { \
  4781. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4782. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4783. } while (0)
  4784. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4785. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4786. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4787. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4788. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4789. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4790. do { \
  4791. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4792. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4793. } while (0)
  4794. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4795. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4796. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4797. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4798. HTT_SRING_SETUP_RING_SIZE_S)
  4799. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4800. do { \
  4801. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4802. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4803. } while (0)
  4804. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4805. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4806. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4807. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4808. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4809. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4810. do { \
  4811. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4812. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4813. } while (0)
  4814. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4815. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4816. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4817. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4818. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4819. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4820. do { \
  4821. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4822. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4823. } while (0)
  4824. /* This control bit is applicable to only Producer, which updates Ring ID field
  4825. * of each descriptor before pushing into the ring.
  4826. * 0: updates ring_id(default)
  4827. * 1: ring_id updating disabled */
  4828. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4829. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4830. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4831. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4832. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4833. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4834. do { \
  4835. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4836. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4837. } while (0)
  4838. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4839. * of each descriptor before pushing into the ring.
  4840. * 0: updates Loopcnt(default)
  4841. * 1: Loopcnt updating disabled */
  4842. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4843. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4844. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4845. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4846. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4847. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4848. do { \
  4849. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4850. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4851. } while (0)
  4852. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4853. * into security_id port of GXI/AXI. */
  4854. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4855. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4856. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4857. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4858. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4859. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4860. do { \
  4861. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4862. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4863. } while (0)
  4864. /* During MSI write operation, SRNG drives value of this register bit into
  4865. * swap bit of GXI/AXI. */
  4866. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4867. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4868. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4869. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4870. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4871. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4872. do { \
  4873. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4874. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4875. } while (0)
  4876. /* During Pointer write operation, SRNG drives value of this register bit into
  4877. * swap bit of GXI/AXI. */
  4878. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4879. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4880. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4881. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4882. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4883. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4884. do { \
  4885. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4886. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4887. } while (0)
  4888. /* During any data or TLV write operation, SRNG drives value of this register
  4889. * bit into swap bit of GXI/AXI. */
  4890. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4891. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4892. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4893. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4894. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4895. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4896. do { \
  4897. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4898. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4899. } while (0)
  4900. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4901. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4902. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4903. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4904. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4905. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4906. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4907. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4908. do { \
  4909. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4910. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4911. } while (0)
  4912. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4913. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4914. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4915. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4916. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4917. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4918. do { \
  4919. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4920. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4921. } while (0)
  4922. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4923. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4924. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4925. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4926. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4927. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4928. do { \
  4929. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4930. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4931. } while (0)
  4932. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4933. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4934. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4935. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4936. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4937. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4938. do { \
  4939. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4940. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4941. } while (0)
  4942. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4943. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4944. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4945. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4946. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4947. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4948. do { \
  4949. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4950. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4951. } while (0)
  4952. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4953. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4954. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4955. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4956. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4957. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4958. do { \
  4959. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4960. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4961. } while (0)
  4962. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4963. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4964. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4965. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4966. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4967. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4968. do { \
  4969. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4970. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4971. } while (0)
  4972. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4973. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4974. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4975. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4976. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4977. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4978. do { \
  4979. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4980. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4981. } while (0)
  4982. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4983. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4984. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4985. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4986. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4987. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4988. do { \
  4989. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4990. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4991. } while (0)
  4992. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4993. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4994. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4995. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4996. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4997. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4998. do { \
  4999. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  5000. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  5001. } while (0)
  5002. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  5003. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  5004. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  5005. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  5006. HTT_SRING_SETUP_INTR_LOW_TH_S)
  5007. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  5008. do { \
  5009. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  5010. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  5011. } while (0)
  5012. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  5013. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  5014. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  5015. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  5016. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  5017. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  5018. do { \
  5019. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  5020. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  5021. } while (0)
  5022. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5023. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5024. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5025. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5026. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5027. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5028. do { \
  5029. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5030. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5031. } while (0)
  5032. /**
  5033. * @brief host -> target RX ring selection config message
  5034. *
  5035. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5036. *
  5037. * @details
  5038. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5039. * configure RXDMA rings.
  5040. * The configuration is per ring based and includes both packet subtypes
  5041. * and PPDU/MPDU TLVs.
  5042. *
  5043. * The message would appear as follows:
  5044. *
  5045. * |31 28|27|26|25|24|23|22|21 19|18 16|15 | 11| 10|9 8|7 0|
  5046. * |-----+--+--+--+--+-----------------+----+---+---+---+---------------|
  5047. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5048. * |-----------------------+-----+-----+--------------------------------|
  5049. * |rsvd2|RX|RXHDL| CLD | CLC | CLM | ring_buffer_size |
  5050. * |--------------------------------------------------------------------|
  5051. * | packet_type_enable_flags_0 |
  5052. * |--------------------------------------------------------------------|
  5053. * | packet_type_enable_flags_1 |
  5054. * |--------------------------------------------------------------------|
  5055. * | packet_type_enable_flags_2 |
  5056. * |--------------------------------------------------------------------|
  5057. * | packet_type_enable_flags_3 |
  5058. * |--------------------------------------------------------------------|
  5059. * | tlv_filter_in_flags |
  5060. * |-----------------------------------+--------------------------------|
  5061. * | rx_header_offset | rx_packet_offset |
  5062. * |-----------------------------------+--------------------------------|
  5063. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5064. * |-----------------------------------+--------------------------------|
  5065. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5066. * |-----------------------------------+--------------------------------|
  5067. * | rsvd3 | rx_attention_offset |
  5068. * |--------------------------------------------------------------------|
  5069. * | rsvd4 | mo| fp| rx_drop_threshold |
  5070. * | |ndp|ndp| |
  5071. * |--------------------------------------------------------------------|
  5072. * Where:
  5073. * PS = pkt_swap
  5074. * SS = status_swap
  5075. * OV = rx_offsets_valid
  5076. * DT = drop_thresh_valid
  5077. * CLM = config_length_mgmt
  5078. * CLC = config_length_ctrl
  5079. * CLD = config_length_data
  5080. * RXHDL = rx_hdr_len
  5081. * RX = rxpcu_filter_enable_flag
  5082. * The message is interpreted as follows:
  5083. * dword0 - b'0:7 - msg_type: This will be set to
  5084. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5085. * b'8:15 - pdev_id:
  5086. * 0 (for rings at SOC/UMAC level),
  5087. * 1/2/3 mac id (for rings at LMAC level)
  5088. * b'16:23 - ring_id : Identify the ring to configure.
  5089. * More details can be got from enum htt_srng_ring_id
  5090. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5091. * BUF_RING_CFG_0 defs within HW .h files,
  5092. * e.g. wmac_top_reg_seq_hwioreg.h
  5093. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5094. * BUF_RING_CFG_0 defs within HW .h files,
  5095. * e.g. wmac_top_reg_seq_hwioreg.h
  5096. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5097. * configuration fields are valid
  5098. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5099. * rx_drop_threshold field is valid
  5100. * b'28 - rx_mon_global_en: Enable/Disable global register
  5101. 8 configuration in Rx monitor module.
  5102. * b'29:31 - rsvd1: reserved for future use
  5103. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5104. * in byte units.
  5105. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5106. * b'16:18 - config_length_mgmt (MGMT):
  5107. * Represents the length of mpdu bytes for mgmt pkt.
  5108. * valid values:
  5109. * 001 - 64bytes
  5110. * 010 - 128bytes
  5111. * 100 - 256bytes
  5112. * 111 - Full mpdu bytes
  5113. * b'19:21 - config_length_ctrl (CTRL):
  5114. * Represents the length of mpdu bytes for ctrl pkt.
  5115. * valid values:
  5116. * 001 - 64bytes
  5117. * 010 - 128bytes
  5118. * 100 - 256bytes
  5119. * 111 - Full mpdu bytes
  5120. * b'22:24 - config_length_data (DATA):
  5121. * Represents the length of mpdu bytes for data pkt.
  5122. * valid values:
  5123. * 001 - 64bytes
  5124. * 010 - 128bytes
  5125. * 100 - 256bytes
  5126. * 111 - Full mpdu bytes
  5127. * b'25:26 - rx_hdr_len:
  5128. * Specifies the number of bytes of recvd packet to copy
  5129. * into the rx_hdr tlv.
  5130. * supported values for now by host:
  5131. * 01 - 64bytes
  5132. * 10 - 128bytes
  5133. * 11 - 256bytes
  5134. * default - 128 bytes
  5135. * b'27 - rxpcu_filter_enable_flag
  5136. * For Scan Radio Host CPU utilization is very high.
  5137. * In order to reduce CPU utilization we need to filter out
  5138. * certain configured MAC frames.
  5139. * To filter out configured MAC address frames, RxPCU should
  5140. * be zero which means allow all frames for MD at RxOLE
  5141. * host wil fiter out frames.
  5142. * RxPCU (Filter IN) -> RxOLE (Filter In/Filter Out)
  5143. * b'28:31 - rsvd2: Reserved for future use
  5144. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5145. * Enable MGMT packet from 0b0000 to 0b1001
  5146. * bits from low to high: FP, MD, MO - 3 bits
  5147. * FP: Filter_Pass
  5148. * MD: Monitor_Direct
  5149. * MO: Monitor_Other
  5150. * 10 mgmt subtypes * 3 bits -> 30 bits
  5151. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5152. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5153. * Enable MGMT packet from 0b1010 to 0b1111
  5154. * bits from low to high: FP, MD, MO - 3 bits
  5155. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5156. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5157. * Enable CTRL packet from 0b0000 to 0b1001
  5158. * bits from low to high: FP, MD, MO - 3 bits
  5159. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5160. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5161. * Enable CTRL packet from 0b1010 to 0b1111,
  5162. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5163. * bits from low to high: FP, MD, MO - 3 bits
  5164. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5165. * dword6 - b'0:31 - tlv_filter_in_flags:
  5166. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5167. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5168. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5169. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5170. * A value of 0 will be considered as ignore this config.
  5171. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5172. * e.g. wmac_top_reg_seq_hwioreg.h
  5173. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5174. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5175. * A value of 0 will be considered as ignore this config.
  5176. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5177. * e.g. wmac_top_reg_seq_hwioreg.h
  5178. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5179. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5180. * A value of 0 will be considered as ignore this config.
  5181. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5182. * e.g. wmac_top_reg_seq_hwioreg.h
  5183. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5184. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5185. * A value of 0 will be considered as ignore this config.
  5186. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5187. * e.g. wmac_top_reg_seq_hwioreg.h
  5188. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5189. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5190. * A value of 0 will be considered as ignore this config.
  5191. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5192. * e.g. wmac_top_reg_seq_hwioreg.h
  5193. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5194. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5195. * A value of 0 will be considered as ignore this config.
  5196. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5197. * e.g. wmac_top_reg_seq_hwioreg.h
  5198. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5199. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5200. * A value of 0 will be considered as ignore this config.
  5201. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5202. * e.g. wmac_top_reg_seq_hwioreg.h
  5203. * - b'16:31 - rsvd3 for future use
  5204. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5205. * to source rings. Consumer drops packets if the available
  5206. * words in the ring falls below the configured threshold
  5207. * value.
  5208. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5209. * by host. 1 -> subscribed
  5210. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5211. * by host. 1 -> subscribed
  5212. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5213. * subscribed by host. 1 -> subscribed
  5214. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5215. * selection for the FP PHY ERR status tlv.
  5216. * 0 - wbm2rxdma_buf_source_ring
  5217. * 1 - fw2rxdma_buf_source_ring
  5218. * 2 - sw2rxdma_buf_source_ring
  5219. * 3 - no_buffer_ring
  5220. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5221. * selection for the FP PHY ERR status tlv.
  5222. * 0 - rxdma_release_ring
  5223. * 1 - rxdma2fw_ring
  5224. * 2 - rxdma2sw_ring
  5225. * 3 - rxdma2reo_ring
  5226. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5227. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5228. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5229. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5230. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5231. * 0: MSDU level logging
  5232. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5233. * 0: MSDU level logging
  5234. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5235. * 0: MSDU level logging
  5236. * - b'23 - word_mask_compaction: enable/disable word mask for
  5237. * mpdu/msdu start/end tlvs
  5238. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5239. * manager override
  5240. * - b'25:28 - rbm_override_val: return buffer manager override value
  5241. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5242. * which have to be posted to host from phy.
  5243. * Corresponding to errors defined in
  5244. * phyrx_abort_request_reason enums 0 to 31.
  5245. * Refer to RXPCU register definition header files for the
  5246. * phyrx_abort_request_reason enum definition.
  5247. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5248. * errors which have to be posted to host from phy.
  5249. * Corresponding to errors defined in
  5250. * phyrx_abort_request_reason enums 32 to 63.
  5251. * Refer to RXPCU register definition header files for the
  5252. * phyrx_abort_request_reason enum definition.
  5253. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5254. * applicable if word mask enabled
  5255. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5256. * applicable if word mask enabled
  5257. * - b'19:31 - rsvd7
  5258. * dword15- b'0:16 - rx_msdu_end_word_mask
  5259. * - b'17:31 - rsvd5
  5260. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5261. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5262. * buffer
  5263. * 1: RX_PKT TLV logging at specified offset for the
  5264. * subsequent buffer
  5265. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5266. */
  5267. PREPACK struct htt_rx_ring_selection_cfg_t {
  5268. A_UINT32 msg_type: 8,
  5269. pdev_id: 8,
  5270. ring_id: 8,
  5271. status_swap: 1,
  5272. pkt_swap: 1,
  5273. rx_offsets_valid: 1,
  5274. drop_thresh_valid: 1,
  5275. rx_mon_global_en: 1,
  5276. rsvd1: 3;
  5277. A_UINT32 ring_buffer_size: 16,
  5278. config_length_mgmt:3,
  5279. config_length_ctrl:3,
  5280. config_length_data:3,
  5281. rx_hdr_len: 2,
  5282. rxpcu_filter_enable_flag:1,
  5283. rsvd2: 4;
  5284. A_UINT32 packet_type_enable_flags_0;
  5285. A_UINT32 packet_type_enable_flags_1;
  5286. A_UINT32 packet_type_enable_flags_2;
  5287. A_UINT32 packet_type_enable_flags_3;
  5288. A_UINT32 tlv_filter_in_flags;
  5289. A_UINT32 rx_packet_offset: 16,
  5290. rx_header_offset: 16;
  5291. A_UINT32 rx_mpdu_end_offset: 16,
  5292. rx_mpdu_start_offset: 16;
  5293. A_UINT32 rx_msdu_end_offset: 16,
  5294. rx_msdu_start_offset: 16;
  5295. A_UINT32 rx_attn_offset: 16,
  5296. rsvd3: 16;
  5297. A_UINT32 rx_drop_threshold: 10,
  5298. fp_ndp: 1,
  5299. mo_ndp: 1,
  5300. fp_phy_err: 1,
  5301. fp_phy_err_buf_src: 2,
  5302. fp_phy_err_buf_dest: 2,
  5303. pkt_type_enable_msdu_or_mpdu_logging:3,
  5304. dma_mpdu_mgmt: 1,
  5305. dma_mpdu_ctrl: 1,
  5306. dma_mpdu_data: 1,
  5307. word_mask_compaction_enable:1,
  5308. rbm_override_enable: 1,
  5309. rbm_override_val: 4,
  5310. rsvd4: 3;
  5311. A_UINT32 phy_err_mask;
  5312. A_UINT32 phy_err_mask_cont;
  5313. A_UINT32 rx_mpdu_start_word_mask:16,
  5314. rx_mpdu_end_word_mask: 3,
  5315. rsvd7: 13;
  5316. A_UINT32 rx_msdu_end_word_mask: 17,
  5317. rsvd5: 15;
  5318. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5319. rx_pkt_tlv_offset: 15,
  5320. rsvd6: 16;
  5321. } POSTPACK;
  5322. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5323. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5324. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5325. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5326. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5327. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5328. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5329. do { \
  5330. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5331. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5332. } while (0)
  5333. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5334. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5335. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5336. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5337. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5338. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5339. do { \
  5340. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5341. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5342. } while (0)
  5343. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5344. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5345. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5346. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5347. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5348. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5349. do { \
  5350. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5351. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5352. } while (0)
  5353. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5354. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5355. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5356. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5357. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5358. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5359. do { \
  5360. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5361. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5362. } while (0)
  5363. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5364. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5365. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5366. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5367. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5368. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5369. do { \
  5370. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5371. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5372. } while (0)
  5373. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5374. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5375. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5376. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5377. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5378. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5379. do { \
  5380. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5381. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5382. } while (0)
  5383. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5384. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5385. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5386. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5387. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5388. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5389. do { \
  5390. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5391. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5392. } while (0)
  5393. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5394. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5395. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5396. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5397. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5398. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5399. do { \
  5400. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5401. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5402. } while (0)
  5403. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5404. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5405. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5406. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5407. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5408. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5409. do { \
  5410. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5411. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5412. } while (0)
  5413. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5414. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5415. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5416. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5417. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5418. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5419. do { \
  5420. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5421. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5422. } while (0)
  5423. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5424. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5425. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5426. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5427. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5428. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5429. do { \
  5430. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5431. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5432. } while (0)
  5433. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5434. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5435. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5436. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5437. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5438. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5439. do { \
  5440. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5441. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5442. } while(0)
  5443. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M 0x08000000
  5444. #define HTT_RX_RING_SELECTION_CFG_RXPXU_FILTER_S 27
  5445. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_GET(_var) \
  5446. (((_var) & HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_M) >> \
  5447. HTT_RX_RING_SELECTION_CFG_RXPXU_FILTER_S)
  5448. #define HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER_SET(_var, _val) \
  5449. do { \
  5450. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RXPCU_FILTER, _val); \
  5451. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RXPXU_FILTER_S));\
  5452. } while(0)
  5453. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5454. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5455. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5456. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5457. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5458. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5459. do { \
  5460. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5461. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5462. } while (0)
  5463. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5464. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5465. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5466. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5467. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5468. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5469. do { \
  5470. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5471. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5472. } while (0)
  5473. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5474. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5475. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5476. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5477. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5478. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5479. do { \
  5480. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5481. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5482. } while (0)
  5483. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5484. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5485. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5486. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5487. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5488. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5489. do { \
  5490. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5491. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5492. } while (0)
  5493. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5494. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5495. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5496. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5497. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5498. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5499. do { \
  5500. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5501. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5502. } while (0)
  5503. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5504. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5505. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5506. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5507. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5508. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5509. do { \
  5510. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5511. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5512. } while (0)
  5513. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5514. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5515. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5516. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5517. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5518. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5519. do { \
  5520. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5521. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5522. } while (0)
  5523. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5524. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5525. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5526. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5527. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5528. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5529. do { \
  5530. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5531. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5532. } while (0)
  5533. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5534. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5535. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5536. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5537. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5538. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5539. do { \
  5540. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5541. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5542. } while (0)
  5543. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5544. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5545. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5546. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5547. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5548. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5549. do { \
  5550. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5551. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5552. } while (0)
  5553. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5554. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5555. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5556. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5557. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5558. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5559. do { \
  5560. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5561. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5562. } while (0)
  5563. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5564. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5565. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5566. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5567. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5568. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5569. do { \
  5570. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5571. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5572. } while (0)
  5573. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5574. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5575. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5576. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5577. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5578. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5579. do { \
  5580. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5581. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5582. } while (0)
  5583. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5584. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5585. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5586. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5587. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5588. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5589. do { \
  5590. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5591. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5592. } while (0)
  5593. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5594. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5595. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5596. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5597. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5598. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5599. do { \
  5600. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5601. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5602. } while (0)
  5603. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5604. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5605. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5606. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5607. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5608. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5609. do { \
  5610. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5611. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5612. } while (0)
  5613. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5614. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5615. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5616. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5617. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5618. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5619. do { \
  5620. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5621. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5622. } while (0)
  5623. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5624. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5625. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5626. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5627. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5628. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5629. do { \
  5630. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5631. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5632. } while (0)
  5633. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5634. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5635. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5636. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5637. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5638. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5639. do { \
  5640. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5641. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5642. } while (0)
  5643. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5644. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5645. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5646. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5647. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5648. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5649. do { \
  5650. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5651. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5652. } while (0)
  5653. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5654. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5655. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5656. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5657. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5658. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5659. do { \
  5660. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5661. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5662. } while (0)
  5663. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5664. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5665. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5666. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5667. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5668. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5669. do { \
  5670. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5671. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5672. } while (0)
  5673. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5674. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5675. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5676. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5677. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5678. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5679. do { \
  5680. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5681. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5682. } while (0)
  5683. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5684. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5685. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5686. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5687. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5688. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5689. do { \
  5690. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5691. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5692. } while (0)
  5693. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5694. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5695. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5696. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5697. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5698. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5699. do { \
  5700. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5701. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5702. } while (0)
  5703. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5704. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5705. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5706. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5707. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5708. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5709. do { \
  5710. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5711. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5712. } while (0)
  5713. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5714. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5715. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5716. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5717. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5718. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5719. do { \
  5720. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5721. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5722. } while (0)
  5723. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5724. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5725. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5726. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5727. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5728. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5729. do { \
  5730. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5731. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5732. } while (0)
  5733. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5734. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5735. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5736. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5737. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5738. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5739. do { \
  5740. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5741. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5742. } while (0)
  5743. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5744. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5745. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5746. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5747. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5748. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5749. do { \
  5750. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5751. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5752. } while (0)
  5753. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5754. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5755. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5756. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5757. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5758. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5759. do { \
  5760. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5761. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5762. } while (0)
  5763. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5764. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5765. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5766. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5767. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5768. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5769. do { \
  5770. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5771. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5772. } while (0)
  5773. /*
  5774. * Subtype based MGMT frames enable bits.
  5775. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5776. */
  5777. /* association request */
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5784. /* association response */
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5791. /* Reassociation request */
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5798. /* Reassociation response */
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5805. /* Probe request */
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5812. /* Probe response */
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5819. /* Timing Advertisement */
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5826. /* Reserved */
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5833. /* Beacon */
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5840. /* ATIM */
  5841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5842. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5843. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5844. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5847. /* Disassociation */
  5848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5854. /* Authentication */
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5861. /* Deauthentication */
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5868. /* Action */
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5875. /* Action No Ack */
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5882. /* Reserved */
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5889. /*
  5890. * Subtype based CTRL frames enable bits.
  5891. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5892. */
  5893. /* Reserved */
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5900. /* Reserved */
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5907. /* Reserved */
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5914. /* Reserved */
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5921. /* Reserved */
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5928. /* Reserved */
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5935. /* Reserved */
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5942. /* Control Wrapper */
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5949. /* Block Ack Request */
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5956. /* Block Ack*/
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5963. /* PS-POLL */
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5970. /* RTS */
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5977. /* CTS */
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5980. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5981. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5983. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5984. /* ACK */
  5985. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5986. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5987. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5988. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5989. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5990. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5991. /* CF-END */
  5992. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5993. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5994. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5995. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5996. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5997. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5998. /* CF-END + CF-ACK */
  5999. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  6000. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  6001. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  6002. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  6003. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  6004. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  6005. /* Multicast data */
  6006. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  6007. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  6008. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  6009. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  6010. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  6011. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  6012. /* Unicast data */
  6013. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  6014. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  6015. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  6016. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  6017. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  6018. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  6019. /* NULL data */
  6020. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  6021. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  6022. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  6023. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  6024. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  6025. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  6026. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  6027. do { \
  6028. HTT_CHECK_SET_VAL(httsym, value); \
  6029. (word) |= (value) << httsym##_S; \
  6030. } while (0)
  6031. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  6032. (((word) & httsym##_M) >> httsym##_S)
  6033. #define htt_rx_ring_pkt_enable_subtype_set( \
  6034. word, flag, mode, type, subtype, val) \
  6035. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  6036. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  6037. #define htt_rx_ring_pkt_enable_subtype_get( \
  6038. word, flag, mode, type, subtype) \
  6039. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  6040. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  6041. /* Definition to filter in TLVs */
  6042. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  6043. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  6044. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  6045. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  6046. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6047. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6048. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6049. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6050. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6051. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6052. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6053. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6054. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6055. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6056. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6057. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6058. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6059. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6060. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6061. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6062. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6063. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6064. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6065. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6066. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6067. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6068. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6069. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6070. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6071. do { \
  6072. HTT_CHECK_SET_VAL(httsym, enable); \
  6073. (word) |= (enable) << httsym##_S; \
  6074. } while (0)
  6075. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6076. (((word) & httsym##_M) >> httsym##_S)
  6077. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6078. HTT_RX_RING_TLV_ENABLE_SET( \
  6079. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6080. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6081. HTT_RX_RING_TLV_ENABLE_GET( \
  6082. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6083. /**
  6084. * @brief host -> target TX monitor config message
  6085. *
  6086. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6087. *
  6088. * @details
  6089. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6090. * configure RXDMA rings.
  6091. * The configuration is per ring based and includes both packet types
  6092. * and PPDU/MPDU TLVs.
  6093. *
  6094. * The message would appear as follows:
  6095. *
  6096. * |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|
  6097. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6098. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6099. * |-----------+--------+--------+-----+------------------------------------|
  6100. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6101. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6102. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6103. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6104. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6105. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6106. * |------------------------------------------------------------------------|
  6107. * | tlv_filter_mask_in0 |
  6108. * |------------------------------------------------------------------------|
  6109. * | tlv_filter_mask_in1 |
  6110. * |------------------------------------------------------------------------|
  6111. * | tlv_filter_mask_in2 |
  6112. * |------------------------------------------------------------------------|
  6113. * | tlv_filter_mask_in3 |
  6114. * |-----------------+-----------------+---------------------+--------------|
  6115. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6116. * |------------------------------------------------------------------------|
  6117. * | pcu_ppdu_setup_word_mask |
  6118. * |--------------------+--+--+--+-----+---------------------+--------------|
  6119. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6120. * |------------------------------------------------------------------------|
  6121. *
  6122. * Where:
  6123. * PS = pkt_swap
  6124. * SS = status_swap
  6125. * The message is interpreted as follows:
  6126. * dword0 - b'0:7 - msg_type: This will be set to
  6127. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6128. * b'8:15 - pdev_id:
  6129. * 0 (for rings at SOC level),
  6130. * 1/2/3 mac id (for rings at LMAC level)
  6131. * b'16:23 - ring_id : Identify the ring to configure.
  6132. * More details can be got from enum htt_srng_ring_id
  6133. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6134. * BUF_RING_CFG_0 defs within HW .h files,
  6135. * e.g. wmac_top_reg_seq_hwioreg.h
  6136. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6137. * BUF_RING_CFG_0 defs within HW .h files,
  6138. * e.g. wmac_top_reg_seq_hwioreg.h
  6139. * b'26 - tx_mon_global_en: Enable/Disable global register
  6140. * configuration in Tx monitor module.
  6141. * b'27:31 - rsvd1: reserved for future use
  6142. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6143. * in byte units.
  6144. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6145. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6146. * 64, 128, 256.
  6147. * If all 3 bits are set config length is > 256.
  6148. * if val is '0', then ignore this field.
  6149. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6150. * 64, 128, 256.
  6151. * If all 3 bits are set config length is > 256.
  6152. * if val is '0', then ignore this field.
  6153. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6154. * 64, 128, 256.
  6155. * If all 3 bits are set config length is > 256.
  6156. * If val is '0', then ignore this field.
  6157. * - b'25:31 - rsvd2: Reserved for future use
  6158. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6159. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6160. * If packet_type_enable_flags is '1' for MGMT type,
  6161. * monitor will ignore this bit and allow this TLV.
  6162. * If packet_type_enable_flags is '0' for MGMT type,
  6163. * monitor will use this bit to enable/disable logging
  6164. * of this TLV.
  6165. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6166. * If packet_type_enable_flags is '1' for CTRL type,
  6167. * monitor will ignore this bit and allow this TLV.
  6168. * If packet_type_enable_flags is '0' for CTRL type,
  6169. * monitor will use this bit to enable/disable logging
  6170. * of this TLV.
  6171. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6172. * If packet_type_enable_flags is '1' for DATA type,
  6173. * monitor will ignore this bit and allow this TLV.
  6174. * If packet_type_enable_flags is '0' for DATA type,
  6175. * monitor will use this bit to enable/disable logging
  6176. * of this TLV.
  6177. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6178. * If packet_type_enable_flags is '1' for MGMT type,
  6179. * monitor will ignore this bit and allow this TLV.
  6180. * If packet_type_enable_flags is '0' for MGMT type,
  6181. * monitor will use this bit to enable/disable logging
  6182. * of this TLV.
  6183. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6184. * If packet_type_enable_flags is '1' for CTRL type,
  6185. * monitor will ignore this bit and allow this TLV.
  6186. * If packet_type_enable_flags is '0' for CTRL type,
  6187. * monitor will use this bit to enable/disable logging
  6188. * of this TLV.
  6189. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6190. * If packet_type_enable_flags is '1' for DATA type,
  6191. * monitor will ignore this bit and allow this TLV.
  6192. * If packet_type_enable_flags is '0' for DATA type,
  6193. * monitor will use this bit to enable/disable logging
  6194. * of this TLV.
  6195. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6196. * If packet_type_enable_flags is '1' for MGMT type,
  6197. * monitor will ignore this bit and allow this TLV.
  6198. * If packet_type_enable_flags is '0' for MGMT type,
  6199. * monitor will use this bit to enable/disable logging
  6200. * of this TLV.
  6201. * If filter_in_TX_MPDU_START = 1 it is recommended
  6202. * to set this bit.
  6203. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6204. * If packet_type_enable_flags is '1' for CTRL type,
  6205. * monitor will ignore this bit and allow this TLV.
  6206. * If packet_type_enable_flags is '0' for CTRL type,
  6207. * monitor will use this bit to enable/disable logging
  6208. * of this TLV.
  6209. * If filter_in_TX_MPDU_START = 1 it is recommended
  6210. * to set this bit.
  6211. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6212. * If packet_type_enable_flags is '1' for DATA type,
  6213. * monitor will ignore this bit and allow this TLV.
  6214. * If packet_type_enable_flags is '0' for DATA type,
  6215. * monitor will use this bit to enable/disable logging
  6216. * of this TLV.
  6217. * If filter_in_TX_MPDU_START = 1 it is recommended
  6218. * to set this bit.
  6219. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6220. * If packet_type_enable_flags is '1' for MGMT type,
  6221. * monitor will ignore this bit and allow this TLV.
  6222. * If packet_type_enable_flags is '0' for MGMT type,
  6223. * monitor will use this bit to enable/disable logging
  6224. * of this TLV.
  6225. * If filter_in_TX_MSDU_START = 1 it is recommended
  6226. * to set this bit.
  6227. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6228. * If packet_type_enable_flags is '1' for CTRL type,
  6229. * monitor will ignore this bit and allow this TLV.
  6230. * If packet_type_enable_flags is '0' for CTRL type,
  6231. * monitor will use this bit to enable/disable logging
  6232. * of this TLV.
  6233. * If filter_in_TX_MSDU_START = 1 it is recommended
  6234. * to set this bit.
  6235. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6236. * If packet_type_enable_flags is '1' for DATA type,
  6237. * monitor will ignore this bit and allow this TLV.
  6238. * If packet_type_enable_flags is '0' for DATA type,
  6239. * monitor will use this bit to enable/disable logging
  6240. * of this TLV.
  6241. * If filter_in_TX_MSDU_START = 1 it is recommended
  6242. * to set this bit.
  6243. * b'15:31 - rsvd3: Reserved for future use
  6244. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6245. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6246. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6247. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6248. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6249. * - b'8:15 - tx_peer_entry_word_mask:
  6250. * - b'16:23 - tx_queue_ext_word_mask:
  6251. * - b'24:31 - tx_msdu_start_word_mask:
  6252. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6253. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6254. * - b'8:15 - rxpcu_user_setup_word_mask:
  6255. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6256. * MGMT, CTRL, DATA
  6257. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6258. * 0 -> MSDU level logging is enabled
  6259. * (valid only if bit is set in
  6260. * pkt_type_enable_msdu_or_mpdu_logging)
  6261. * 1 -> MPDU level logging is enabled
  6262. * (valid only if bit is set in
  6263. * pkt_type_enable_msdu_or_mpdu_logging)
  6264. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6265. * 0 -> MSDU level logging is enabled
  6266. * (valid only if bit is set in
  6267. * pkt_type_enable_msdu_or_mpdu_logging)
  6268. * 1 -> MPDU level logging is enabled
  6269. * (valid only if bit is set in
  6270. * pkt_type_enable_msdu_or_mpdu_logging)
  6271. * - b'21 - dma_mpdu_data(D) : For DATA
  6272. * 0 -> MSDU level logging is enabled
  6273. * (valid only if bit is set in
  6274. * pkt_type_enable_msdu_or_mpdu_logging)
  6275. * 1 -> MPDU level logging is enabled
  6276. * (valid only if bit is set in
  6277. * pkt_type_enable_msdu_or_mpdu_logging)
  6278. * - b'22:31 - rsvd4 for future use
  6279. */
  6280. PREPACK struct htt_tx_monitor_cfg_t {
  6281. A_UINT32 msg_type: 8,
  6282. pdev_id: 8,
  6283. ring_id: 8,
  6284. status_swap: 1,
  6285. pkt_swap: 1,
  6286. tx_mon_global_en: 1,
  6287. rsvd1: 5;
  6288. A_UINT32 ring_buffer_size: 16,
  6289. config_length_mgmt: 3,
  6290. config_length_ctrl: 3,
  6291. config_length_data: 3,
  6292. rsvd2: 7;
  6293. A_UINT32 pkt_type_enable_flags: 3,
  6294. filter_in_tx_mpdu_start_mgmt: 1,
  6295. filter_in_tx_mpdu_start_ctrl: 1,
  6296. filter_in_tx_mpdu_start_data: 1,
  6297. filter_in_tx_msdu_start_mgmt: 1,
  6298. filter_in_tx_msdu_start_ctrl: 1,
  6299. filter_in_tx_msdu_start_data: 1,
  6300. filter_in_tx_mpdu_end_mgmt: 1,
  6301. filter_in_tx_mpdu_end_ctrl: 1,
  6302. filter_in_tx_mpdu_end_data: 1,
  6303. filter_in_tx_msdu_end_mgmt: 1,
  6304. filter_in_tx_msdu_end_ctrl: 1,
  6305. filter_in_tx_msdu_end_data: 1,
  6306. rsvd3: 17;
  6307. A_UINT32 tlv_filter_mask_in0;
  6308. A_UINT32 tlv_filter_mask_in1;
  6309. A_UINT32 tlv_filter_mask_in2;
  6310. A_UINT32 tlv_filter_mask_in3;
  6311. A_UINT32 tx_fes_setup_word_mask: 8,
  6312. tx_peer_entry_word_mask: 8,
  6313. tx_queue_ext_word_mask: 8,
  6314. tx_msdu_start_word_mask: 8;
  6315. A_UINT32 pcu_ppdu_setup_word_mask;
  6316. A_UINT32 tx_mpdu_start_word_mask: 8,
  6317. rxpcu_user_setup_word_mask: 8,
  6318. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6319. dma_mpdu_mgmt: 1,
  6320. dma_mpdu_ctrl: 1,
  6321. dma_mpdu_data: 1,
  6322. rsvd4: 10;
  6323. A_UINT32 tx_queue_ext_v2_word_mask: 12,
  6324. tx_peer_entry_v2_word_mask: 12,
  6325. rsvd5: 10;
  6326. A_UINT32 fes_status_end_word_mask: 16,
  6327. response_end_status_word_mask: 16;
  6328. A_UINT32 fes_status_prot_word_mask: 11,
  6329. rsvd6: 21;
  6330. } POSTPACK;
  6331. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6332. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6333. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6334. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6335. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6336. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6337. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6338. do { \
  6339. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6340. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6341. } while (0)
  6342. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6343. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6344. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6345. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6346. HTT_TX_MONITOR_CFG_RING_ID_S)
  6347. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6348. do { \
  6349. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6350. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6351. } while (0)
  6352. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6353. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6354. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6355. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6356. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6357. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6358. do { \
  6359. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6360. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6361. } while (0)
  6362. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6363. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6364. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6365. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6366. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6367. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6368. do { \
  6369. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6370. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6371. } while (0)
  6372. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6373. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6374. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6375. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6376. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6377. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6378. do { \
  6379. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6380. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6381. } while (0)
  6382. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6383. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6384. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6385. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6386. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6387. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6388. do { \
  6389. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6390. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6391. } while (0)
  6392. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6393. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6394. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6395. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6396. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6397. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6398. do { \
  6399. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6400. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6401. } while (0)
  6402. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6403. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6404. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6405. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6406. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6407. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6408. do { \
  6409. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6410. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6411. } while (0)
  6412. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6413. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6414. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6415. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6416. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6417. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6418. do { \
  6419. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6420. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6421. } while (0)
  6422. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6423. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6424. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6425. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6426. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6427. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6428. do { \
  6429. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6430. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6431. } while (0)
  6432. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6433. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6434. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6435. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6436. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6437. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6438. do { \
  6439. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6440. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6441. } while (0)
  6442. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6443. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6444. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6445. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6446. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6447. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6448. do { \
  6449. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6450. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6451. } while (0)
  6452. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6453. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6454. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6455. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6456. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6457. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6458. do { \
  6459. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6460. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6461. } while (0)
  6462. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6463. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6464. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6465. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6466. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6467. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6468. do { \
  6469. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6470. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6471. } while (0)
  6472. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6473. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6474. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6475. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6476. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6477. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6478. do { \
  6479. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6480. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6481. } while (0)
  6482. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6483. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6484. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6485. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6486. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6487. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6488. do { \
  6489. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6490. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6491. } while (0)
  6492. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6493. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6494. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6495. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6496. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6497. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6498. do { \
  6499. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6500. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6501. } while (0)
  6502. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6503. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6504. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6505. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6506. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6507. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6508. do { \
  6509. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6510. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6511. } while (0)
  6512. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6513. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6514. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6515. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6516. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6517. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6518. do { \
  6519. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6520. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6521. } while (0)
  6522. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6523. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6524. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6525. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6526. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6527. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6528. do { \
  6529. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6530. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6531. } while (0)
  6532. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6533. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6534. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6535. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6536. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6537. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6538. do { \
  6539. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6540. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6541. } while (0)
  6542. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6543. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6544. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6545. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6546. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6547. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6548. do { \
  6549. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6550. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6551. } while (0)
  6552. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6553. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6554. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6555. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6556. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6557. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6558. do { \
  6559. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6560. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6561. } while (0)
  6562. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6563. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6564. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6565. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6566. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6567. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6568. do { \
  6569. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6570. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6571. } while (0)
  6572. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6573. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6574. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6575. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6576. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6577. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6578. do { \
  6579. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6580. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6581. } while (0)
  6582. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6583. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6584. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6585. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6586. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6587. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6588. do { \
  6589. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6590. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6591. } while (0)
  6592. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6593. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6594. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6595. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6596. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6597. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6598. do { \
  6599. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6600. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6601. } while (0)
  6602. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6603. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6604. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6605. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6606. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6607. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6608. do { \
  6609. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6610. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6611. } while (0)
  6612. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6613. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6614. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6615. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6616. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6617. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6618. do { \
  6619. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6620. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6621. } while (0)
  6622. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6623. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6624. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6625. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6626. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6627. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6628. do { \
  6629. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6630. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6631. } while (0)
  6632. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6633. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6634. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6635. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6636. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6637. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6638. do { \
  6639. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6640. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6641. } while (0)
  6642. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6643. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6644. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6645. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6646. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6647. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6648. do { \
  6649. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6650. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6651. } while (0)
  6652. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6653. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6654. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6655. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6656. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6657. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6658. do { \
  6659. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6660. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6661. } while (0)
  6662. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6663. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6664. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6665. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6666. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6667. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6668. do { \
  6669. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6670. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6671. } while (0)
  6672. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M 0x00000fff
  6673. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S 0
  6674. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_GET(_var) \
  6675. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_M) >> \
  6676. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)
  6677. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_SET(_var, _val) \
  6678. do { \
  6679. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK, _val); \
  6680. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_V2_WORD_MASK_S)); \
  6681. } while (0)
  6682. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M 0x00fff000
  6683. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S 12
  6684. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_GET(_var) \
  6685. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_M) >> \
  6686. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)
  6687. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_SET(_var, _val) \
  6688. do { \
  6689. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK, _val); \
  6690. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_V2_WORD_MASK_S)); \
  6691. } while (0)
  6692. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M 0x0000ffff
  6693. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S 0
  6694. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_GET(_var) \
  6695. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_M) >> \
  6696. HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)
  6697. #define HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_SET(_var, _val) \
  6698. do { \
  6699. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK, _val); \
  6700. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_END_WORD_MASK_S)); \
  6701. } while (0)
  6702. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M 0xffff0000
  6703. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S 16
  6704. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_GET(_var) \
  6705. (((_var) & HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_M) >> \
  6706. HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)
  6707. #define HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_SET(_var, _val) \
  6708. do { \
  6709. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK, _val); \
  6710. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RESPONSE_END_STATUS_WORD_MASK_S)); \
  6711. } while (0)
  6712. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M 0x000007ff
  6713. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S 0
  6714. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_GET(_var) \
  6715. (((_var) & HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_M) >> \
  6716. HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)
  6717. #define HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_SET(_var, _val) \
  6718. do { \
  6719. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK, _val); \
  6720. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FES_STATUS_PROT_WORD_MASK_S)); \
  6721. } while (0)
  6722. /*
  6723. * pkt_type_enable_flags
  6724. */
  6725. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6726. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6727. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6728. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6729. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6730. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6731. /*
  6732. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6733. */
  6734. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6735. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6736. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6737. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6738. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6739. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6740. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6741. do { \
  6742. HTT_CHECK_SET_VAL(httsym, value); \
  6743. (word) |= (value) << httsym##_S; \
  6744. } while (0)
  6745. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6746. (((word) & httsym##_M) >> httsym##_S)
  6747. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6748. * type -> MGMT, CTRL, DATA*/
  6749. #define htt_tx_ring_pkt_type_set( \
  6750. word, mode, type, val) \
  6751. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6752. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6753. #define htt_tx_ring_pkt_type_get( \
  6754. word, mode, type) \
  6755. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6756. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6757. /* Definition to filter in TLVs */
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6795. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6796. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6797. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6798. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6799. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6800. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6801. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6802. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6803. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6804. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6805. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6806. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6807. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6822. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6823. do { \
  6824. HTT_CHECK_SET_VAL(httsym, enable); \
  6825. (word) |= (enable) << httsym##_S; \
  6826. } while (0)
  6827. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6828. (((word) & httsym##_M) >> httsym##_S)
  6829. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6830. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6831. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6832. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6833. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6834. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6872. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6873. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6874. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6875. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6876. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6877. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6878. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6879. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6880. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6881. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6882. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6883. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6884. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6899. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6900. do { \
  6901. HTT_CHECK_SET_VAL(httsym, enable); \
  6902. (word) |= (enable) << httsym##_S; \
  6903. } while (0)
  6904. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6905. (((word) & httsym##_M) >> httsym##_S)
  6906. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6907. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6908. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6909. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6910. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6911. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6929. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6930. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6931. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6932. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6933. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6934. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6935. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6936. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6937. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6938. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6939. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6940. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6941. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6942. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6943. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6944. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6945. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6946. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6947. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6948. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6949. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6950. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6951. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6952. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6953. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6954. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6955. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6956. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6957. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6958. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6959. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6960. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6961. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6962. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6963. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6964. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6965. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6966. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6967. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6968. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6969. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6970. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6971. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6972. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6973. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6974. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6975. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6976. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6977. do { \
  6978. HTT_CHECK_SET_VAL(httsym, enable); \
  6979. (word) |= (enable) << httsym##_S; \
  6980. } while (0)
  6981. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6982. (((word) & httsym##_M) >> httsym##_S)
  6983. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6984. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6985. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6986. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6987. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6988. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6989. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6990. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6991. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6992. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6993. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6994. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6995. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6996. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6997. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6998. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6999. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  7000. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  7001. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  7002. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  7003. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  7004. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  7005. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  7006. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  7007. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  7008. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  7009. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  7010. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  7011. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  7012. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  7013. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  7014. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  7015. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  7016. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  7017. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  7018. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  7019. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  7020. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  7021. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  7022. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  7023. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  7024. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  7025. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  7026. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  7027. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  7028. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  7029. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  7030. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  7031. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  7032. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  7033. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  7034. do { \
  7035. HTT_CHECK_SET_VAL(httsym, enable); \
  7036. (word) |= (enable) << httsym##_S; \
  7037. } while (0)
  7038. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  7039. (((word) & httsym##_M) >> httsym##_S)
  7040. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  7041. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  7042. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  7043. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  7044. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  7045. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  7046. /**
  7047. * @brief host --> target Receive Flow Steering configuration message definition
  7048. *
  7049. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  7050. *
  7051. * host --> target Receive Flow Steering configuration message definition.
  7052. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7053. * The reason for this is we want RFS to be configured and ready before MAC
  7054. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  7055. *
  7056. * |31 24|23 16|15 9|8|7 0|
  7057. * |----------------+----------------+----------------+----------------|
  7058. * | reserved |E| msg type |
  7059. * |-------------------------------------------------------------------|
  7060. * Where E = RFS enable flag
  7061. *
  7062. * The RFS_CONFIG message consists of a single 4-byte word.
  7063. *
  7064. * Header fields:
  7065. * - MSG_TYPE
  7066. * Bits 7:0
  7067. * Purpose: identifies this as a RFS config msg
  7068. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  7069. * - RFS_CONFIG
  7070. * Bit 8
  7071. * Purpose: Tells target whether to enable (1) or disable (0)
  7072. * flow steering feature when sending rx indication messages to host
  7073. */
  7074. #define HTT_H2T_RFS_CONFIG_M 0x100
  7075. #define HTT_H2T_RFS_CONFIG_S 8
  7076. #define HTT_RX_RFS_CONFIG_GET(_var) \
  7077. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  7078. HTT_H2T_RFS_CONFIG_S)
  7079. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  7080. do { \
  7081. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  7082. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  7083. } while (0)
  7084. #define HTT_RFS_CFG_REQ_BYTES 4
  7085. /**
  7086. * @brief host -> target FW extended statistics request
  7087. *
  7088. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  7089. *
  7090. * @details
  7091. * The following field definitions describe the format of the HTT host
  7092. * to target FW extended stats retrieve message.
  7093. * The message specifies the type of stats the host wants to retrieve.
  7094. *
  7095. * |31 24|23 16|15 8|7 0|
  7096. * |-----------------------------------------------------------|
  7097. * | reserved | stats type | pdev_mask | msg type |
  7098. * |-----------------------------------------------------------|
  7099. * | config param [0] |
  7100. * |-----------------------------------------------------------|
  7101. * | config param [1] |
  7102. * |-----------------------------------------------------------|
  7103. * | config param [2] |
  7104. * |-----------------------------------------------------------|
  7105. * | config param [3] |
  7106. * |-----------------------------------------------------------|
  7107. * | reserved |
  7108. * |-----------------------------------------------------------|
  7109. * | cookie LSBs |
  7110. * |-----------------------------------------------------------|
  7111. * | cookie MSBs |
  7112. * |-----------------------------------------------------------|
  7113. * Header fields:
  7114. * - MSG_TYPE
  7115. * Bits 7:0
  7116. * Purpose: identifies this is a extended stats upload request message
  7117. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7118. * - PDEV_MASK
  7119. * Bits 8:15
  7120. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7121. * Value: This is a overloaded field, refer to usage and interpretation of
  7122. * PDEV in interface document.
  7123. * Bit 8 : Reserved for SOC stats
  7124. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7125. * Indicates MACID_MASK in DBS
  7126. * - STATS_TYPE
  7127. * Bits 23:16
  7128. * Purpose: identifies which FW statistics to upload
  7129. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7130. * - Reserved
  7131. * Bits 31:24
  7132. * - CONFIG_PARAM [0]
  7133. * Bits 31:0
  7134. * Purpose: give an opaque configuration value to the specified stats type
  7135. * Value: stats-type specific configuration value
  7136. * Refer to htt_stats.h for interpretation for each stats sub_type
  7137. * - CONFIG_PARAM [1]
  7138. * Bits 31:0
  7139. * Purpose: give an opaque configuration value to the specified stats type
  7140. * Value: stats-type specific configuration value
  7141. * Refer to htt_stats.h for interpretation for each stats sub_type
  7142. * - CONFIG_PARAM [2]
  7143. * Bits 31:0
  7144. * Purpose: give an opaque configuration value to the specified stats type
  7145. * Value: stats-type specific configuration value
  7146. * Refer to htt_stats.h for interpretation for each stats sub_type
  7147. * - CONFIG_PARAM [3]
  7148. * Bits 31:0
  7149. * Purpose: give an opaque configuration value to the specified stats type
  7150. * Value: stats-type specific configuration value
  7151. * Refer to htt_stats.h for interpretation for each stats sub_type
  7152. * - Reserved [31:0] for future use.
  7153. * - COOKIE_LSBS
  7154. * Bits 31:0
  7155. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7156. * message with its preceding host->target stats request message.
  7157. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7158. * - COOKIE_MSBS
  7159. * Bits 31:0
  7160. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7161. * message with its preceding host->target stats request message.
  7162. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7163. */
  7164. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7165. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7166. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7167. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7168. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7169. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7170. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7171. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7172. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7173. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7174. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7175. do { \
  7176. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7177. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7178. } while (0)
  7179. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7180. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7181. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7182. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7183. do { \
  7184. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7185. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7186. } while (0)
  7187. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7188. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7189. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7190. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7191. do { \
  7192. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7193. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7194. } while (0)
  7195. /**
  7196. * @brief host -> target FW streaming statistics request
  7197. *
  7198. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7199. *
  7200. * @details
  7201. * The following field definitions describe the format of the HTT host
  7202. * to target message that requests the target to start or stop producing
  7203. * ongoing stats of the specified type.
  7204. *
  7205. * |31|30 |23 16|15 8|7 0|
  7206. * |-----------------------------------------------------------|
  7207. * |EN| reserved | stats type | reserved | msg type |
  7208. * |-----------------------------------------------------------|
  7209. * | config param [0] |
  7210. * |-----------------------------------------------------------|
  7211. * | config param [1] |
  7212. * |-----------------------------------------------------------|
  7213. * | config param [2] |
  7214. * |-----------------------------------------------------------|
  7215. * | config param [3] |
  7216. * |-----------------------------------------------------------|
  7217. * Where:
  7218. * - EN is an enable/disable flag
  7219. * Header fields:
  7220. * - MSG_TYPE
  7221. * Bits 7:0
  7222. * Purpose: identifies this is a streaming stats upload request message
  7223. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7224. * - STATS_TYPE
  7225. * Bits 23:16
  7226. * Purpose: identifies which FW statistics to upload
  7227. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7228. * Only the htt_dbg_ext_stats_type values identified as streaming
  7229. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7230. * - ENABLE
  7231. * Bit 31
  7232. * Purpose: enable/disable the target's ongoing stats of the specified type
  7233. * Value:
  7234. * 0 - disable ongoing production of the specified stats type
  7235. * 1 - enable ongoing production of the specified stats type
  7236. * - CONFIG_PARAM [0]
  7237. * Bits 31:0
  7238. * Purpose: give an opaque configuration value to the specified stats type
  7239. * Value: stats-type specific configuration value
  7240. * Refer to htt_stats.h for interpretation for each stats sub_type
  7241. * - CONFIG_PARAM [1]
  7242. * Bits 31:0
  7243. * Purpose: give an opaque configuration value to the specified stats type
  7244. * Value: stats-type specific configuration value
  7245. * Refer to htt_stats.h for interpretation for each stats sub_type
  7246. * - CONFIG_PARAM [2]
  7247. * Bits 31:0
  7248. * Purpose: give an opaque configuration value to the specified stats type
  7249. * Value: stats-type specific configuration value
  7250. * Refer to htt_stats.h for interpretation for each stats sub_type
  7251. * - CONFIG_PARAM [3]
  7252. * Bits 31:0
  7253. * Purpose: give an opaque configuration value to the specified stats type
  7254. * Value: stats-type specific configuration value
  7255. * Refer to htt_stats.h for interpretation for each stats sub_type
  7256. */
  7257. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7258. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7259. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7260. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7261. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7262. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7263. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7264. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7265. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7266. do { \
  7267. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7268. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7269. } while (0)
  7270. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7271. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7272. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7273. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7274. do { \
  7275. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7276. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7277. } while (0)
  7278. /**
  7279. * @brief host -> target FW PPDU_STATS request message
  7280. *
  7281. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7282. *
  7283. * @details
  7284. * The following field definitions describe the format of the HTT host
  7285. * to target FW for PPDU_STATS_CFG msg.
  7286. * The message allows the host to configure the PPDU_STATS_IND messages
  7287. * produced by the target.
  7288. *
  7289. * |31 24|23 16|15 8|7 0|
  7290. * |-----------------------------------------------------------|
  7291. * | REQ bit mask | pdev_mask | msg type |
  7292. * |-----------------------------------------------------------|
  7293. * Header fields:
  7294. * - MSG_TYPE
  7295. * Bits 7:0
  7296. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7297. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7298. * - PDEV_MASK
  7299. * Bits 8:15
  7300. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7301. * Value: This is a overloaded field, refer to usage and interpretation of
  7302. * PDEV in interface document.
  7303. * Bit 8 : Reserved for SOC stats
  7304. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7305. * Indicates MACID_MASK in DBS
  7306. * - REQ_TLV_BIT_MASK
  7307. * Bits 16:31
  7308. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7309. * needs to be included in the target's PPDU_STATS_IND messages.
  7310. * Value: refer htt_ppdu_stats_tlv_tag_t
  7311. *
  7312. */
  7313. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7314. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7315. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7316. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7317. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7318. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7319. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7320. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7321. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7322. do { \
  7323. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7324. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7325. } while (0)
  7326. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7327. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7328. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7329. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7330. do { \
  7331. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7332. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7333. } while (0)
  7334. /**
  7335. * @brief Host-->target HTT RX FSE setup message
  7336. *
  7337. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7338. *
  7339. * @details
  7340. * Through this message, the host will provide details of the flow tables
  7341. * in host DDR along with hash keys.
  7342. * This message can be sent per SOC or per PDEV, which is differentiated
  7343. * by pdev id values.
  7344. * The host will allocate flow search table and sends table size,
  7345. * physical DMA address of flow table, and hash keys to firmware to
  7346. * program into the RXOLE FSE HW block.
  7347. *
  7348. * The following field definitions describe the format of the RX FSE setup
  7349. * message sent from the host to target
  7350. *
  7351. * Header fields:
  7352. * dword0 - b'7:0 - msg_type: This will be set to
  7353. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7354. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7355. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7356. * pdev's LMAC ring.
  7357. * b'31:16 - reserved : Reserved for future use
  7358. * dword1 - b'19:0 - number of records: This field indicates the number of
  7359. * entries in the flow table. For example: 8k number of
  7360. * records is equivalent to
  7361. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7362. * b'27:20 - max search: This field specifies the skid length to FSE
  7363. * parser HW module whenever match is not found at the
  7364. * exact index pointed by hash.
  7365. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7366. * Refer htt_ip_da_sa_prefix below for more details.
  7367. * b'31:30 - reserved: Reserved for future use
  7368. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7369. * table allocated by host in DDR
  7370. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7371. * table allocated by host in DDR
  7372. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7373. * entry hashing
  7374. *
  7375. *
  7376. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7377. * |---------------------------------------------------------------|
  7378. * | reserved | pdev_id | MSG_TYPE |
  7379. * |---------------------------------------------------------------|
  7380. * |resvd|IPDSA| max_search | Number of records |
  7381. * |---------------------------------------------------------------|
  7382. * | base address lo |
  7383. * |---------------------------------------------------------------|
  7384. * | base address high |
  7385. * |---------------------------------------------------------------|
  7386. * | toeplitz key 31_0 |
  7387. * |---------------------------------------------------------------|
  7388. * | toeplitz key 63_32 |
  7389. * |---------------------------------------------------------------|
  7390. * | toeplitz key 95_64 |
  7391. * |---------------------------------------------------------------|
  7392. * | toeplitz key 127_96 |
  7393. * |---------------------------------------------------------------|
  7394. * | toeplitz key 159_128 |
  7395. * |---------------------------------------------------------------|
  7396. * | toeplitz key 191_160 |
  7397. * |---------------------------------------------------------------|
  7398. * | toeplitz key 223_192 |
  7399. * |---------------------------------------------------------------|
  7400. * | toeplitz key 255_224 |
  7401. * |---------------------------------------------------------------|
  7402. * | toeplitz key 287_256 |
  7403. * |---------------------------------------------------------------|
  7404. * | reserved | toeplitz key 314_288(26:0 bits) |
  7405. * |---------------------------------------------------------------|
  7406. * where:
  7407. * IPDSA = ip_da_sa
  7408. */
  7409. /**
  7410. * @brief: htt_ip_da_sa_prefix
  7411. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7412. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7413. * documentation per RFC3849
  7414. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7415. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7416. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7417. */
  7418. enum htt_ip_da_sa_prefix {
  7419. HTT_RX_IPV6_20010db8,
  7420. HTT_RX_IPV4_MAPPED_IPV6,
  7421. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7422. HTT_RX_IPV6_64FF9B,
  7423. };
  7424. /**
  7425. * @brief Host-->target HTT RX FISA configure and enable
  7426. *
  7427. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7428. *
  7429. * @details
  7430. * The host will send this command down to configure and enable the FISA
  7431. * operational params.
  7432. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7433. * register.
  7434. * Should configure both the MACs.
  7435. *
  7436. * dword0 - b'7:0 - msg_type:
  7437. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7438. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7439. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7440. * pdev's LMAC ring.
  7441. * b'31:16 - reserved : Reserved for future use
  7442. *
  7443. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7444. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7445. * packets. 1 flow search will be skipped
  7446. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7447. * tcp,udp packets
  7448. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7449. * calculation
  7450. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7451. * calculation
  7452. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7453. * calculation
  7454. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7455. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7456. * length
  7457. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7458. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7459. * length
  7460. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7461. * num jump
  7462. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7463. * num jump
  7464. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7465. * data type switch has happened for MPDU Sequence num jump
  7466. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7467. * for MPDU Sequence num jump
  7468. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7469. * for decrypt errors
  7470. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7471. * while aggregating a msdu
  7472. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7473. * The aggregation is done until (number of MSDUs aggregated
  7474. * < LIMIT + 1)
  7475. * b'31:18 - Reserved
  7476. *
  7477. * fisa_control_value - 32bit value FW can write to register
  7478. *
  7479. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7480. * Threshold value for FISA timeout (units are microseconds).
  7481. * When the global timestamp exceeds this threshold, FISA
  7482. * aggregation will be restarted.
  7483. * A value of 0 means timeout is disabled.
  7484. * Compare the threshold register with timestamp field in
  7485. * flow entry to generate timeout for the flow.
  7486. *
  7487. * |31 18 |17 16|15 8|7 0|
  7488. * |-------------------------------------------------------------|
  7489. * | reserved | pdev_mask | msg type |
  7490. * |-------------------------------------------------------------|
  7491. * | reserved | FISA_CTRL |
  7492. * |-------------------------------------------------------------|
  7493. * | FISA_TIMEOUT_THRESH |
  7494. * |-------------------------------------------------------------|
  7495. */
  7496. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7497. A_UINT32 msg_type:8,
  7498. pdev_id:8,
  7499. reserved0:16;
  7500. /**
  7501. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7502. * [17:0]
  7503. */
  7504. union {
  7505. /*
  7506. * fisa_control_bits structure is deprecated.
  7507. * Please use fisa_control_bits_v2 going forward.
  7508. */
  7509. struct {
  7510. A_UINT32 fisa_enable: 1,
  7511. ipsec_skip_search: 1,
  7512. nontcp_skip_search: 1,
  7513. add_ipv4_fixed_hdr_len: 1,
  7514. add_ipv6_fixed_hdr_len: 1,
  7515. add_tcp_fixed_hdr_len: 1,
  7516. add_udp_hdr_len: 1,
  7517. chksum_cum_ip_len_en: 1,
  7518. disable_tid_check: 1,
  7519. disable_ta_check: 1,
  7520. disable_qos_check: 1,
  7521. disable_raw_check: 1,
  7522. disable_decrypt_err_check: 1,
  7523. disable_msdu_drop_check: 1,
  7524. fisa_aggr_limit: 4,
  7525. reserved: 14;
  7526. } fisa_control_bits;
  7527. struct {
  7528. A_UINT32 fisa_enable: 1,
  7529. fisa_aggr_limit: 4,
  7530. reserved: 27;
  7531. } fisa_control_bits_v2;
  7532. A_UINT32 fisa_control_value;
  7533. } u_fisa_control;
  7534. /**
  7535. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7536. * timeout threshold for aggregation. Unit in usec.
  7537. * [31:0]
  7538. */
  7539. A_UINT32 fisa_timeout_threshold;
  7540. } POSTPACK;
  7541. /* DWord 0: pdev-ID */
  7542. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7543. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7544. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7545. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7546. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7547. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7548. do { \
  7549. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7550. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7551. } while (0)
  7552. /* Dword 1: fisa_control_value fisa config */
  7553. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7554. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7555. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7556. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7557. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7558. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7559. do { \
  7560. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7561. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7562. } while (0)
  7563. /* Dword 1: fisa_control_value ipsec_skip_search */
  7564. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7565. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7566. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7567. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7568. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7569. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7570. do { \
  7571. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7572. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7573. } while (0)
  7574. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7575. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7576. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7577. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7578. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7579. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7580. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7581. do { \
  7582. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7583. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7584. } while (0)
  7585. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7586. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7587. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7588. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7589. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7590. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7591. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7592. do { \
  7593. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7594. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7595. } while (0)
  7596. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7597. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7598. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7599. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7600. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7601. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7602. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7603. do { \
  7604. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7605. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7606. } while (0)
  7607. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7608. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7609. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7610. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7611. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7612. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7613. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7614. do { \
  7615. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7616. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7617. } while (0)
  7618. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7619. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7620. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7621. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7622. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7623. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7624. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7625. do { \
  7626. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7627. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7628. } while (0)
  7629. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7630. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7631. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7632. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7633. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7634. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7635. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7636. do { \
  7637. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7638. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7639. } while (0)
  7640. /* Dword 1: fisa_control_value disable_tid_check */
  7641. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7642. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7643. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7644. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7645. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7646. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7647. do { \
  7648. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7649. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7650. } while (0)
  7651. /* Dword 1: fisa_control_value disable_ta_check */
  7652. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7653. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7654. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7655. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7656. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7657. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7658. do { \
  7659. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7660. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7661. } while (0)
  7662. /* Dword 1: fisa_control_value disable_qos_check */
  7663. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7664. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7665. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7666. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7667. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7668. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7669. do { \
  7670. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7671. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7672. } while (0)
  7673. /* Dword 1: fisa_control_value disable_raw_check */
  7674. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7675. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7676. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7677. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7678. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7679. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7680. do { \
  7681. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7682. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7683. } while (0)
  7684. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7685. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7686. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7687. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7688. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7689. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7690. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7691. do { \
  7692. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7693. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7694. } while (0)
  7695. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7696. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7697. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7698. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7699. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7700. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7701. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7702. do { \
  7703. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7704. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7705. } while (0)
  7706. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7707. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7708. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7709. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7710. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7711. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7712. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7713. do { \
  7714. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7715. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7716. } while (0)
  7717. /* Dword 1: fisa_control_value fisa config */
  7718. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7719. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7720. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7721. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7722. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7723. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7724. do { \
  7725. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7726. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7727. } while (0)
  7728. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7729. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7730. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7731. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7732. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7733. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7734. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7735. do { \
  7736. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7737. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7738. } while (0)
  7739. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7740. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7741. pdev_id:8,
  7742. reserved0:16;
  7743. A_UINT32 num_records:20,
  7744. max_search:8,
  7745. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7746. reserved1:2;
  7747. A_UINT32 base_addr_lo;
  7748. A_UINT32 base_addr_hi;
  7749. A_UINT32 toeplitz31_0;
  7750. A_UINT32 toeplitz63_32;
  7751. A_UINT32 toeplitz95_64;
  7752. A_UINT32 toeplitz127_96;
  7753. A_UINT32 toeplitz159_128;
  7754. A_UINT32 toeplitz191_160;
  7755. A_UINT32 toeplitz223_192;
  7756. A_UINT32 toeplitz255_224;
  7757. A_UINT32 toeplitz287_256;
  7758. A_UINT32 toeplitz314_288:27,
  7759. reserved2:5;
  7760. } POSTPACK;
  7761. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7762. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7763. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7764. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7765. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7766. /* DWORD 0: Pdev ID */
  7767. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7768. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7769. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7770. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7771. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7772. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7773. do { \
  7774. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7775. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7776. } while (0)
  7777. /* DWORD 1:num of records */
  7778. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7779. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7780. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7781. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7782. HTT_RX_FSE_SETUP_NUM_REC_S)
  7783. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7784. do { \
  7785. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7786. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7787. } while (0)
  7788. /* DWORD 1:max_search */
  7789. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7790. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7791. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7792. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7793. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7794. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7795. do { \
  7796. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7797. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7798. } while (0)
  7799. /* DWORD 1:ip_da_sa prefix */
  7800. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7801. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7802. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7803. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7804. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7805. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7806. do { \
  7807. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7808. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7809. } while (0)
  7810. /* DWORD 2: Base Address LO */
  7811. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7812. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7813. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7814. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7815. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7816. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7817. do { \
  7818. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7819. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7820. } while (0)
  7821. /* DWORD 3: Base Address High */
  7822. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7823. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7824. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7825. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7826. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7827. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7828. do { \
  7829. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7830. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7831. } while (0)
  7832. /* DWORD 4-12: Hash Value */
  7833. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7834. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7835. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7836. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7837. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7838. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7839. do { \
  7840. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7841. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7842. } while (0)
  7843. /* DWORD 13: Hash Value 314:288 bits */
  7844. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7845. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7846. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7847. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7848. do { \
  7849. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7850. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7851. } while (0)
  7852. /**
  7853. * @brief Host-->target HTT RX FSE operation message
  7854. *
  7855. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7856. *
  7857. * @details
  7858. * The host will send this Flow Search Engine (FSE) operation message for
  7859. * every flow add/delete operation.
  7860. * The FSE operation includes FSE full cache invalidation or individual entry
  7861. * invalidation.
  7862. * This message can be sent per SOC or per PDEV which is differentiated
  7863. * by pdev id values.
  7864. *
  7865. * |31 16|15 8|7 1|0|
  7866. * |-------------------------------------------------------------|
  7867. * | reserved | pdev_id | MSG_TYPE |
  7868. * |-------------------------------------------------------------|
  7869. * | reserved | operation |I|
  7870. * |-------------------------------------------------------------|
  7871. * | ip_src_addr_31_0 |
  7872. * |-------------------------------------------------------------|
  7873. * | ip_src_addr_63_32 |
  7874. * |-------------------------------------------------------------|
  7875. * | ip_src_addr_95_64 |
  7876. * |-------------------------------------------------------------|
  7877. * | ip_src_addr_127_96 |
  7878. * |-------------------------------------------------------------|
  7879. * | ip_dst_addr_31_0 |
  7880. * |-------------------------------------------------------------|
  7881. * | ip_dst_addr_63_32 |
  7882. * |-------------------------------------------------------------|
  7883. * | ip_dst_addr_95_64 |
  7884. * |-------------------------------------------------------------|
  7885. * | ip_dst_addr_127_96 |
  7886. * |-------------------------------------------------------------|
  7887. * | l4_dst_port | l4_src_port |
  7888. * | (32-bit SPI incase of IPsec) |
  7889. * |-------------------------------------------------------------|
  7890. * | reserved | l4_proto |
  7891. * |-------------------------------------------------------------|
  7892. *
  7893. * where I is 1-bit ipsec_valid.
  7894. *
  7895. * The following field definitions describe the format of the RX FSE operation
  7896. * message sent from the host to target for every add/delete flow entry to flow
  7897. * table.
  7898. *
  7899. * Header fields:
  7900. * dword0 - b'7:0 - msg_type: This will be set to
  7901. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7902. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7903. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7904. * specified pdev's LMAC ring.
  7905. * b'31:16 - reserved : Reserved for future use
  7906. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7907. * (Internet Protocol Security).
  7908. * IPsec describes the framework for providing security at
  7909. * IP layer. IPsec is defined for both versions of IP:
  7910. * IPV4 and IPV6.
  7911. * Please refer to htt_rx_flow_proto enumeration below for
  7912. * more info.
  7913. * ipsec_valid = 1 for IPSEC packets
  7914. * ipsec_valid = 0 for IP Packets
  7915. * b'7:1 - operation: This indicates types of FSE operation.
  7916. * Refer to htt_rx_fse_operation enumeration:
  7917. * 0 - No Cache Invalidation required
  7918. * 1 - Cache invalidate only one entry given by IP
  7919. * src/dest address at DWORD[2:9]
  7920. * 2 - Complete FSE Cache Invalidation
  7921. * 3 - FSE Disable
  7922. * 4 - FSE Enable
  7923. * b'31:8 - reserved: Reserved for future use
  7924. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7925. * for per flow addition/deletion
  7926. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7927. * and the subsequent 3 A_UINT32 will be padding bytes.
  7928. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7929. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7930. * from 0 to 65535 but only 0 to 1023 are designated as
  7931. * well-known ports. Refer to [RFC1700] for more details.
  7932. * This field is valid only if
  7933. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7934. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7935. * range from 0 to 65535 but only 0 to 1023 are designated
  7936. * as well-known ports. Refer to [RFC1700] for more details.
  7937. * This field is valid only if
  7938. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7939. * - SPI (31:0): Security Parameters Index is an
  7940. * identification tag added to the header while using IPsec
  7941. * for tunneling the IP traffici.
  7942. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7943. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7944. * Assigned Internet Protocol Numbers.
  7945. * l4_proto numbers for standard protocol like UDP/TCP
  7946. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7947. * l4_proto = 17 for UDP etc.
  7948. * b'31:8 - reserved: Reserved for future use.
  7949. *
  7950. */
  7951. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7952. A_UINT32 msg_type:8,
  7953. pdev_id:8,
  7954. reserved0:16;
  7955. A_UINT32 ipsec_valid:1,
  7956. operation:7,
  7957. reserved1:24;
  7958. A_UINT32 ip_src_addr_31_0;
  7959. A_UINT32 ip_src_addr_63_32;
  7960. A_UINT32 ip_src_addr_95_64;
  7961. A_UINT32 ip_src_addr_127_96;
  7962. A_UINT32 ip_dest_addr_31_0;
  7963. A_UINT32 ip_dest_addr_63_32;
  7964. A_UINT32 ip_dest_addr_95_64;
  7965. A_UINT32 ip_dest_addr_127_96;
  7966. union {
  7967. A_UINT32 spi;
  7968. struct {
  7969. A_UINT32 l4_src_port:16,
  7970. l4_dest_port:16;
  7971. } ip;
  7972. } u;
  7973. A_UINT32 l4_proto:8,
  7974. reserved:24;
  7975. } POSTPACK;
  7976. /**
  7977. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7978. *
  7979. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7980. *
  7981. * @details
  7982. * The host will send this Full monitor mode register configuration message.
  7983. * This message can be sent per SOC or per PDEV which is differentiated
  7984. * by pdev id values.
  7985. *
  7986. * |31 16|15 11|10 8|7 3|2|1|0|
  7987. * |-------------------------------------------------------------|
  7988. * | reserved | pdev_id | MSG_TYPE |
  7989. * |-------------------------------------------------------------|
  7990. * | reserved |Release Ring |N|Z|E|
  7991. * |-------------------------------------------------------------|
  7992. *
  7993. * where E is 1-bit full monitor mode enable/disable.
  7994. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7995. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7996. *
  7997. * The following field definitions describe the format of the full monitor
  7998. * mode configuration message sent from the host to target for each pdev.
  7999. *
  8000. * Header fields:
  8001. * dword0 - b'7:0 - msg_type: This will be set to
  8002. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  8003. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8004. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8005. * specified pdev's LMAC ring.
  8006. * b'31:16 - reserved : Reserved for future use.
  8007. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  8008. * monitor mode rxdma register is to be enabled or disabled.
  8009. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  8010. * additional descriptors at ppdu end for zero mpdus
  8011. * enabled or disabled.
  8012. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  8013. * additional descriptors at ppdu end for non zero mpdus
  8014. * enabled or disabled.
  8015. * b'10:3 - release_ring: This indicates the destination ring
  8016. * selection for the descriptor at the end of PPDU
  8017. * 0 - REO ring select
  8018. * 1 - FW ring select
  8019. * 2 - SW ring select
  8020. * 3 - Release ring select
  8021. * Refer to htt_rx_full_mon_release_ring.
  8022. * b'31:11 - reserved for future use
  8023. */
  8024. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  8025. A_UINT32 msg_type:8,
  8026. pdev_id:8,
  8027. reserved0:16;
  8028. A_UINT32 full_monitor_mode_enable:1,
  8029. addnl_descs_zero_mpdus_end:1,
  8030. addnl_descs_non_zero_mpdus_end:1,
  8031. release_ring:8,
  8032. reserved1:21;
  8033. } POSTPACK;
  8034. /**
  8035. * Enumeration for full monitor mode destination ring select
  8036. * 0 - REO destination ring select
  8037. * 1 - FW destination ring select
  8038. * 2 - SW destination ring select
  8039. * 3 - Release destination ring select
  8040. */
  8041. enum htt_rx_full_mon_release_ring {
  8042. HTT_RX_MON_RING_REO,
  8043. HTT_RX_MON_RING_FW,
  8044. HTT_RX_MON_RING_SW,
  8045. HTT_RX_MON_RING_RELEASE,
  8046. };
  8047. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  8048. /* DWORD 0: Pdev ID */
  8049. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  8050. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  8051. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  8052. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  8053. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  8054. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  8055. do { \
  8056. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  8057. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  8058. } while (0)
  8059. /* DWORD 1:ENABLE */
  8060. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  8061. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  8062. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  8063. do { \
  8064. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  8065. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  8066. } while (0)
  8067. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  8068. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  8069. /* DWORD 1:ZERO_MPDU */
  8070. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  8071. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  8072. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  8073. do { \
  8074. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  8075. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  8076. } while (0)
  8077. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  8078. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  8079. /* DWORD 1:NON_ZERO_MPDU */
  8080. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  8081. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  8082. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  8083. do { \
  8084. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  8085. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  8086. } while (0)
  8087. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  8088. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  8089. /* DWORD 1:RELEASE_RINGS */
  8090. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  8091. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  8092. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  8093. do { \
  8094. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  8095. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  8096. } while (0)
  8097. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  8098. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  8099. /**
  8100. * Enumeration for IP Protocol or IPSEC Protocol
  8101. * IPsec describes the framework for providing security at IP layer.
  8102. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  8103. */
  8104. enum htt_rx_flow_proto {
  8105. HTT_RX_FLOW_IP_PROTO,
  8106. HTT_RX_FLOW_IPSEC_PROTO,
  8107. };
  8108. /**
  8109. * Enumeration for FSE Cache Invalidation
  8110. * 0 - No Cache Invalidation required
  8111. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8112. * 2 - Complete FSE Cache Invalidation
  8113. * 3 - FSE Disable
  8114. * 4 - FSE Enable
  8115. */
  8116. enum htt_rx_fse_operation {
  8117. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8118. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8119. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8120. HTT_RX_FSE_DISABLE,
  8121. HTT_RX_FSE_ENABLE,
  8122. };
  8123. /* DWORD 0: Pdev ID */
  8124. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8125. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8126. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8127. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8128. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8129. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8130. do { \
  8131. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8132. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8133. } while (0)
  8134. /* DWORD 1:IP PROTO or IPSEC */
  8135. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8136. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8137. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8138. do { \
  8139. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8140. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8141. } while (0)
  8142. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8143. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8144. /* DWORD 1:FSE Operation */
  8145. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8146. #define HTT_RX_FSE_OPERATION_S 1
  8147. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8148. do { \
  8149. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8150. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8151. } while (0)
  8152. #define HTT_RX_FSE_OPERATION_GET(word) \
  8153. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8154. /* DWORD 2-9:IP Address */
  8155. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8156. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8157. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8158. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8159. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8160. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8161. do { \
  8162. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8163. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8164. } while (0)
  8165. /* DWORD 10:Source Port Number */
  8166. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8167. #define HTT_RX_FSE_SOURCEPORT_S 0
  8168. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8169. do { \
  8170. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8171. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8172. } while (0)
  8173. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8174. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8175. /* DWORD 11:Destination Port Number */
  8176. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8177. #define HTT_RX_FSE_DESTPORT_S 16
  8178. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8179. do { \
  8180. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8181. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8182. } while (0)
  8183. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8184. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8185. /* DWORD 10-11:SPI (In case of IPSEC) */
  8186. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8187. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8188. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8189. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8190. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8191. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8192. do { \
  8193. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8194. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8195. } while (0)
  8196. /* DWORD 12:L4 PROTO */
  8197. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8198. #define HTT_RX_FSE_L4_PROTO_S 0
  8199. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8200. do { \
  8201. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8202. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8203. } while (0)
  8204. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8205. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8206. /**
  8207. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8208. *
  8209. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8210. *
  8211. * |31 24|23 |15 8|7 2|1|0|
  8212. * |----------------+----------------+----------------+----------------|
  8213. * | reserved | pdev_id | msg_type |
  8214. * |---------------------------------+----------------+----------------|
  8215. * | reserved |E|F|
  8216. * |---------------------------------+----------------+----------------|
  8217. * Where E = Configure the target to provide the 3-tuple hash value in
  8218. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8219. * F = Configure the target to provide the 3-tuple hash value in
  8220. * flow_id_toeplitz field of rx_msdu_start tlv
  8221. *
  8222. * The following field definitions describe the format of the 3 tuple hash value
  8223. * message sent from the host to target as part of initialization sequence.
  8224. *
  8225. * Header fields:
  8226. * dword0 - b'7:0 - msg_type: This will be set to
  8227. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8228. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8229. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8230. * specified pdev's LMAC ring.
  8231. * b'31:16 - reserved : Reserved for future use
  8232. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8233. * b'1 - toeplitz_hash_2_or_4_field_enable
  8234. * b'31:2 - reserved : Reserved for future use
  8235. * ---------+------+----------------------------------------------------------
  8236. * bit1 | bit0 | Functionality
  8237. * ---------+------+----------------------------------------------------------
  8238. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8239. * | | in flow_id_toeplitz field
  8240. * ---------+------+----------------------------------------------------------
  8241. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8242. * | | in toeplitz_hash_2_or_4 field
  8243. * ---------+------+----------------------------------------------------------
  8244. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8245. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8246. * ---------+------+----------------------------------------------------------
  8247. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8248. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8249. * | | toeplitz_hash_2_or_4 field
  8250. *----------------------------------------------------------------------------
  8251. */
  8252. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8253. A_UINT32 msg_type :8,
  8254. pdev_id :8,
  8255. reserved0 :16;
  8256. A_UINT32 flow_id_toeplitz_field_enable :1,
  8257. toeplitz_hash_2_or_4_field_enable :1,
  8258. reserved1 :30;
  8259. } POSTPACK;
  8260. /* DWORD0 : pdev_id configuration Macros */
  8261. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8262. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8263. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8264. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8265. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8266. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8267. do { \
  8268. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8269. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8270. } while (0)
  8271. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8272. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8273. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8274. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8275. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8276. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8277. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8278. do { \
  8279. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8280. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8281. } while (0)
  8282. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8283. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8284. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8285. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8286. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8287. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8288. do { \
  8289. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8290. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8291. } while (0)
  8292. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8293. /**
  8294. * @brief host --> target Host PA Address Size
  8295. *
  8296. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8297. *
  8298. * @details
  8299. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8300. * provide the physical start address and size of each of the memory
  8301. * areas within host DDR that the target FW may need to access.
  8302. *
  8303. * For example, the host can use this message to allow the target FW
  8304. * to set up access to the host's pools of TQM link descriptors.
  8305. * The message would appear as follows:
  8306. *
  8307. * |31 24|23 16|15 8|7 0|
  8308. * |----------------+----------------+----------------+----------------|
  8309. * | reserved | num_entries | msg_type |
  8310. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8311. * | mem area 0 size |
  8312. * |----------------+----------------+----------------+----------------|
  8313. * | mem area 0 physical_address_lo |
  8314. * |----------------+----------------+----------------+----------------|
  8315. * | mem area 0 physical_address_hi |
  8316. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8317. * | mem area 1 size |
  8318. * |----------------+----------------+----------------+----------------|
  8319. * | mem area 1 physical_address_lo |
  8320. * |----------------+----------------+----------------+----------------|
  8321. * | mem area 1 physical_address_hi |
  8322. * |----------------+----------------+----------------+----------------|
  8323. * ...
  8324. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8325. * | mem area N size |
  8326. * |----------------+----------------+----------------+----------------|
  8327. * | mem area N physical_address_lo |
  8328. * |----------------+----------------+----------------+----------------|
  8329. * | mem area N physical_address_hi |
  8330. * |----------------+----------------+----------------+----------------|
  8331. *
  8332. * The message is interpreted as follows:
  8333. * dword0 - b'0:7 - msg_type: This will be set to
  8334. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8335. * b'8:15 - number_entries: Indicated the number of host memory
  8336. * areas specified within the remainder of the message
  8337. * b'16:31 - reserved.
  8338. * dword1 - b'0:31 - memory area 0 size in bytes
  8339. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8340. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8341. * and similar for memory area 1 through memory area N.
  8342. */
  8343. PREPACK struct htt_h2t_host_paddr_size {
  8344. A_UINT32 msg_type: 8,
  8345. num_entries: 8,
  8346. reserved: 16;
  8347. } POSTPACK;
  8348. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8349. A_UINT32 size;
  8350. A_UINT32 physical_address_lo;
  8351. A_UINT32 physical_address_hi;
  8352. } POSTPACK;
  8353. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE \
  8354. (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8355. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_DWORDS \
  8356. (HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE >> 2)
  8357. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8358. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8359. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8360. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8361. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8362. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8363. do { \
  8364. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8365. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8366. } while (0)
  8367. /**
  8368. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8369. *
  8370. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8371. *
  8372. * @details
  8373. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8374. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8375. *
  8376. * The message would appear as follows:
  8377. *
  8378. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8379. * |---------------------------------+---+---+----------+-+-----------|
  8380. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8381. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8382. *
  8383. *
  8384. * The message is interpreted as follows:
  8385. * dword0 - b'0:7 - msg_type: This will be set to
  8386. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8387. * b'8 - override bit to drive MSDUs to PPE ring
  8388. * b'9:13 - REO destination ring indication
  8389. * b'14 - Multi buffer msdu override enable bit
  8390. * b'15 - Intra BSS override
  8391. * b'16 - Decap raw override
  8392. * b'17 - Decap Native wifi override
  8393. * b'18 - IP frag override
  8394. * b'19:31 - reserved
  8395. */
  8396. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8397. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8398. override: 1,
  8399. reo_destination_indication: 5,
  8400. multi_buffer_msdu_override_en: 1,
  8401. intra_bss_override: 1,
  8402. decap_raw_override: 1,
  8403. decap_nwifi_override: 1,
  8404. ip_frag_override: 1,
  8405. reserved: 13;
  8406. } POSTPACK;
  8407. /* DWORD 0: Override */
  8408. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8409. #define HTT_PPE_CFG_OVERRIDE_S 8
  8410. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8411. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8412. HTT_PPE_CFG_OVERRIDE_S)
  8413. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8414. do { \
  8415. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8416. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8417. } while (0)
  8418. /* DWORD 0: REO Destination Indication*/
  8419. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8420. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8421. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8422. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8423. HTT_PPE_CFG_REO_DEST_IND_S)
  8424. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8425. do { \
  8426. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8427. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8428. } while (0)
  8429. /* DWORD 0: Multi buffer MSDU override */
  8430. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8431. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8432. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8433. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8434. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8435. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8436. do { \
  8437. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8438. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8439. } while (0)
  8440. /* DWORD 0: Intra BSS override */
  8441. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8442. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8443. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8444. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8445. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8446. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8447. do { \
  8448. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8449. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8450. } while (0)
  8451. /* DWORD 0: Decap RAW override */
  8452. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8453. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8454. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8455. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8456. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8457. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8458. do { \
  8459. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8460. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8461. } while (0)
  8462. /* DWORD 0: Decap NWIFI override */
  8463. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8464. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8465. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8466. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8467. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8468. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8469. do { \
  8470. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8471. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8472. } while (0)
  8473. /* DWORD 0: IP frag override */
  8474. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8475. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8476. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8477. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8478. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8479. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8480. do { \
  8481. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8482. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8483. } while (0)
  8484. /*
  8485. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8486. *
  8487. * @details
  8488. * The following field definitions describe the format of the HTT host
  8489. * to target FW VDEV TX RX stats retrieve message.
  8490. * The message specifies the type of stats the host wants to retrieve.
  8491. *
  8492. * |31 27|26 25|24 17|16|15 8|7 0|
  8493. * |-----------------------------------------------------------|
  8494. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8495. * |-----------------------------------------------------------|
  8496. * | vdev_id lower bitmask |
  8497. * |-----------------------------------------------------------|
  8498. * | vdev_id upper bitmask |
  8499. * |-----------------------------------------------------------|
  8500. * Header fields:
  8501. * Where:
  8502. * dword0 - b'7:0 - msg_type: This will be set to
  8503. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8504. * b'15:8 - pdev id
  8505. * b'16(E) - Enable/Disable the vdev HW stats
  8506. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8507. * b'25:26(R) - Reset stats bits
  8508. * 0: don't reset stats
  8509. * 1: reset stats once
  8510. * 2: reset stats at the start of each periodic interval
  8511. * b'27:31 - reserved for future use
  8512. * dword1 - b'0:31 - vdev_id lower bitmask
  8513. * dword2 - b'0:31 - vdev_id upper bitmask
  8514. */
  8515. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8516. A_UINT32 msg_type :8,
  8517. pdev_id :8,
  8518. enable :1,
  8519. periodic_interval :8,
  8520. reset_stats_bits :2,
  8521. reserved0 :5;
  8522. A_UINT32 vdev_id_lower_bitmask;
  8523. A_UINT32 vdev_id_upper_bitmask;
  8524. } POSTPACK;
  8525. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8526. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8527. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8528. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8529. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8530. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8531. do { \
  8532. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8533. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8534. } while (0)
  8535. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8536. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8537. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8538. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8539. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8540. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8541. do { \
  8542. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8543. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8544. } while (0)
  8545. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8546. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8547. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8548. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8549. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8550. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8551. do { \
  8552. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8553. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8554. } while (0)
  8555. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8556. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8557. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8558. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8559. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8560. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8561. do { \
  8562. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8563. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8564. } while (0)
  8565. /*
  8566. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8567. *
  8568. * @details
  8569. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8570. * the default MSDU queues for one of the TIDs within the specified peer
  8571. * to the specified service class.
  8572. * The TID is indirectly specified - each service class is associated
  8573. * with a TID. All default MSDU queues for this peer-TID will be
  8574. * linked to the service class in question.
  8575. *
  8576. * |31 16|15 8|7 0|
  8577. * |------------------------------+--------------+--------------|
  8578. * | peer ID | svc class ID | msg type |
  8579. * |------------------------------------------------------------|
  8580. * Header fields:
  8581. * dword0 - b'7:0 - msg_type: This will be set to
  8582. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8583. * b'15:8 - service class ID
  8584. * b'31:16 - peer ID
  8585. */
  8586. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8587. A_UINT32 msg_type :8,
  8588. svc_class_id :8,
  8589. peer_id :16;
  8590. } POSTPACK;
  8591. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8592. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8593. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8594. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8595. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8596. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8597. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8598. do { \
  8599. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8600. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8601. } while (0)
  8602. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8603. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8604. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8605. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8606. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8607. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8608. do { \
  8609. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8610. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8611. } while (0)
  8612. /*
  8613. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8614. *
  8615. * @details
  8616. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8617. * remove the linkage of the specified peer-TID's MSDU queues to
  8618. * service classes.
  8619. *
  8620. * |31 16|15 8|7 0|
  8621. * |------------------------------+--------------+--------------|
  8622. * | peer ID | svc class ID | msg type |
  8623. * |------------------------------------------------------------|
  8624. * Header fields:
  8625. * dword0 - b'7:0 - msg_type: This will be set to
  8626. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8627. * b'15:8 - service class ID
  8628. * b'31:16 - peer ID
  8629. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8630. * value for peer ID indicates that the target should
  8631. * apply the UNMAP_REQ to all peers.
  8632. */
  8633. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8634. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8635. A_UINT32 msg_type :8,
  8636. svc_class_id :8,
  8637. peer_id :16;
  8638. } POSTPACK;
  8639. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8640. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8641. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8642. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8643. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8644. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8645. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8646. do { \
  8647. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8648. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8649. } while (0)
  8650. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8651. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8652. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8653. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8654. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8655. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8656. do { \
  8657. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8658. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8659. } while (0)
  8660. /*
  8661. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8662. *
  8663. * @details
  8664. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8665. * request the target to report what service class the default MSDU queues
  8666. * of the specified TIDs within the peer are linked to.
  8667. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8668. * to report what service class (if any) the default MSDU queues for
  8669. * each of the specified TIDs are linked to.
  8670. *
  8671. * |31 16|15 8|7 1| 0|
  8672. * |------------------------------+--------------+--------------|
  8673. * | peer ID | TID mask | msg type |
  8674. * |------------------------------------------------------------|
  8675. * | reserved |ETO|
  8676. * |------------------------------------------------------------|
  8677. * Header fields:
  8678. * dword0 - b'7:0 - msg_type: This will be set to
  8679. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8680. * b'15:8 - TID mask
  8681. * b'31:16 - peer ID
  8682. * dword1 - b'0 - "Existing Tids Only" flag
  8683. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8684. * message generated by this REQ will only show the
  8685. * mapping for TIDs that actually exist in the target's
  8686. * peer object.
  8687. * Any TIDs that are covered by a MAP_REQ but which
  8688. * do not actually exist will be shown as being
  8689. * unmapped (i.e. svc class ID 0xff).
  8690. * If this flag is cleared, the MAP_REPORT_CONF message
  8691. * will consider not only the mapping of TIDs currently
  8692. * existing in the peer, but also the mapping that will
  8693. * be applied for any TID objects created within this
  8694. * peer in the future.
  8695. * b'31:1 - reserved for future use
  8696. */
  8697. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8698. A_UINT32 msg_type :8,
  8699. tid_mask :8,
  8700. peer_id :16;
  8701. A_UINT32 existing_tids_only:1,
  8702. reserved :31;
  8703. } POSTPACK;
  8704. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8705. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8706. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8707. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8708. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8709. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8710. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8711. do { \
  8712. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8713. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8714. } while (0)
  8715. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8716. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8717. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8718. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8719. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8720. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8721. do { \
  8722. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8723. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8724. } while (0)
  8725. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8726. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8727. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8728. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8729. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8730. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8731. do { \
  8732. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8733. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8734. } while (0)
  8735. /**
  8736. * @brief Format of shared memory between Host and Target
  8737. * for UMAC hang recovery feature messaging.
  8738. * @details
  8739. * This is shared memory between Host and Target allocated
  8740. * and used in chips where UMAC hang recovery feature is supported.
  8741. * If target sets a bit in t2h_msg (provided it's valid bit offset)
  8742. * then host interprets it as a new message from target.
  8743. * Host clears that particular read bit in t2h_msg after each read
  8744. * operation. It is vice versa for h2t_msg. At any given point
  8745. * of time there is expected to be only one bit set
  8746. * either in t2h_msg or h2t_msg (referring to valid bit offset).
  8747. *
  8748. * The message is interpreted as follows:
  8749. * dword0 - b'0:31 - magic_num: Magic number for the shared memory region
  8750. * added for debuggability purpose.
  8751. * dword1 - b'0 - do_pre_reset
  8752. * b'1 - do_post_reset_start
  8753. * b'2 - do_post_reset_complete
  8754. * b'3:31 - rsvd_t2h
  8755. * dword2 - b'0 - pre_reset_done
  8756. * b'1 - post_reset_start_done
  8757. * b'2 - post_reset_complete_done
  8758. * b'3:31 - rsvd_h2t
  8759. */
  8760. PREPACK typedef struct {
  8761. /** Magic number added for debuggability. */
  8762. A_UINT32 magic_num;
  8763. union {
  8764. /*
  8765. * BIT [0] :- T2H msg to do pre-reset
  8766. * BIT [1] :- T2H msg to do post-reset start
  8767. * BIT [2] :- T2H msg to do post-reset complete
  8768. * BIT [31 : 3] :- reserved
  8769. */
  8770. A_UINT32 t2h_msg;
  8771. struct {
  8772. A_UINT32 do_pre_reset : 1, /* BIT [0] */
  8773. do_post_reset_start : 1, /* BIT [1] */
  8774. do_post_reset_complete : 1, /* BIT [2] */
  8775. rsvd_t2h : 29; /* BIT [31 : 3] */
  8776. };
  8777. };
  8778. union {
  8779. /*
  8780. * BIT [0] :- H2T msg to send pre-reset done
  8781. * BIT [1] :- H2T msg to send post-reset start done
  8782. * BIT [2] :- H2T msg to send post-reset complete done
  8783. * BIT [31 : 3] :- reserved
  8784. */
  8785. A_UINT32 h2t_msg;
  8786. struct {
  8787. A_UINT32 pre_reset_done : 1, /* BIT [0] */
  8788. post_reset_start_done : 1, /* BIT [1] */
  8789. post_reset_complete_done : 1, /* BIT [2] */
  8790. rsvd_h2t : 29; /* BIT [31 : 3] */
  8791. };
  8792. };
  8793. } POSTPACK htt_umac_hang_recovery_msg_shmem_t;
  8794. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES \
  8795. (sizeof(htt_umac_hang_recovery_msg_shmem_t))
  8796. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DWORDS \
  8797. (HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_BYTES >> 2)
  8798. /* dword1 - b'0 - do_pre_reset */
  8799. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M 0x00000001
  8800. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S 0
  8801. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_GET(word1) \
  8802. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_M) >> \
  8803. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S)
  8804. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_SET(word1, _val) \
  8805. do { \
  8806. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET, _val); \
  8807. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_PRE_RESET_S));\
  8808. } while (0)
  8809. /* dword1 - b'1 - do_post_reset_start */
  8810. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M 0x00000002
  8811. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S 1
  8812. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_GET(word1) \
  8813. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_M) >> \
  8814. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S)
  8815. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_SET(word1, _val) \
  8816. do { \
  8817. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START, _val); \
  8818. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_START_S));\
  8819. } while (0)
  8820. /* dword1 - b'2 - do_post_reset_complete */
  8821. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M 0x00000004
  8822. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S 2
  8823. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_GET(word1) \
  8824. (((word1) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_M) >> \
  8825. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S)
  8826. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_SET(word1, _val) \
  8827. do { \
  8828. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE, _val); \
  8829. ((word1) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_DO_POST_RESET_COMPLETE_S));\
  8830. } while (0)
  8831. /* dword2 - b'0 - pre_reset_done */
  8832. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M 0x00000001
  8833. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S 0
  8834. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_GET(word2) \
  8835. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_M) >> \
  8836. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S)
  8837. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_SET(word2, _val) \
  8838. do { \
  8839. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE, _val); \
  8840. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_PRE_RESET_DONE_S));\
  8841. } while (0)
  8842. /* dword2 - b'1 - post_reset_start_done */
  8843. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M 0x00000002
  8844. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S 1
  8845. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_GET(word2) \
  8846. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_M) >> \
  8847. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S)
  8848. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_SET(word2, _val) \
  8849. do { \
  8850. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE, _val); \
  8851. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_START_DONE_S));\
  8852. } while (0)
  8853. /* dword2 - b'2 - post_reset_complete_done */
  8854. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M 0x00000004
  8855. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S 2
  8856. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_GET(word2) \
  8857. (((word2) & HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_M) >> \
  8858. HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S)
  8859. #define HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_SET(word2, _val) \
  8860. do { \
  8861. HTT_CHECK_SET_VAL(HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE, _val); \
  8862. ((word2) |= ((_val) << HTT_UMAC_HANG_RECOVERY_MSG_SHMEM_POST_RESET_COMPLETE_DONE_S));\
  8863. } while (0)
  8864. /**
  8865. * @brief HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message
  8866. *
  8867. * @details
  8868. * The HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP message is sent
  8869. * by the host to provide prerequisite info to target for the UMAC hang
  8870. * recovery feature.
  8871. * The info sent in this H2T message are T2H message method, H2T message
  8872. * method, T2H MSI interrupt number and physical start address, size of
  8873. * the shared memory (refers to the shared memory dedicated for messaging
  8874. * between host and target when the DUT is in UMAC hang recovery mode).
  8875. * This H2T message is expected to be only sent if the WMI service bit
  8876. * WMI_SERVICE_UMAC_HANG_RECOVERY_SUPPORT was firstly indicated by the target.
  8877. *
  8878. * |31 16|15 12|11 8|7 0|
  8879. * |-------------------------------+--------------+--------------+------------|
  8880. * | reserved |h2t msg method|t2h msg method| msg_type |
  8881. * |--------------------------------------------------------------------------|
  8882. * | t2h msi interrupt number |
  8883. * |--------------------------------------------------------------------------|
  8884. * | shared memory area size |
  8885. * |--------------------------------------------------------------------------|
  8886. * | shared memory area physical address low |
  8887. * |--------------------------------------------------------------------------|
  8888. * | shared memory area physical address high |
  8889. * |--------------------------------------------------------------------------|
  8890. *
  8891. * The message is interpreted as follows:
  8892. * dword0 - b'0:7 - msg_type (= HTT_H2T_MSG_TYPE_UMAC_HANG_RECOVERY_SETUP)
  8893. * b'8:11 - t2h_msg_method: indicates method to be used for
  8894. * T2H communication in UMAC hang recovery mode.
  8895. * Value zero indicates MSI interrupt (default method).
  8896. * Refer to htt_umac_hang_recovery_msg_method enum.
  8897. * b'12:15 - h2t_msg_method: indicates method to be used for
  8898. * H2T communication in UMAC hang recovery mode.
  8899. * Value zero indicates polling by target for this h2t msg
  8900. * during UMAC hang recovery mode.
  8901. * Refer to htt_umac_hang_recovery_msg_method enum.
  8902. * b'16:31 - reserved.
  8903. * dword1 - b'0:31 - t2h_msi_data: MSI data to be used for
  8904. * T2H communication in UMAC hang recovery mode.
  8905. * dword2 - b'0:31 - size: size of shared memory dedicated for messaging
  8906. * only when in UMAC hang recovery mode.
  8907. * This refers to size in bytes.
  8908. * dword3 - b'0:31 - physical_address_lo: lower 32 bit physical address
  8909. * of the shared memory dedicated for messaging only when
  8910. * in UMAC hang recovery mode.
  8911. * dword4 - b'0:31 - physical_address_hi: higher 32 bit physical address
  8912. * of the shared memory dedicated for messaging only when
  8913. * in UMAC hang recovery mode.
  8914. */
  8915. /* t2h_msg_method and h2t_msg_method */
  8916. enum htt_umac_hang_recovery_msg_method {
  8917. htt_umac_hang_recovery_msg_t2h_msi_and_h2t_polling = 0,
  8918. };
  8919. PREPACK typedef struct {
  8920. A_UINT32 msg_type : 8,
  8921. t2h_msg_method : 4,
  8922. h2t_msg_method : 4,
  8923. reserved : 16;
  8924. A_UINT32 t2h_msi_data;
  8925. /* size bytes and physical address of shared memory. */
  8926. struct htt_h2t_host_paddr_size_entry_t msg_shared_mem;
  8927. } POSTPACK htt_h2t_umac_hang_recovery_prerequisite_setup_t;
  8928. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES \
  8929. (sizeof(htt_h2t_umac_hang_recovery_prerequisite_setup_t))
  8930. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_DWORDS \
  8931. (HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_BYTES >> 2)
  8932. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M 0x00000F00
  8933. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S 8
  8934. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_GET(word0) \
  8935. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_M) >> \
  8936. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S)
  8937. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_SET(word0, _val) \
  8938. do { \
  8939. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD, _val); \
  8940. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_T2H_MSG_METHOD_S));\
  8941. } while (0)
  8942. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M 0x0000F000
  8943. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S 12
  8944. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_GET(word0) \
  8945. (((word0) & HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_M) >> \
  8946. HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S)
  8947. #define HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_SET(word0, _val) \
  8948. do { \
  8949. HTT_CHECK_SET_VAL(HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD, _val); \
  8950. ((word0) |= ((_val) << HTT_H2T_UMAC_HANG_RECOVERY_PREREQUISITE_SETUP_H2T_MSG_METHOD_S));\
  8951. } while (0)
  8952. /*=== target -> host messages ===============================================*/
  8953. enum htt_t2h_msg_type {
  8954. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8955. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8956. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8957. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8958. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8959. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8960. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8961. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8962. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8963. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8964. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8965. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8966. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8967. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8968. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8969. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8970. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8971. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8972. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8973. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8974. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8975. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8976. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8977. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8978. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8979. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8980. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8981. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8982. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8983. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8984. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8985. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8986. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8987. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8988. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8989. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8990. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8991. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8992. /* TX_OFFLOAD_DELIVER_IND:
  8993. * Forward the target's locally-generated packets to the host,
  8994. * to provide to the monitor mode interface.
  8995. */
  8996. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8997. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8998. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8999. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  9000. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  9001. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  9002. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  9003. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  9004. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  9005. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  9006. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  9007. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  9008. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  9009. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  9010. HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN = 0x31,
  9011. HTT_T2H_MSG_TYPE_RX_DELBA_EXTN = 0x32,
  9012. HTT_T2H_MSG_TYPE_TEST,
  9013. /* keep this last */
  9014. HTT_T2H_NUM_MSGS
  9015. };
  9016. /*
  9017. * HTT target to host message type -
  9018. * stored in bits 7:0 of the first word of the message
  9019. */
  9020. #define HTT_T2H_MSG_TYPE_M 0xff
  9021. #define HTT_T2H_MSG_TYPE_S 0
  9022. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  9023. do { \
  9024. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  9025. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  9026. } while (0)
  9027. #define HTT_T2H_MSG_TYPE_GET(word) \
  9028. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  9029. /**
  9030. * @brief target -> host version number confirmation message definition
  9031. *
  9032. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  9033. *
  9034. * |31 24|23 16|15 8|7 0|
  9035. * |----------------+----------------+----------------+----------------|
  9036. * | reserved | major number | minor number | msg type |
  9037. * |-------------------------------------------------------------------|
  9038. * : option request TLV (optional) |
  9039. * :...................................................................:
  9040. *
  9041. * The VER_CONF message may consist of a single 4-byte word, or may be
  9042. * extended with TLVs that specify HTT options selected by the target.
  9043. * The following option TLVs may be appended to the VER_CONF message:
  9044. * - LL_BUS_ADDR_SIZE
  9045. * - HL_SUPPRESS_TX_COMPL_IND
  9046. * - MAX_TX_QUEUE_GROUPS
  9047. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  9048. * may be appended to the VER_CONF message (but only one TLV of each type).
  9049. *
  9050. * Header fields:
  9051. * - MSG_TYPE
  9052. * Bits 7:0
  9053. * Purpose: identifies this as a version number confirmation message
  9054. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  9055. * - VER_MINOR
  9056. * Bits 15:8
  9057. * Purpose: Specify the minor number of the HTT message library version
  9058. * in use by the target firmware.
  9059. * The minor number specifies the specific revision within a range
  9060. * of fundamentally compatible HTT message definition revisions.
  9061. * Compatible revisions involve adding new messages or perhaps
  9062. * adding new fields to existing messages, in a backwards-compatible
  9063. * manner.
  9064. * Incompatible revisions involve changing the message type values,
  9065. * or redefining existing messages.
  9066. * Value: minor number
  9067. * - VER_MAJOR
  9068. * Bits 15:8
  9069. * Purpose: Specify the major number of the HTT message library version
  9070. * in use by the target firmware.
  9071. * The major number specifies the family of minor revisions that are
  9072. * fundamentally compatible with each other, but not with prior or
  9073. * later families.
  9074. * Value: major number
  9075. */
  9076. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  9077. #define HTT_VER_CONF_MINOR_S 8
  9078. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  9079. #define HTT_VER_CONF_MAJOR_S 16
  9080. #define HTT_VER_CONF_MINOR_SET(word, value) \
  9081. do { \
  9082. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  9083. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  9084. } while (0)
  9085. #define HTT_VER_CONF_MINOR_GET(word) \
  9086. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  9087. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  9088. do { \
  9089. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  9090. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  9091. } while (0)
  9092. #define HTT_VER_CONF_MAJOR_GET(word) \
  9093. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  9094. #define HTT_VER_CONF_BYTES 4
  9095. /**
  9096. * @brief - target -> host HTT Rx In order indication message
  9097. *
  9098. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  9099. *
  9100. * @details
  9101. *
  9102. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  9103. * |----------------+-------------------+---------------------+---------------|
  9104. * | peer ID | P| F| O| ext TID | msg type |
  9105. * |--------------------------------------------------------------------------|
  9106. * | MSDU count | Reserved | vdev id |
  9107. * |--------------------------------------------------------------------------|
  9108. * | MSDU 0 bus address (bits 31:0) |
  9109. #if HTT_PADDR64
  9110. * | MSDU 0 bus address (bits 63:32) |
  9111. #endif
  9112. * |--------------------------------------------------------------------------|
  9113. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  9114. * |--------------------------------------------------------------------------|
  9115. * | MSDU 1 bus address (bits 31:0) |
  9116. #if HTT_PADDR64
  9117. * | MSDU 1 bus address (bits 63:32) |
  9118. #endif
  9119. * |--------------------------------------------------------------------------|
  9120. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  9121. * |--------------------------------------------------------------------------|
  9122. */
  9123. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  9124. *
  9125. * @details
  9126. * bits
  9127. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  9128. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9129. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  9130. * | | frag | | | | fail |chksum fail|
  9131. * |-----+----+-------+--------+--------+---------+---------+-----------|
  9132. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  9133. */
  9134. struct htt_rx_in_ord_paddr_ind_hdr_t
  9135. {
  9136. A_UINT32 /* word 0 */
  9137. msg_type: 8,
  9138. ext_tid: 5,
  9139. offload: 1,
  9140. frag: 1,
  9141. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  9142. peer_id: 16;
  9143. A_UINT32 /* word 1 */
  9144. vap_id: 8,
  9145. /* NOTE:
  9146. * This reserved_1 field is not truly reserved - certain targets use
  9147. * this field internally to store debug information, and do not zero
  9148. * out the contents of the field before uploading the message to the
  9149. * host. Thus, any host-target communication supported by this field
  9150. * is limited to using values that are never used by the debug
  9151. * information stored by certain targets in the reserved_1 field.
  9152. * In particular, the targets in question don't use the value 0x3
  9153. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  9154. * so this previously-unused value within these bits is available to
  9155. * use as the host / target PKT_CAPTURE_MODE flag.
  9156. */
  9157. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  9158. /* if pkt_capture_mode == 0x3, host should
  9159. * send rx frames to monitor mode interface
  9160. */
  9161. msdu_cnt: 16;
  9162. };
  9163. struct htt_rx_in_ord_paddr_ind_msdu32_t
  9164. {
  9165. A_UINT32 dma_addr;
  9166. A_UINT32
  9167. length: 16,
  9168. fw_desc: 8,
  9169. msdu_info:8;
  9170. };
  9171. struct htt_rx_in_ord_paddr_ind_msdu64_t
  9172. {
  9173. A_UINT32 dma_addr_lo;
  9174. A_UINT32 dma_addr_hi;
  9175. A_UINT32
  9176. length: 16,
  9177. fw_desc: 8,
  9178. msdu_info:8;
  9179. };
  9180. #if HTT_PADDR64
  9181. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  9182. #else
  9183. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  9184. #endif
  9185. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  9186. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  9187. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  9188. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  9189. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  9190. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  9191. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  9192. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  9193. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  9194. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  9195. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  9196. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  9197. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  9198. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  9199. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  9200. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  9201. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  9202. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  9203. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  9204. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  9205. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  9206. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  9207. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  9208. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  9209. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  9210. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  9211. /* for systems using 64-bit format for bus addresses */
  9212. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  9213. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  9214. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  9215. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  9216. /* for systems using 32-bit format for bus addresses */
  9217. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  9218. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  9219. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  9220. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  9221. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  9222. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  9223. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  9224. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  9225. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  9226. do { \
  9227. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  9228. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  9229. } while (0)
  9230. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  9231. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  9232. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  9233. do { \
  9234. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  9235. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  9236. } while (0)
  9237. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  9238. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  9239. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  9240. do { \
  9241. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  9242. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  9243. } while (0)
  9244. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  9245. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  9246. /*
  9247. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  9248. * deliver the rx frames to the monitor mode interface.
  9249. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  9250. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  9251. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  9252. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  9253. */
  9254. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  9255. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  9256. do { \
  9257. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  9258. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  9259. } while (0)
  9260. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  9261. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  9262. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  9263. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  9264. do { \
  9265. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  9266. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  9267. } while (0)
  9268. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  9269. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  9270. /* for systems using 64-bit format for bus addresses */
  9271. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  9272. do { \
  9273. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  9274. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  9275. } while (0)
  9276. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  9277. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  9278. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  9279. do { \
  9280. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  9281. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  9282. } while (0)
  9283. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  9284. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  9285. /* for systems using 32-bit format for bus addresses */
  9286. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  9287. do { \
  9288. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  9289. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  9290. } while (0)
  9291. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  9292. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  9293. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  9294. do { \
  9295. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  9296. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  9297. } while (0)
  9298. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  9299. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  9300. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  9301. do { \
  9302. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  9303. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  9304. } while (0)
  9305. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  9306. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  9307. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  9308. do { \
  9309. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  9310. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  9311. } while (0)
  9312. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  9313. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  9314. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  9315. do { \
  9316. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  9317. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  9318. } while (0)
  9319. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  9320. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  9321. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  9322. do { \
  9323. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  9324. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  9325. } while (0)
  9326. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9327. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9328. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9329. do { \
  9330. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9331. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9332. } while (0)
  9333. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9334. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9335. /* definitions used within target -> host rx indication message */
  9336. PREPACK struct htt_rx_ind_hdr_prefix_t
  9337. {
  9338. A_UINT32 /* word 0 */
  9339. msg_type: 8,
  9340. ext_tid: 5,
  9341. release_valid: 1,
  9342. flush_valid: 1,
  9343. reserved0: 1,
  9344. peer_id: 16;
  9345. A_UINT32 /* word 1 */
  9346. flush_start_seq_num: 6,
  9347. flush_end_seq_num: 6,
  9348. release_start_seq_num: 6,
  9349. release_end_seq_num: 6,
  9350. num_mpdu_ranges: 8;
  9351. } POSTPACK;
  9352. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9353. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9354. #define HTT_TGT_RSSI_INVALID 0x80
  9355. PREPACK struct htt_rx_ppdu_desc_t
  9356. {
  9357. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9358. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9359. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9360. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9361. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9362. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9363. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9364. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9365. A_UINT32 /* word 0 */
  9366. rssi_cmb: 8,
  9367. timestamp_submicrosec: 8,
  9368. phy_err_code: 8,
  9369. phy_err: 1,
  9370. legacy_rate: 4,
  9371. legacy_rate_sel: 1,
  9372. end_valid: 1,
  9373. start_valid: 1;
  9374. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9375. union {
  9376. A_UINT32 /* word 1 */
  9377. rssi0_pri20: 8,
  9378. rssi0_ext20: 8,
  9379. rssi0_ext40: 8,
  9380. rssi0_ext80: 8;
  9381. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9382. } u0;
  9383. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9384. union {
  9385. A_UINT32 /* word 2 */
  9386. rssi1_pri20: 8,
  9387. rssi1_ext20: 8,
  9388. rssi1_ext40: 8,
  9389. rssi1_ext80: 8;
  9390. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9391. } u1;
  9392. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9393. union {
  9394. A_UINT32 /* word 3 */
  9395. rssi2_pri20: 8,
  9396. rssi2_ext20: 8,
  9397. rssi2_ext40: 8,
  9398. rssi2_ext80: 8;
  9399. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9400. } u2;
  9401. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9402. union {
  9403. A_UINT32 /* word 4 */
  9404. rssi3_pri20: 8,
  9405. rssi3_ext20: 8,
  9406. rssi3_ext40: 8,
  9407. rssi3_ext80: 8;
  9408. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9409. } u3;
  9410. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9411. A_UINT32 tsf32; /* word 5 */
  9412. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9413. A_UINT32 timestamp_microsec; /* word 6 */
  9414. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9415. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9416. A_UINT32 /* word 7 */
  9417. vht_sig_a1: 24,
  9418. preamble_type: 8;
  9419. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9420. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9421. A_UINT32 /* word 8 */
  9422. vht_sig_a2: 24,
  9423. /* sa_ant_matrix
  9424. * For cases where a single rx chain has options to be connected to
  9425. * different rx antennas, show which rx antennas were in use during
  9426. * receipt of a given PPDU.
  9427. * This sa_ant_matrix provides a bitmask of the antennas used while
  9428. * receiving this frame.
  9429. */
  9430. sa_ant_matrix: 8;
  9431. } POSTPACK;
  9432. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9433. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9434. PREPACK struct htt_rx_ind_hdr_suffix_t
  9435. {
  9436. A_UINT32 /* word 0 */
  9437. fw_rx_desc_bytes: 16,
  9438. reserved0: 16;
  9439. } POSTPACK;
  9440. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9441. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9442. PREPACK struct htt_rx_ind_hdr_t
  9443. {
  9444. struct htt_rx_ind_hdr_prefix_t prefix;
  9445. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9446. struct htt_rx_ind_hdr_suffix_t suffix;
  9447. } POSTPACK;
  9448. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9449. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9450. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9451. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9452. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9453. /*
  9454. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9455. * the offset into the HTT rx indication message at which the
  9456. * FW rx PPDU descriptor resides
  9457. */
  9458. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9459. /*
  9460. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9461. * the offset into the HTT rx indication message at which the
  9462. * header suffix (FW rx MSDU byte count) resides
  9463. */
  9464. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9465. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9466. /*
  9467. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9468. * the offset into the HTT rx indication message at which the per-MSDU
  9469. * information starts
  9470. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9471. * per-MSDU information portion of the message. The per-MSDU info itself
  9472. * starts at byte 12.
  9473. */
  9474. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9475. /**
  9476. * @brief target -> host rx indication message definition
  9477. *
  9478. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9479. *
  9480. * @details
  9481. * The following field definitions describe the format of the rx indication
  9482. * message sent from the target to the host.
  9483. * The message consists of three major sections:
  9484. * 1. a fixed-length header
  9485. * 2. a variable-length list of firmware rx MSDU descriptors
  9486. * 3. one or more 4-octet MPDU range information elements
  9487. * The fixed length header itself has two sub-sections
  9488. * 1. the message meta-information, including identification of the
  9489. * sender and type of the received data, and a 4-octet flush/release IE
  9490. * 2. the firmware rx PPDU descriptor
  9491. *
  9492. * The format of the message is depicted below.
  9493. * in this depiction, the following abbreviations are used for information
  9494. * elements within the message:
  9495. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9496. * elements associated with the PPDU start are valid.
  9497. * Specifically, the following fields are valid only if SV is set:
  9498. * RSSI (all variants), L, legacy rate, preamble type, service,
  9499. * VHT-SIG-A
  9500. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9501. * elements associated with the PPDU end are valid.
  9502. * Specifically, the following fields are valid only if EV is set:
  9503. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9504. * - L - Legacy rate selector - if legacy rates are used, this flag
  9505. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9506. * (L == 0) PHY.
  9507. * - P - PHY error flag - boolean indication of whether the rx frame had
  9508. * a PHY error
  9509. *
  9510. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9511. * |----------------+-------------------+---------------------+---------------|
  9512. * | peer ID | |RV|FV| ext TID | msg type |
  9513. * |--------------------------------------------------------------------------|
  9514. * | num | release | release | flush | flush |
  9515. * | MPDU | end | start | end | start |
  9516. * | ranges | seq num | seq num | seq num | seq num |
  9517. * |==========================================================================|
  9518. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9519. * |V|V| | rate | | | timestamp | RSSI |
  9520. * |--------------------------------------------------------------------------|
  9521. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9522. * |--------------------------------------------------------------------------|
  9523. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9524. * |--------------------------------------------------------------------------|
  9525. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9526. * |--------------------------------------------------------------------------|
  9527. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9528. * |--------------------------------------------------------------------------|
  9529. * | TSF LSBs |
  9530. * |--------------------------------------------------------------------------|
  9531. * | microsec timestamp |
  9532. * |--------------------------------------------------------------------------|
  9533. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9534. * |--------------------------------------------------------------------------|
  9535. * | service | HT-SIG / VHT-SIG-A2 |
  9536. * |==========================================================================|
  9537. * | reserved | FW rx desc bytes |
  9538. * |--------------------------------------------------------------------------|
  9539. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9540. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9541. * |--------------------------------------------------------------------------|
  9542. * : : :
  9543. * |--------------------------------------------------------------------------|
  9544. * | alignment | MSDU Rx |
  9545. * | padding | desc Bn |
  9546. * |--------------------------------------------------------------------------|
  9547. * | reserved | MPDU range status | MPDU count |
  9548. * |--------------------------------------------------------------------------|
  9549. * : reserved : MPDU range status : MPDU count :
  9550. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9551. *
  9552. * Header fields:
  9553. * - MSG_TYPE
  9554. * Bits 7:0
  9555. * Purpose: identifies this as an rx indication message
  9556. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9557. * - EXT_TID
  9558. * Bits 12:8
  9559. * Purpose: identify the traffic ID of the rx data, including
  9560. * special "extended" TID values for multicast, broadcast, and
  9561. * non-QoS data frames
  9562. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9563. * - FLUSH_VALID (FV)
  9564. * Bit 13
  9565. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9566. * is valid
  9567. * Value:
  9568. * 1 -> flush IE is valid and needs to be processed
  9569. * 0 -> flush IE is not valid and should be ignored
  9570. * - REL_VALID (RV)
  9571. * Bit 13
  9572. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9573. * is valid
  9574. * Value:
  9575. * 1 -> release IE is valid and needs to be processed
  9576. * 0 -> release IE is not valid and should be ignored
  9577. * - PEER_ID
  9578. * Bits 31:16
  9579. * Purpose: Identify, by ID, which peer sent the rx data
  9580. * Value: ID of the peer who sent the rx data
  9581. * - FLUSH_SEQ_NUM_START
  9582. * Bits 5:0
  9583. * Purpose: Indicate the start of a series of MPDUs to flush
  9584. * Not all MPDUs within this series are necessarily valid - the host
  9585. * must check each sequence number within this range to see if the
  9586. * corresponding MPDU is actually present.
  9587. * This field is only valid if the FV bit is set.
  9588. * Value:
  9589. * The sequence number for the first MPDUs to check to flush.
  9590. * The sequence number is masked by 0x3f.
  9591. * - FLUSH_SEQ_NUM_END
  9592. * Bits 11:6
  9593. * Purpose: Indicate the end of a series of MPDUs to flush
  9594. * Value:
  9595. * The sequence number one larger than the sequence number of the
  9596. * last MPDU to check to flush.
  9597. * The sequence number is masked by 0x3f.
  9598. * Not all MPDUs within this series are necessarily valid - the host
  9599. * must check each sequence number within this range to see if the
  9600. * corresponding MPDU is actually present.
  9601. * This field is only valid if the FV bit is set.
  9602. * - REL_SEQ_NUM_START
  9603. * Bits 17:12
  9604. * Purpose: Indicate the start of a series of MPDUs to release.
  9605. * All MPDUs within this series are present and valid - the host
  9606. * need not check each sequence number within this range to see if
  9607. * the corresponding MPDU is actually present.
  9608. * This field is only valid if the RV bit is set.
  9609. * Value:
  9610. * The sequence number for the first MPDUs to check to release.
  9611. * The sequence number is masked by 0x3f.
  9612. * - REL_SEQ_NUM_END
  9613. * Bits 23:18
  9614. * Purpose: Indicate the end of a series of MPDUs to release.
  9615. * Value:
  9616. * The sequence number one larger than the sequence number of the
  9617. * last MPDU to check to release.
  9618. * The sequence number is masked by 0x3f.
  9619. * All MPDUs within this series are present and valid - the host
  9620. * need not check each sequence number within this range to see if
  9621. * the corresponding MPDU is actually present.
  9622. * This field is only valid if the RV bit is set.
  9623. * - NUM_MPDU_RANGES
  9624. * Bits 31:24
  9625. * Purpose: Indicate how many ranges of MPDUs are present.
  9626. * Each MPDU range consists of a series of contiguous MPDUs within the
  9627. * rx frame sequence which all have the same MPDU status.
  9628. * Value: 1-63 (typically a small number, like 1-3)
  9629. *
  9630. * Rx PPDU descriptor fields:
  9631. * - RSSI_CMB
  9632. * Bits 7:0
  9633. * Purpose: Combined RSSI from all active rx chains, across the active
  9634. * bandwidth.
  9635. * Value: RSSI dB units w.r.t. noise floor
  9636. * - TIMESTAMP_SUBMICROSEC
  9637. * Bits 15:8
  9638. * Purpose: high-resolution timestamp
  9639. * Value:
  9640. * Sub-microsecond time of PPDU reception.
  9641. * This timestamp ranges from [0,MAC clock MHz).
  9642. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9643. * to form a high-resolution, large range rx timestamp.
  9644. * - PHY_ERR_CODE
  9645. * Bits 23:16
  9646. * Purpose:
  9647. * If the rx frame processing resulted in a PHY error, indicate what
  9648. * type of rx PHY error occurred.
  9649. * Value:
  9650. * This field is valid if the "P" (PHY_ERR) flag is set.
  9651. * TBD: document/specify the values for this field
  9652. * - PHY_ERR
  9653. * Bit 24
  9654. * Purpose: indicate whether the rx PPDU had a PHY error
  9655. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9656. * - LEGACY_RATE
  9657. * Bits 28:25
  9658. * Purpose:
  9659. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9660. * specify which rate was used.
  9661. * Value:
  9662. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9663. * flag.
  9664. * If LEGACY_RATE_SEL is 0:
  9665. * 0x8: OFDM 48 Mbps
  9666. * 0x9: OFDM 24 Mbps
  9667. * 0xA: OFDM 12 Mbps
  9668. * 0xB: OFDM 6 Mbps
  9669. * 0xC: OFDM 54 Mbps
  9670. * 0xD: OFDM 36 Mbps
  9671. * 0xE: OFDM 18 Mbps
  9672. * 0xF: OFDM 9 Mbps
  9673. * If LEGACY_RATE_SEL is 1:
  9674. * 0x8: CCK 11 Mbps long preamble
  9675. * 0x9: CCK 5.5 Mbps long preamble
  9676. * 0xA: CCK 2 Mbps long preamble
  9677. * 0xB: CCK 1 Mbps long preamble
  9678. * 0xC: CCK 11 Mbps short preamble
  9679. * 0xD: CCK 5.5 Mbps short preamble
  9680. * 0xE: CCK 2 Mbps short preamble
  9681. * - LEGACY_RATE_SEL
  9682. * Bit 29
  9683. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9684. * Value:
  9685. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9686. * used a legacy rate.
  9687. * 0 -> OFDM, 1 -> CCK
  9688. * - END_VALID
  9689. * Bit 30
  9690. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9691. * the start of the PPDU are valid. Specifically, the following
  9692. * fields are only valid if END_VALID is set:
  9693. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9694. * TIMESTAMP_SUBMICROSEC
  9695. * Value:
  9696. * 0 -> rx PPDU desc end fields are not valid
  9697. * 1 -> rx PPDU desc end fields are valid
  9698. * - START_VALID
  9699. * Bit 31
  9700. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9701. * the end of the PPDU are valid. Specifically, the following
  9702. * fields are only valid if START_VALID is set:
  9703. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9704. * VHT-SIG-A
  9705. * Value:
  9706. * 0 -> rx PPDU desc start fields are not valid
  9707. * 1 -> rx PPDU desc start fields are valid
  9708. * - RSSI0_PRI20
  9709. * Bits 7:0
  9710. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9711. * Value: RSSI dB units w.r.t. noise floor
  9712. *
  9713. * - RSSI0_EXT20
  9714. * Bits 7:0
  9715. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9716. * (if the rx bandwidth was >= 40 MHz)
  9717. * Value: RSSI dB units w.r.t. noise floor
  9718. * - RSSI0_EXT40
  9719. * Bits 7:0
  9720. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9721. * (if the rx bandwidth was >= 80 MHz)
  9722. * Value: RSSI dB units w.r.t. noise floor
  9723. * - RSSI0_EXT80
  9724. * Bits 7:0
  9725. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9726. * (if the rx bandwidth was >= 160 MHz)
  9727. * Value: RSSI dB units w.r.t. noise floor
  9728. *
  9729. * - RSSI1_PRI20
  9730. * Bits 7:0
  9731. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9732. * Value: RSSI dB units w.r.t. noise floor
  9733. * - RSSI1_EXT20
  9734. * Bits 7:0
  9735. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9736. * (if the rx bandwidth was >= 40 MHz)
  9737. * Value: RSSI dB units w.r.t. noise floor
  9738. * - RSSI1_EXT40
  9739. * Bits 7:0
  9740. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9741. * (if the rx bandwidth was >= 80 MHz)
  9742. * Value: RSSI dB units w.r.t. noise floor
  9743. * - RSSI1_EXT80
  9744. * Bits 7:0
  9745. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9746. * (if the rx bandwidth was >= 160 MHz)
  9747. * Value: RSSI dB units w.r.t. noise floor
  9748. *
  9749. * - RSSI2_PRI20
  9750. * Bits 7:0
  9751. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9752. * Value: RSSI dB units w.r.t. noise floor
  9753. * - RSSI2_EXT20
  9754. * Bits 7:0
  9755. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9756. * (if the rx bandwidth was >= 40 MHz)
  9757. * Value: RSSI dB units w.r.t. noise floor
  9758. * - RSSI2_EXT40
  9759. * Bits 7:0
  9760. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9761. * (if the rx bandwidth was >= 80 MHz)
  9762. * Value: RSSI dB units w.r.t. noise floor
  9763. * - RSSI2_EXT80
  9764. * Bits 7:0
  9765. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9766. * (if the rx bandwidth was >= 160 MHz)
  9767. * Value: RSSI dB units w.r.t. noise floor
  9768. *
  9769. * - RSSI3_PRI20
  9770. * Bits 7:0
  9771. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9772. * Value: RSSI dB units w.r.t. noise floor
  9773. * - RSSI3_EXT20
  9774. * Bits 7:0
  9775. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9776. * (if the rx bandwidth was >= 40 MHz)
  9777. * Value: RSSI dB units w.r.t. noise floor
  9778. * - RSSI3_EXT40
  9779. * Bits 7:0
  9780. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9781. * (if the rx bandwidth was >= 80 MHz)
  9782. * Value: RSSI dB units w.r.t. noise floor
  9783. * - RSSI3_EXT80
  9784. * Bits 7:0
  9785. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9786. * (if the rx bandwidth was >= 160 MHz)
  9787. * Value: RSSI dB units w.r.t. noise floor
  9788. *
  9789. * - TSF32
  9790. * Bits 31:0
  9791. * Purpose: specify the time the rx PPDU was received, in TSF units
  9792. * Value: 32 LSBs of the TSF
  9793. * - TIMESTAMP_MICROSEC
  9794. * Bits 31:0
  9795. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9796. * Value: PPDU rx time, in microseconds
  9797. * - VHT_SIG_A1
  9798. * Bits 23:0
  9799. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9800. * from the rx PPDU
  9801. * Value:
  9802. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9803. * VHT-SIG-A1 data.
  9804. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9805. * first 24 bits of the HT-SIG data.
  9806. * Otherwise, this field is invalid.
  9807. * Refer to the the 802.11 protocol for the definition of the
  9808. * HT-SIG and VHT-SIG-A1 fields
  9809. * - VHT_SIG_A2
  9810. * Bits 23:0
  9811. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9812. * from the rx PPDU
  9813. * Value:
  9814. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9815. * VHT-SIG-A2 data.
  9816. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9817. * last 24 bits of the HT-SIG data.
  9818. * Otherwise, this field is invalid.
  9819. * Refer to the the 802.11 protocol for the definition of the
  9820. * HT-SIG and VHT-SIG-A2 fields
  9821. * - PREAMBLE_TYPE
  9822. * Bits 31:24
  9823. * Purpose: indicate the PHY format of the received burst
  9824. * Value:
  9825. * 0x4: Legacy (OFDM/CCK)
  9826. * 0x8: HT
  9827. * 0x9: HT with TxBF
  9828. * 0xC: VHT
  9829. * 0xD: VHT with TxBF
  9830. * - SERVICE
  9831. * Bits 31:24
  9832. * Purpose: TBD
  9833. * Value: TBD
  9834. *
  9835. * Rx MSDU descriptor fields:
  9836. * - FW_RX_DESC_BYTES
  9837. * Bits 15:0
  9838. * Purpose: Indicate how many bytes in the Rx indication are used for
  9839. * FW Rx descriptors
  9840. *
  9841. * Payload fields:
  9842. * - MPDU_COUNT
  9843. * Bits 7:0
  9844. * Purpose: Indicate how many sequential MPDUs share the same status.
  9845. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9846. * - MPDU_STATUS
  9847. * Bits 15:8
  9848. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9849. * received successfully.
  9850. * Value:
  9851. * 0x1: success
  9852. * 0x2: FCS error
  9853. * 0x3: duplicate error
  9854. * 0x4: replay error
  9855. * 0x5: invalid peer
  9856. */
  9857. /* header fields */
  9858. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9859. #define HTT_RX_IND_EXT_TID_S 8
  9860. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9861. #define HTT_RX_IND_FLUSH_VALID_S 13
  9862. #define HTT_RX_IND_REL_VALID_M 0x4000
  9863. #define HTT_RX_IND_REL_VALID_S 14
  9864. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9865. #define HTT_RX_IND_PEER_ID_S 16
  9866. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9867. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9868. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9869. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9870. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9871. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9872. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9873. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9874. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9875. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9876. /* rx PPDU descriptor fields */
  9877. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9878. #define HTT_RX_IND_RSSI_CMB_S 0
  9879. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9880. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9881. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9882. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9883. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9884. #define HTT_RX_IND_PHY_ERR_S 24
  9885. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9886. #define HTT_RX_IND_LEGACY_RATE_S 25
  9887. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9888. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9889. #define HTT_RX_IND_END_VALID_M 0x40000000
  9890. #define HTT_RX_IND_END_VALID_S 30
  9891. #define HTT_RX_IND_START_VALID_M 0x80000000
  9892. #define HTT_RX_IND_START_VALID_S 31
  9893. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9894. #define HTT_RX_IND_RSSI_PRI20_S 0
  9895. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9896. #define HTT_RX_IND_RSSI_EXT20_S 8
  9897. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9898. #define HTT_RX_IND_RSSI_EXT40_S 16
  9899. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9900. #define HTT_RX_IND_RSSI_EXT80_S 24
  9901. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9902. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9903. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9904. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9905. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9906. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9907. #define HTT_RX_IND_SERVICE_M 0xff000000
  9908. #define HTT_RX_IND_SERVICE_S 24
  9909. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9910. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9911. /* rx MSDU descriptor fields */
  9912. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9913. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9914. /* payload fields */
  9915. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9916. #define HTT_RX_IND_MPDU_COUNT_S 0
  9917. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9918. #define HTT_RX_IND_MPDU_STATUS_S 8
  9919. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9920. do { \
  9921. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9922. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9923. } while (0)
  9924. #define HTT_RX_IND_EXT_TID_GET(word) \
  9925. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9926. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9927. do { \
  9928. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9929. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9930. } while (0)
  9931. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9932. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9933. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9934. do { \
  9935. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9936. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9937. } while (0)
  9938. #define HTT_RX_IND_REL_VALID_GET(word) \
  9939. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9940. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9941. do { \
  9942. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9943. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9944. } while (0)
  9945. #define HTT_RX_IND_PEER_ID_GET(word) \
  9946. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9947. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9948. do { \
  9949. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9950. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9951. } while (0)
  9952. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9953. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9954. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9955. do { \
  9956. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9957. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9958. } while (0)
  9959. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9960. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9961. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9962. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9963. do { \
  9964. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9965. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9966. } while (0)
  9967. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9968. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9969. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9970. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9971. do { \
  9972. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9973. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9974. } while (0)
  9975. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9976. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9977. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9978. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9979. do { \
  9980. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9981. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9982. } while (0)
  9983. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9984. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9985. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9986. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9987. do { \
  9988. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9989. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9990. } while (0)
  9991. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9992. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9993. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9994. /* FW rx PPDU descriptor fields */
  9995. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9996. do { \
  9997. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9998. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9999. } while (0)
  10000. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  10001. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  10002. HTT_RX_IND_RSSI_CMB_S)
  10003. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  10004. do { \
  10005. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  10006. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  10007. } while (0)
  10008. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  10009. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  10010. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  10011. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  10012. do { \
  10013. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  10014. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  10015. } while (0)
  10016. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  10017. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  10018. HTT_RX_IND_PHY_ERR_CODE_S)
  10019. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  10020. do { \
  10021. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  10022. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  10023. } while (0)
  10024. #define HTT_RX_IND_PHY_ERR_GET(word) \
  10025. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  10026. HTT_RX_IND_PHY_ERR_S)
  10027. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  10028. do { \
  10029. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  10030. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  10031. } while (0)
  10032. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  10033. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  10034. HTT_RX_IND_LEGACY_RATE_S)
  10035. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  10036. do { \
  10037. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  10038. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  10039. } while (0)
  10040. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  10041. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  10042. HTT_RX_IND_LEGACY_RATE_SEL_S)
  10043. #define HTT_RX_IND_END_VALID_SET(word, value) \
  10044. do { \
  10045. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  10046. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  10047. } while (0)
  10048. #define HTT_RX_IND_END_VALID_GET(word) \
  10049. (((word) & HTT_RX_IND_END_VALID_M) >> \
  10050. HTT_RX_IND_END_VALID_S)
  10051. #define HTT_RX_IND_START_VALID_SET(word, value) \
  10052. do { \
  10053. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  10054. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  10055. } while (0)
  10056. #define HTT_RX_IND_START_VALID_GET(word) \
  10057. (((word) & HTT_RX_IND_START_VALID_M) >> \
  10058. HTT_RX_IND_START_VALID_S)
  10059. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  10060. do { \
  10061. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  10062. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  10063. } while (0)
  10064. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  10065. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  10066. HTT_RX_IND_RSSI_PRI20_S)
  10067. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  10068. do { \
  10069. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  10070. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  10071. } while (0)
  10072. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  10073. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  10074. HTT_RX_IND_RSSI_EXT20_S)
  10075. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  10076. do { \
  10077. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  10078. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  10079. } while (0)
  10080. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  10081. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  10082. HTT_RX_IND_RSSI_EXT40_S)
  10083. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  10084. do { \
  10085. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  10086. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  10087. } while (0)
  10088. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  10089. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  10090. HTT_RX_IND_RSSI_EXT80_S)
  10091. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  10092. do { \
  10093. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  10094. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  10095. } while (0)
  10096. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  10097. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  10098. HTT_RX_IND_VHT_SIG_A1_S)
  10099. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  10100. do { \
  10101. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  10102. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  10103. } while (0)
  10104. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  10105. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  10106. HTT_RX_IND_VHT_SIG_A2_S)
  10107. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  10108. do { \
  10109. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  10110. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  10111. } while (0)
  10112. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  10113. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  10114. HTT_RX_IND_PREAMBLE_TYPE_S)
  10115. #define HTT_RX_IND_SERVICE_SET(word, value) \
  10116. do { \
  10117. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  10118. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  10119. } while (0)
  10120. #define HTT_RX_IND_SERVICE_GET(word) \
  10121. (((word) & HTT_RX_IND_SERVICE_M) >> \
  10122. HTT_RX_IND_SERVICE_S)
  10123. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  10124. do { \
  10125. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  10126. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  10127. } while (0)
  10128. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  10129. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  10130. HTT_RX_IND_SA_ANT_MATRIX_S)
  10131. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  10132. do { \
  10133. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  10134. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  10135. } while (0)
  10136. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  10137. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  10138. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  10139. do { \
  10140. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  10141. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  10142. } while (0)
  10143. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  10144. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  10145. #define HTT_RX_IND_HL_BYTES \
  10146. (HTT_RX_IND_HDR_BYTES + \
  10147. 4 /* single FW rx MSDU descriptor */ + \
  10148. 4 /* single MPDU range information element */)
  10149. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  10150. /* Could we use one macro entry? */
  10151. #define HTT_WORD_SET(word, field, value) \
  10152. do { \
  10153. HTT_CHECK_SET_VAL(field, value); \
  10154. (word) |= ((value) << field ## _S); \
  10155. } while (0)
  10156. #define HTT_WORD_GET(word, field) \
  10157. (((word) & field ## _M) >> field ## _S)
  10158. PREPACK struct hl_htt_rx_ind_base {
  10159. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  10160. } POSTPACK;
  10161. /*
  10162. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  10163. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  10164. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  10165. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  10166. * htt_rx_ind_hl_rx_desc_t.
  10167. */
  10168. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  10169. struct htt_rx_ind_hl_rx_desc_t {
  10170. A_UINT8 ver;
  10171. A_UINT8 len;
  10172. struct {
  10173. A_UINT8
  10174. first_msdu: 1,
  10175. last_msdu: 1,
  10176. c3_failed: 1,
  10177. c4_failed: 1,
  10178. ipv6: 1,
  10179. tcp: 1,
  10180. udp: 1,
  10181. reserved: 1;
  10182. } flags;
  10183. /* NOTE: no reserved space - don't append any new fields here */
  10184. };
  10185. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  10186. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10187. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  10188. #define HTT_RX_IND_HL_RX_DESC_VER 0
  10189. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  10190. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10191. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  10192. #define HTT_RX_IND_HL_FLAG_OFFSET \
  10193. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  10194. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  10195. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  10196. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  10197. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  10198. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  10199. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  10200. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  10201. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  10202. /* This structure is used in HL, the basic descriptor information
  10203. * used by host. the structure is translated by FW from HW desc
  10204. * or generated by FW. But in HL monitor mode, the host would use
  10205. * the same structure with LL.
  10206. */
  10207. PREPACK struct hl_htt_rx_desc_base {
  10208. A_UINT32
  10209. seq_num:12,
  10210. encrypted:1,
  10211. chan_info_present:1,
  10212. resv0:2,
  10213. mcast_bcast:1,
  10214. fragment:1,
  10215. key_id_oct:8,
  10216. resv1:6;
  10217. A_UINT32
  10218. pn_31_0;
  10219. union {
  10220. struct {
  10221. A_UINT16 pn_47_32;
  10222. A_UINT16 pn_63_48;
  10223. } pn16;
  10224. A_UINT32 pn_63_32;
  10225. } u0;
  10226. A_UINT32
  10227. pn_95_64;
  10228. A_UINT32
  10229. pn_127_96;
  10230. } POSTPACK;
  10231. /*
  10232. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  10233. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  10234. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  10235. * Please see htt_chan_change_t for description of the fields.
  10236. */
  10237. PREPACK struct htt_chan_info_t
  10238. {
  10239. A_UINT32 primary_chan_center_freq_mhz: 16,
  10240. contig_chan1_center_freq_mhz: 16;
  10241. A_UINT32 contig_chan2_center_freq_mhz: 16,
  10242. phy_mode: 8,
  10243. reserved: 8;
  10244. } POSTPACK;
  10245. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  10246. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  10247. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  10248. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  10249. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  10250. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  10251. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  10252. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  10253. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  10254. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  10255. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  10256. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  10257. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  10258. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  10259. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  10260. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  10261. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  10262. /* Channel information */
  10263. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  10264. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  10265. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  10266. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  10267. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  10268. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  10269. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  10270. #define HTT_CHAN_INFO_PHY_MODE_S 16
  10271. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  10272. do { \
  10273. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  10274. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  10275. } while (0)
  10276. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  10277. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  10278. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  10279. do { \
  10280. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  10281. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  10282. } while (0)
  10283. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  10284. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  10285. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  10286. do { \
  10287. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  10288. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  10289. } while (0)
  10290. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  10291. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  10292. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  10293. do { \
  10294. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  10295. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  10296. } while (0)
  10297. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  10298. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  10299. /*
  10300. * @brief target -> host message definition for FW offloaded pkts
  10301. *
  10302. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  10303. *
  10304. * @details
  10305. * The following field definitions describe the format of the firmware
  10306. * offload deliver message sent from the target to the host.
  10307. *
  10308. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  10309. *
  10310. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  10311. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  10312. * | reserved_1 | msg type |
  10313. * |--------------------------------------------------------------------------|
  10314. * | phy_timestamp_l32 |
  10315. * |--------------------------------------------------------------------------|
  10316. * | WORD2 (see below) |
  10317. * |--------------------------------------------------------------------------|
  10318. * | seqno | framectrl |
  10319. * |--------------------------------------------------------------------------|
  10320. * | reserved_3 | vdev_id | tid_num|
  10321. * |--------------------------------------------------------------------------|
  10322. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  10323. * |--------------------------------------------------------------------------|
  10324. *
  10325. * where:
  10326. * STAT = status
  10327. * F = format (802.3 vs. 802.11)
  10328. *
  10329. * definition for word 2
  10330. *
  10331. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10332. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10333. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10334. * |--------------------------------------------------------------------------|
  10335. *
  10336. * where:
  10337. * PR = preamble
  10338. * BF = beamformed
  10339. */
  10340. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10341. {
  10342. A_UINT32 /* word 0 */
  10343. msg_type:8, /* [ 7: 0] */
  10344. reserved_1:24; /* [31: 8] */
  10345. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10346. A_UINT32 /* word 2 */
  10347. /* preamble:
  10348. * 0-OFDM,
  10349. * 1-CCk,
  10350. * 2-HT,
  10351. * 3-VHT
  10352. */
  10353. preamble: 2, /* [1:0] */
  10354. /* mcs:
  10355. * In case of HT preamble interpret
  10356. * MCS along with NSS.
  10357. * Valid values for HT are 0 to 7.
  10358. * HT mcs 0 with NSS 2 is mcs 8.
  10359. * Valid values for VHT are 0 to 9.
  10360. */
  10361. mcs: 4, /* [5:2] */
  10362. /* rate:
  10363. * This is applicable only for
  10364. * CCK and OFDM preamble type
  10365. * rate 0: OFDM 48 Mbps,
  10366. * 1: OFDM 24 Mbps,
  10367. * 2: OFDM 12 Mbps
  10368. * 3: OFDM 6 Mbps
  10369. * 4: OFDM 54 Mbps
  10370. * 5: OFDM 36 Mbps
  10371. * 6: OFDM 18 Mbps
  10372. * 7: OFDM 9 Mbps
  10373. * rate 0: CCK 11 Mbps Long
  10374. * 1: CCK 5.5 Mbps Long
  10375. * 2: CCK 2 Mbps Long
  10376. * 3: CCK 1 Mbps Long
  10377. * 4: CCK 11 Mbps Short
  10378. * 5: CCK 5.5 Mbps Short
  10379. * 6: CCK 2 Mbps Short
  10380. */
  10381. rate : 3, /* [ 8: 6] */
  10382. rssi : 8, /* [16: 9] units=dBm */
  10383. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10384. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10385. stbc : 1, /* [22] */
  10386. sgi : 1, /* [23] */
  10387. ldpc : 1, /* [24] */
  10388. beamformed: 1, /* [25] */
  10389. reserved_2: 6; /* [31:26] */
  10390. A_UINT32 /* word 3 */
  10391. framectrl:16, /* [15: 0] */
  10392. seqno:16; /* [31:16] */
  10393. A_UINT32 /* word 4 */
  10394. tid_num:5, /* [ 4: 0] actual TID number */
  10395. vdev_id:8, /* [12: 5] */
  10396. reserved_3:19; /* [31:13] */
  10397. A_UINT32 /* word 5 */
  10398. /* status:
  10399. * 0: tx_ok
  10400. * 1: retry
  10401. * 2: drop
  10402. * 3: filtered
  10403. * 4: abort
  10404. * 5: tid delete
  10405. * 6: sw abort
  10406. * 7: dropped by peer migration
  10407. */
  10408. status:3, /* [2:0] */
  10409. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10410. tx_mpdu_bytes:16, /* [19:4] */
  10411. /* Indicates retry count of offloaded/local generated Data tx frames */
  10412. tx_retry_cnt:6, /* [25:20] */
  10413. reserved_4:6; /* [31:26] */
  10414. } POSTPACK;
  10415. /* FW offload deliver ind message header fields */
  10416. /* DWORD one */
  10417. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10418. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10419. /* DWORD two */
  10420. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10421. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10422. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10423. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10424. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10425. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10426. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10427. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10428. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10429. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10430. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10431. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10432. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10433. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10434. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10435. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10436. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10437. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10438. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10439. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10440. /* DWORD three*/
  10441. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10442. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10443. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10444. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10445. /* DWORD four */
  10446. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10447. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10448. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10449. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10450. /* DWORD five */
  10451. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10452. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10453. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10454. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10455. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10456. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10457. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10458. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10459. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10460. do { \
  10461. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10462. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10463. } while (0)
  10464. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10465. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10466. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10467. do { \
  10468. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10469. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10470. } while (0)
  10471. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10472. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10473. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10474. do { \
  10475. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10476. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10477. } while (0)
  10478. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10479. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10480. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10481. do { \
  10482. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10483. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10484. } while (0)
  10485. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10486. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10487. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10488. do { \
  10489. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10490. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10491. } while (0)
  10492. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10493. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10494. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10495. do { \
  10496. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10497. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10498. } while (0)
  10499. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10500. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10501. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10502. do { \
  10503. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10504. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10505. } while (0)
  10506. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10507. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10508. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10509. do { \
  10510. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10511. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10512. } while (0)
  10513. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10514. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10515. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10516. do { \
  10517. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10518. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10519. } while (0)
  10520. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10521. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10522. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10523. do { \
  10524. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10525. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10526. } while (0)
  10527. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10528. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10529. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10530. do { \
  10531. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10532. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10533. } while (0)
  10534. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10535. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10536. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10537. do { \
  10538. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10539. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10540. } while (0)
  10541. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10542. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10543. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10544. do { \
  10545. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10546. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10547. } while (0)
  10548. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10549. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10550. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10551. do { \
  10552. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10553. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10554. } while (0)
  10555. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10556. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10557. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10558. do { \
  10559. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10560. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10561. } while (0)
  10562. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10563. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10564. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10565. do { \
  10566. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10567. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10568. } while (0)
  10569. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10570. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10571. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10572. do { \
  10573. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10574. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10575. } while (0)
  10576. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10577. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10578. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10579. do { \
  10580. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10581. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10582. } while (0)
  10583. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10584. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10585. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10586. do { \
  10587. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10588. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10589. } while (0)
  10590. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10591. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10592. /*
  10593. * @brief target -> host rx reorder flush message definition
  10594. *
  10595. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10596. *
  10597. * @details
  10598. * The following field definitions describe the format of the rx flush
  10599. * message sent from the target to the host.
  10600. * The message consists of a 4-octet header, followed by one or more
  10601. * 4-octet payload information elements.
  10602. *
  10603. * |31 24|23 8|7 0|
  10604. * |--------------------------------------------------------------|
  10605. * | TID | peer ID | msg type |
  10606. * |--------------------------------------------------------------|
  10607. * | seq num end | seq num start | MPDU status | reserved |
  10608. * |--------------------------------------------------------------|
  10609. * First DWORD:
  10610. * - MSG_TYPE
  10611. * Bits 7:0
  10612. * Purpose: identifies this as an rx flush message
  10613. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10614. * - PEER_ID
  10615. * Bits 23:8 (only bits 18:8 actually used)
  10616. * Purpose: identify which peer's rx data is being flushed
  10617. * Value: (rx) peer ID
  10618. * - TID
  10619. * Bits 31:24 (only bits 27:24 actually used)
  10620. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10621. * Value: traffic identifier
  10622. * Second DWORD:
  10623. * - MPDU_STATUS
  10624. * Bits 15:8
  10625. * Purpose:
  10626. * Indicate whether the flushed MPDUs should be discarded or processed.
  10627. * Value:
  10628. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10629. * stages of rx processing
  10630. * other: discard the MPDUs
  10631. * It is anticipated that flush messages will always have
  10632. * MPDU status == 1, but the status flag is included for
  10633. * flexibility.
  10634. * - SEQ_NUM_START
  10635. * Bits 23:16
  10636. * Purpose:
  10637. * Indicate the start of a series of consecutive MPDUs being flushed.
  10638. * Not all MPDUs within this range are necessarily valid - the host
  10639. * must check each sequence number within this range to see if the
  10640. * corresponding MPDU is actually present.
  10641. * Value:
  10642. * The sequence number for the first MPDU in the sequence.
  10643. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10644. * - SEQ_NUM_END
  10645. * Bits 30:24
  10646. * Purpose:
  10647. * Indicate the end of a series of consecutive MPDUs being flushed.
  10648. * Value:
  10649. * The sequence number one larger than the sequence number of the
  10650. * last MPDU being flushed.
  10651. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10652. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10653. * are to be released for further rx processing.
  10654. * Not all MPDUs within this range are necessarily valid - the host
  10655. * must check each sequence number within this range to see if the
  10656. * corresponding MPDU is actually present.
  10657. */
  10658. /* first DWORD */
  10659. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10660. #define HTT_RX_FLUSH_PEER_ID_S 8
  10661. #define HTT_RX_FLUSH_TID_M 0xff000000
  10662. #define HTT_RX_FLUSH_TID_S 24
  10663. /* second DWORD */
  10664. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10665. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10666. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10667. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10668. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10669. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10670. #define HTT_RX_FLUSH_BYTES 8
  10671. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10672. do { \
  10673. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10674. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10675. } while (0)
  10676. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10677. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10678. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10679. do { \
  10680. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10681. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10682. } while (0)
  10683. #define HTT_RX_FLUSH_TID_GET(word) \
  10684. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10685. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10686. do { \
  10687. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10688. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10689. } while (0)
  10690. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10691. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10692. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10693. do { \
  10694. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10695. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10696. } while (0)
  10697. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10698. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10699. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10700. do { \
  10701. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10702. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10703. } while (0)
  10704. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10705. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10706. /*
  10707. * @brief target -> host rx pn check indication message
  10708. *
  10709. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10710. *
  10711. * @details
  10712. * The following field definitions describe the format of the Rx PN check
  10713. * indication message sent from the target to the host.
  10714. * The message consists of a 4-octet header, followed by the start and
  10715. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10716. * IE is one octet containing the sequence number that failed the PN
  10717. * check.
  10718. *
  10719. * |31 24|23 8|7 0|
  10720. * |--------------------------------------------------------------|
  10721. * | TID | peer ID | msg type |
  10722. * |--------------------------------------------------------------|
  10723. * | Reserved | PN IE count | seq num end | seq num start|
  10724. * |--------------------------------------------------------------|
  10725. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10726. * |--------------------------------------------------------------|
  10727. * First DWORD:
  10728. * - MSG_TYPE
  10729. * Bits 7:0
  10730. * Purpose: Identifies this as an rx pn check indication message
  10731. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10732. * - PEER_ID
  10733. * Bits 23:8 (only bits 18:8 actually used)
  10734. * Purpose: identify which peer
  10735. * Value: (rx) peer ID
  10736. * - TID
  10737. * Bits 31:24 (only bits 27:24 actually used)
  10738. * Purpose: identify traffic identifier
  10739. * Value: traffic identifier
  10740. * Second DWORD:
  10741. * - SEQ_NUM_START
  10742. * Bits 7:0
  10743. * Purpose:
  10744. * Indicates the starting sequence number of the MPDU in this
  10745. * series of MPDUs that went though PN check.
  10746. * Value:
  10747. * The sequence number for the first MPDU in the sequence.
  10748. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10749. * - SEQ_NUM_END
  10750. * Bits 15:8
  10751. * Purpose:
  10752. * Indicates the ending sequence number of the MPDU in this
  10753. * series of MPDUs that went though PN check.
  10754. * Value:
  10755. * The sequence number one larger then the sequence number of the last
  10756. * MPDU being flushed.
  10757. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10758. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10759. * for invalid PN numbers and are ready to be released for further processing.
  10760. * Not all MPDUs within this range are necessarily valid - the host
  10761. * must check each sequence number within this range to see if the
  10762. * corresponding MPDU is actually present.
  10763. * - PN_IE_COUNT
  10764. * Bits 23:16
  10765. * Purpose:
  10766. * Used to determine the variable number of PN information elements in this
  10767. * message
  10768. *
  10769. * PN information elements:
  10770. * - PN_IE_x-
  10771. * Purpose:
  10772. * Each PN information element contains the sequence number of the MPDU that
  10773. * has failed the target PN check.
  10774. * Value:
  10775. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10776. * that failed the PN check.
  10777. */
  10778. /* first DWORD */
  10779. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10780. #define HTT_RX_PN_IND_PEER_ID_S 8
  10781. #define HTT_RX_PN_IND_TID_M 0xff000000
  10782. #define HTT_RX_PN_IND_TID_S 24
  10783. /* second DWORD */
  10784. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10785. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10786. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10787. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10788. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10789. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10790. #define HTT_RX_PN_IND_BYTES 8
  10791. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10792. do { \
  10793. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10794. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10795. } while (0)
  10796. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10797. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10798. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10799. do { \
  10800. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10801. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10802. } while (0)
  10803. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10804. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10805. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10806. do { \
  10807. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10808. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10809. } while (0)
  10810. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10811. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10812. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10813. do { \
  10814. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10815. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10816. } while (0)
  10817. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10818. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10819. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10820. do { \
  10821. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10822. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10823. } while (0)
  10824. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10825. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10826. /*
  10827. * @brief target -> host rx offload deliver message for LL system
  10828. *
  10829. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10830. *
  10831. * @details
  10832. * In a low latency system this message is sent whenever the offload
  10833. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10834. * The DMA of the actual packets into host memory is done before sending out
  10835. * this message. This message indicates only how many MSDUs to reap. The
  10836. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10837. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10838. * DMA'd by the MAC directly into host memory these packets do not contain
  10839. * the MAC descriptors in the header portion of the packet. Instead they contain
  10840. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10841. * message, the packets are delivered directly to the NW stack without going
  10842. * through the regular reorder buffering and PN checking path since it has
  10843. * already been done in target.
  10844. *
  10845. * |31 24|23 16|15 8|7 0|
  10846. * |-----------------------------------------------------------------------|
  10847. * | Total MSDU count | reserved | msg type |
  10848. * |-----------------------------------------------------------------------|
  10849. *
  10850. * @brief target -> host rx offload deliver message for HL system
  10851. *
  10852. * @details
  10853. * In a high latency system this message is sent whenever the offload manager
  10854. * flushes out the packets it has coalesced in its coalescing buffer. The
  10855. * actual packets are also carried along with this message. When the host
  10856. * receives this message, it is expected to deliver these packets to the NW
  10857. * stack directly instead of routing them through the reorder buffering and
  10858. * PN checking path since it has already been done in target.
  10859. *
  10860. * |31 24|23 16|15 8|7 0|
  10861. * |-----------------------------------------------------------------------|
  10862. * | Total MSDU count | reserved | msg type |
  10863. * |-----------------------------------------------------------------------|
  10864. * | peer ID | MSDU length |
  10865. * |-----------------------------------------------------------------------|
  10866. * | MSDU payload | FW Desc | tid | vdev ID |
  10867. * |-----------------------------------------------------------------------|
  10868. * | MSDU payload contd. |
  10869. * |-----------------------------------------------------------------------|
  10870. * | peer ID | MSDU length |
  10871. * |-----------------------------------------------------------------------|
  10872. * | MSDU payload | FW Desc | tid | vdev ID |
  10873. * |-----------------------------------------------------------------------|
  10874. * | MSDU payload contd. |
  10875. * |-----------------------------------------------------------------------|
  10876. *
  10877. */
  10878. /* first DWORD */
  10879. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10880. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10881. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10882. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10883. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10884. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10885. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10886. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10887. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10888. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10889. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10890. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10891. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10892. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10893. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10894. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10895. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10896. do { \
  10897. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10898. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10899. } while (0)
  10900. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10901. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10902. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10903. do { \
  10904. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10905. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10906. } while (0)
  10907. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10908. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10909. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10910. do { \
  10911. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10912. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10913. } while (0)
  10914. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10915. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10916. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10917. do { \
  10918. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10919. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10920. } while (0)
  10921. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10922. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10923. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10924. do { \
  10925. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10926. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10927. } while (0)
  10928. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10929. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10930. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10931. do { \
  10932. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10933. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10934. } while (0)
  10935. /**
  10936. * @brief target -> host rx peer map/unmap message definition
  10937. *
  10938. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10939. *
  10940. * @details
  10941. * The following diagram shows the format of the rx peer map message sent
  10942. * from the target to the host. This layout assumes the target operates
  10943. * as little-endian.
  10944. *
  10945. * This message always contains a SW peer ID. The main purpose of the
  10946. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10947. * with, so that the host can use that peer ID to determine which peer
  10948. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10949. * other purposes, such as identifying during tx completions which peer
  10950. * the tx frames in question were transmitted to.
  10951. *
  10952. * In certain generations of chips, the peer map message also contains
  10953. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10954. * to identify which peer the frame needs to be forwarded to (i.e. the
  10955. * peer associated with the Destination MAC Address within the packet),
  10956. * and particularly which vdev needs to transmit the frame (for cases
  10957. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10958. * meaning as AST_INDEX_0.
  10959. * This DA-based peer ID that is provided for certain rx frames
  10960. * (the rx frames that need to be re-transmitted as tx frames)
  10961. * is the ID that the HW uses for referring to the peer in question,
  10962. * rather than the peer ID that the SW+FW use to refer to the peer.
  10963. *
  10964. *
  10965. * |31 24|23 16|15 8|7 0|
  10966. * |-----------------------------------------------------------------------|
  10967. * | SW peer ID | VDEV ID | msg type |
  10968. * |-----------------------------------------------------------------------|
  10969. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10970. * |-----------------------------------------------------------------------|
  10971. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10972. * |-----------------------------------------------------------------------|
  10973. *
  10974. *
  10975. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10976. *
  10977. * The following diagram shows the format of the rx peer unmap message sent
  10978. * from the target to the host.
  10979. *
  10980. * |31 24|23 16|15 8|7 0|
  10981. * |-----------------------------------------------------------------------|
  10982. * | SW peer ID | VDEV ID | msg type |
  10983. * |-----------------------------------------------------------------------|
  10984. *
  10985. * The following field definitions describe the format of the rx peer map
  10986. * and peer unmap messages sent from the target to the host.
  10987. * - MSG_TYPE
  10988. * Bits 7:0
  10989. * Purpose: identifies this as an rx peer map or peer unmap message
  10990. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10991. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10992. * - VDEV_ID
  10993. * Bits 15:8
  10994. * Purpose: Indicates which virtual device the peer is associated
  10995. * with.
  10996. * Value: vdev ID (used in the host to look up the vdev object)
  10997. * - PEER_ID (a.k.a. SW_PEER_ID)
  10998. * Bits 31:16
  10999. * Purpose: The peer ID (index) that WAL is allocating (map) or
  11000. * freeing (unmap)
  11001. * Value: (rx) peer ID
  11002. * - MAC_ADDR_L32 (peer map only)
  11003. * Bits 31:0
  11004. * Purpose: Identifies which peer node the peer ID is for.
  11005. * Value: lower 4 bytes of peer node's MAC address
  11006. * - MAC_ADDR_U16 (peer map only)
  11007. * Bits 15:0
  11008. * Purpose: Identifies which peer node the peer ID is for.
  11009. * Value: upper 2 bytes of peer node's MAC address
  11010. * - HW_PEER_ID
  11011. * Bits 31:16
  11012. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11013. * address, so for rx frames marked for rx --> tx forwarding, the
  11014. * host can determine from the HW peer ID provided as meta-data with
  11015. * the rx frame which peer the frame is supposed to be forwarded to.
  11016. * Value: ID used by the MAC HW to identify the peer
  11017. */
  11018. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  11019. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  11020. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  11021. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  11022. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  11023. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  11024. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11025. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  11026. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  11027. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  11028. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  11029. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  11030. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  11031. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  11032. do { \
  11033. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  11034. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  11035. } while (0)
  11036. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  11037. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  11038. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  11039. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  11040. do { \
  11041. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  11042. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  11043. } while (0)
  11044. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  11045. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  11046. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  11047. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  11048. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  11049. do { \
  11050. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  11051. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  11052. } while (0)
  11053. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  11054. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  11055. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11056. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  11057. #define HTT_RX_PEER_MAP_BYTES 12
  11058. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  11059. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  11060. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  11061. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  11062. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  11063. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  11064. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  11065. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  11066. #define HTT_RX_PEER_UNMAP_BYTES 4
  11067. /**
  11068. * @brief target -> host rx peer map V2 message definition
  11069. *
  11070. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  11071. *
  11072. * @details
  11073. * The following diagram shows the format of the rx peer map v2 message sent
  11074. * from the target to the host. This layout assumes the target operates
  11075. * as little-endian.
  11076. *
  11077. * This message always contains a SW peer ID. The main purpose of the
  11078. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  11079. * with, so that the host can use that peer ID to determine which peer
  11080. * transmitted the rx frame. This SW peer ID is sometimes also used for
  11081. * other purposes, such as identifying during tx completions which peer
  11082. * the tx frames in question were transmitted to.
  11083. *
  11084. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  11085. * is used during rx --> tx frame forwarding to identify which peer the
  11086. * frame needs to be forwarded to (i.e. the peer associated with the
  11087. * Destination MAC Address within the packet), and particularly which vdev
  11088. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  11089. * This DA-based peer ID that is provided for certain rx frames
  11090. * (the rx frames that need to be re-transmitted as tx frames)
  11091. * is the ID that the HW uses for referring to the peer in question,
  11092. * rather than the peer ID that the SW+FW use to refer to the peer.
  11093. *
  11094. * The HW peer id here is the same meaning as AST_INDEX_0.
  11095. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  11096. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  11097. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  11098. * AST is valid.
  11099. *
  11100. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  11101. * |-------------------------------------------------------------------------|
  11102. * | SW peer ID | VDEV ID | msg type |
  11103. * |-------------------------------------------------------------------------|
  11104. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11105. * |-------------------------------------------------------------------------|
  11106. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  11107. * |-------------------------------------------------------------------------|
  11108. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  11109. * |-------------------------------------------------------------------------|
  11110. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  11111. * |-------------------------------------------------------------------------|
  11112. * |TID valid low pri| TID valid hi pri | AST index 2 |
  11113. * |-------------------------------------------------------------------------|
  11114. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  11115. * |-------------------------------------------------------------------------|
  11116. * | Reserved_2 |
  11117. * |-------------------------------------------------------------------------|
  11118. * Where:
  11119. * NH = Next Hop
  11120. * ASTVM = AST valid mask
  11121. * OA = on-chip AST valid bit
  11122. * ASTFM = AST flow mask
  11123. *
  11124. * The following field definitions describe the format of the rx peer map v2
  11125. * messages sent from the target to the host.
  11126. * - MSG_TYPE
  11127. * Bits 7:0
  11128. * Purpose: identifies this as an rx peer map v2 message
  11129. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  11130. * - VDEV_ID
  11131. * Bits 15:8
  11132. * Purpose: Indicates which virtual device the peer is associated with.
  11133. * Value: vdev ID (used in the host to look up the vdev object)
  11134. * - SW_PEER_ID
  11135. * Bits 31:16
  11136. * Purpose: The peer ID (index) that WAL is allocating
  11137. * Value: (rx) peer ID
  11138. * - MAC_ADDR_L32
  11139. * Bits 31:0
  11140. * Purpose: Identifies which peer node the peer ID is for.
  11141. * Value: lower 4 bytes of peer node's MAC address
  11142. * - MAC_ADDR_U16
  11143. * Bits 15:0
  11144. * Purpose: Identifies which peer node the peer ID is for.
  11145. * Value: upper 2 bytes of peer node's MAC address
  11146. * - HW_PEER_ID / AST_INDEX_0
  11147. * Bits 31:16
  11148. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11149. * address, so for rx frames marked for rx --> tx forwarding, the
  11150. * host can determine from the HW peer ID provided as meta-data with
  11151. * the rx frame which peer the frame is supposed to be forwarded to.
  11152. * Value: ID used by the MAC HW to identify the peer
  11153. * - AST_HASH_VALUE
  11154. * Bits 15:0
  11155. * Purpose: Indicates AST Hash value is required for the TCL AST index
  11156. * override feature.
  11157. * - NEXT_HOP
  11158. * Bit 16
  11159. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  11160. * (Wireless Distribution System).
  11161. * - AST_VALID_MASK
  11162. * Bits 19:17
  11163. * Purpose: Indicate if the AST 1 through AST 3 are valid
  11164. * - ONCHIP_AST_VALID_FLAG
  11165. * Bit 20
  11166. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  11167. * is valid.
  11168. * - AST_INDEX_1
  11169. * Bits 15:0
  11170. * Purpose: indicate the second AST index for this peer
  11171. * - AST_0_FLOW_MASK
  11172. * Bits 19:16
  11173. * Purpose: identify the which flow the AST 0 entry corresponds to.
  11174. * - AST_1_FLOW_MASK
  11175. * Bits 23:20
  11176. * Purpose: identify the which flow the AST 1 entry corresponds to.
  11177. * - AST_2_FLOW_MASK
  11178. * Bits 27:24
  11179. * Purpose: identify the which flow the AST 2 entry corresponds to.
  11180. * - AST_3_FLOW_MASK
  11181. * Bits 31:28
  11182. * Purpose: identify the which flow the AST 3 entry corresponds to.
  11183. * - AST_INDEX_2
  11184. * Bits 15:0
  11185. * Purpose: indicate the third AST index for this peer
  11186. * - TID_VALID_HI_PRI
  11187. * Bits 23:16
  11188. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  11189. * - TID_VALID_LOW_PRI
  11190. * Bits 31:24
  11191. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  11192. * - AST_INDEX_3
  11193. * Bits 15:0
  11194. * Purpose: indicate the fourth AST index for this peer
  11195. * - ONCHIP_AST_IDX / RESERVED
  11196. * Bits 31:16
  11197. * Purpose: This field is valid only when split AST feature is enabled.
  11198. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  11199. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11200. * address, this ast_idx is used for LMAC modules for RXPCU.
  11201. * Value: ID used by the LMAC HW to identify the peer
  11202. */
  11203. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  11204. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  11205. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  11206. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  11207. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  11208. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  11209. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  11210. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  11211. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  11212. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  11213. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  11214. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  11215. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  11216. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  11217. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  11218. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  11219. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  11220. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  11221. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  11222. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  11223. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  11224. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  11225. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  11226. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  11227. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  11228. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  11229. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  11230. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  11231. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  11232. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  11233. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  11234. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  11235. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  11236. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  11237. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  11238. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  11239. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  11240. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  11241. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  11242. do { \
  11243. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  11244. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  11245. } while (0)
  11246. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  11247. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  11248. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  11249. do { \
  11250. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  11251. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  11252. } while (0)
  11253. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  11254. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  11255. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  11256. do { \
  11257. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  11258. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  11259. } while (0)
  11260. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  11261. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  11262. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  11263. do { \
  11264. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  11265. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  11266. } while (0)
  11267. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  11268. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  11269. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  11270. do { \
  11271. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  11272. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  11273. } while (0)
  11274. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  11275. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  11276. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  11277. do { \
  11278. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  11279. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  11280. } while (0)
  11281. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  11282. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  11283. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  11284. do { \
  11285. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  11286. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  11287. } while (0)
  11288. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  11289. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  11290. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11291. do { \
  11292. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  11293. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  11294. } while (0)
  11295. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  11296. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  11297. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  11298. do { \
  11299. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  11300. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  11301. } while (0)
  11302. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  11303. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  11304. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  11305. do { \
  11306. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  11307. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  11308. } while (0)
  11309. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  11310. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  11311. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  11312. do { \
  11313. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  11314. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  11315. } while (0)
  11316. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  11317. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  11318. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  11319. do { \
  11320. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  11321. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  11322. } while (0)
  11323. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  11324. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  11325. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11326. do { \
  11327. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11328. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11329. } while (0)
  11330. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11331. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11332. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11333. do { \
  11334. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11335. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11336. } while (0)
  11337. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11338. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11339. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11340. do { \
  11341. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11342. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11343. } while (0)
  11344. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11345. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11346. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11347. do { \
  11348. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11349. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11350. } while (0)
  11351. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11352. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11353. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11354. do { \
  11355. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11356. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11357. } while (0)
  11358. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11359. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11360. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11361. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11362. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11363. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11364. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11365. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11366. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11367. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11368. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11369. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11370. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11371. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11372. /**
  11373. * @brief target -> host rx peer map V3 message definition
  11374. *
  11375. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11376. *
  11377. * @details
  11378. * The following diagram shows the format of the rx peer map v3 message sent
  11379. * from the target to the host.
  11380. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11381. * This layout assumes the target operates as little-endian.
  11382. *
  11383. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11384. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11385. * | SW peer ID | VDEV ID | msg type |
  11386. * |-----------------+--------------------+-----------------+-----------------|
  11387. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11388. * |-----------------+--------------------+-----------------+-----------------|
  11389. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11390. * |-----------------+--------+-----------+-----------------+-----------------|
  11391. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11392. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11393. * | (8bits) | | (4bits) | |
  11394. * |-----------------+--------+--+--+--+--------------------------------------|
  11395. * | RESERVED |E |O | | |
  11396. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11397. * | |V |V | | |
  11398. * |-----------------+--------------------+-----------------------------------|
  11399. * | HTT_MSDU_IDX_ | RESERVED | |
  11400. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11401. * | (8bits) | | |
  11402. * |-----------------+--------------------+-----------------------------------|
  11403. * | Reserved_2 |
  11404. * |--------------------------------------------------------------------------|
  11405. * | Reserved_3 |
  11406. * |--------------------------------------------------------------------------|
  11407. *
  11408. * Where:
  11409. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11410. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11411. * NH = Next Hop
  11412. * The following field definitions describe the format of the rx peer map v3
  11413. * messages sent from the target to the host.
  11414. * - MSG_TYPE
  11415. * Bits 7:0
  11416. * Purpose: identifies this as a peer map v3 message
  11417. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11418. * - VDEV_ID
  11419. * Bits 15:8
  11420. * Purpose: Indicates which virtual device the peer is associated with.
  11421. * - SW_PEER_ID
  11422. * Bits 31:16
  11423. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11424. * - MAC_ADDR_L32
  11425. * Bits 31:0
  11426. * Purpose: Identifies which peer node the peer ID is for.
  11427. * Value: lower 4 bytes of peer node's MAC address
  11428. * - MAC_ADDR_U16
  11429. * Bits 15:0
  11430. * Purpose: Identifies which peer node the peer ID is for.
  11431. * Value: upper 2 bytes of peer node's MAC address
  11432. * - MULTICAST_SW_PEER_ID
  11433. * Bits 31:16
  11434. * Purpose: The multicast peer ID (index)
  11435. * Value: set to HTT_INVALID_PEER if not valid
  11436. * - HW_PEER_ID / AST_INDEX
  11437. * Bits 15:0
  11438. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11439. * address, so for rx frames marked for rx --> tx forwarding, the
  11440. * host can determine from the HW peer ID provided as meta-data with
  11441. * the rx frame which peer the frame is supposed to be forwarded to.
  11442. * - CACHE_SET_NUM
  11443. * Bits 19:16
  11444. * Purpose: Cache Set Number for AST_INDEX
  11445. * Cache set number that should be used to cache the index based
  11446. * search results, for address and flow search.
  11447. * This value should be equal to LSB 4 bits of the hash value
  11448. * of match data, in case of search index points to an entry which
  11449. * may be used in content based search also. The value can be
  11450. * anything when the entry pointed by search index will not be
  11451. * used for content based search.
  11452. * - HTT_MSDU_IDX_VALID_MASK
  11453. * Bits 31:24
  11454. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11455. * - ONCHIP_AST_IDX / RESERVED
  11456. * Bits 15:0
  11457. * Purpose: This field is valid only when split AST feature is enabled.
  11458. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11459. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11460. * address, this ast_idx is used for LMAC modules for RXPCU.
  11461. * - NEXT_HOP
  11462. * Bits 16
  11463. * Purpose: Flag indicates next_hop AST entry used for WDS
  11464. * (Wireless Distribution System).
  11465. * - ONCHIP_AST_VALID
  11466. * Bits 17
  11467. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11468. * - EXT_AST_VALID
  11469. * Bits 18
  11470. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11471. * - EXT_AST_INDEX
  11472. * Bits 15:0
  11473. * Purpose: This field describes Extended AST index
  11474. * Valid if EXT_AST_VALID flag set
  11475. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11476. * Bits 31:24
  11477. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11478. */
  11479. /* dword 0 */
  11480. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11481. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11482. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11483. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11484. /* dword 1 */
  11485. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11486. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11487. /* dword 2 */
  11488. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11489. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11490. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11491. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11492. /* dword 3 */
  11493. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11494. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11495. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11496. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11497. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11498. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11499. /* dword 4 */
  11500. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11501. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11502. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11503. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11504. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11505. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11506. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11507. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11508. /* dword 5 */
  11509. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11510. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11511. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11512. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11513. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11514. do { \
  11515. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11516. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11517. } while (0)
  11518. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11519. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11520. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11521. do { \
  11522. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11523. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11524. } while (0)
  11525. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11526. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11527. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11528. do { \
  11529. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11530. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11531. } while (0)
  11532. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11533. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11534. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11535. do { \
  11536. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11537. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11538. } while (0)
  11539. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11540. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11541. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11542. do { \
  11543. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11544. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11545. } while (0)
  11546. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11547. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11548. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11549. do { \
  11550. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11551. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11552. } while (0)
  11553. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11554. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11555. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11556. do { \
  11557. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11558. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11559. } while (0)
  11560. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11561. (((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)
  11562. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11563. do { \
  11564. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11565. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11566. } while (0)
  11567. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11568. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11569. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11570. do { \
  11571. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11572. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11573. } while (0)
  11574. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11575. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11576. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11577. do { \
  11578. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11579. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11580. } while (0)
  11581. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11582. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11583. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11584. do { \
  11585. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11586. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11587. } while (0)
  11588. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11589. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11590. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11591. do { \
  11592. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11593. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11594. } while (0)
  11595. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11596. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11597. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11598. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11599. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11600. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11601. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11602. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11603. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11604. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11605. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11606. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11607. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11608. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11609. /**
  11610. * @brief target -> host rx peer unmap V2 message definition
  11611. *
  11612. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11613. *
  11614. * The following diagram shows the format of the rx peer unmap message sent
  11615. * from the target to the host.
  11616. *
  11617. * |31 24|23 16|15 8|7 0|
  11618. * |-----------------------------------------------------------------------|
  11619. * | SW peer ID | VDEV ID | msg type |
  11620. * |-----------------------------------------------------------------------|
  11621. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11622. * |-----------------------------------------------------------------------|
  11623. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11624. * |-----------------------------------------------------------------------|
  11625. * | Peer Delete Duration |
  11626. * |-----------------------------------------------------------------------|
  11627. * | Reserved_0 | WDS Free Count |
  11628. * |-----------------------------------------------------------------------|
  11629. * | Reserved_1 |
  11630. * |-----------------------------------------------------------------------|
  11631. * | Reserved_2 |
  11632. * |-----------------------------------------------------------------------|
  11633. *
  11634. *
  11635. * The following field definitions describe the format of the rx peer unmap
  11636. * messages sent from the target to the host.
  11637. * - MSG_TYPE
  11638. * Bits 7:0
  11639. * Purpose: identifies this as an rx peer unmap v2 message
  11640. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11641. * - VDEV_ID
  11642. * Bits 15:8
  11643. * Purpose: Indicates which virtual device the peer is associated
  11644. * with.
  11645. * Value: vdev ID (used in the host to look up the vdev object)
  11646. * - SW_PEER_ID
  11647. * Bits 31:16
  11648. * Purpose: The peer ID (index) that WAL is freeing
  11649. * Value: (rx) peer ID
  11650. * - MAC_ADDR_L32
  11651. * Bits 31:0
  11652. * Purpose: Identifies which peer node the peer ID is for.
  11653. * Value: lower 4 bytes of peer node's MAC address
  11654. * - MAC_ADDR_U16
  11655. * Bits 15:0
  11656. * Purpose: Identifies which peer node the peer ID is for.
  11657. * Value: upper 2 bytes of peer node's MAC address
  11658. * - NEXT_HOP
  11659. * Bits 16
  11660. * Purpose: Bit indicates next_hop AST entry used for WDS
  11661. * (Wireless Distribution System).
  11662. * - PEER_DELETE_DURATION
  11663. * Bits 31:0
  11664. * Purpose: Time taken to delete peer, in msec,
  11665. * Used for monitoring / debugging PEER delete response delay
  11666. * - PEER_WDS_FREE_COUNT
  11667. * Bits 15:0
  11668. * Purpose: Count of WDS entries deleted associated to peer deleted
  11669. */
  11670. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11671. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11672. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11673. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11674. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11675. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11676. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11677. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11678. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11679. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11680. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11681. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11682. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11683. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11684. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11685. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11686. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11687. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11688. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11689. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11690. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11691. do { \
  11692. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11693. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11694. } while (0)
  11695. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11696. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11697. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11698. do { \
  11699. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11700. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11701. } while (0)
  11702. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11703. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11704. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11705. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11706. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11707. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11708. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11709. /**
  11710. * @brief target -> host rx peer mlo map message definition
  11711. *
  11712. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11713. *
  11714. * @details
  11715. * The following diagram shows the format of the rx mlo peer map message sent
  11716. * from the target to the host. This layout assumes the target operates
  11717. * as little-endian.
  11718. *
  11719. * MCC:
  11720. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11721. *
  11722. * WIN:
  11723. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11724. * It will be sent on the Assoc Link.
  11725. *
  11726. * This message always contains a MLO peer ID. The main purpose of the
  11727. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11728. * with, so that the host can use that MLO peer ID to determine which peer
  11729. * transmitted the rx frame.
  11730. *
  11731. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11732. * |-------------------------------------------------------------------------|
  11733. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11734. * |-------------------------------------------------------------------------|
  11735. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11736. * |-------------------------------------------------------------------------|
  11737. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11738. * |-------------------------------------------------------------------------|
  11739. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11740. * |-------------------------------------------------------------------------|
  11741. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11742. * |-------------------------------------------------------------------------|
  11743. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11744. * |-------------------------------------------------------------------------|
  11745. * |RSVD |
  11746. * |-------------------------------------------------------------------------|
  11747. * |RSVD |
  11748. * |-------------------------------------------------------------------------|
  11749. * | htt_tlv_hdr_t |
  11750. * |-------------------------------------------------------------------------|
  11751. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11752. * |-------------------------------------------------------------------------|
  11753. * | htt_tlv_hdr_t |
  11754. * |-------------------------------------------------------------------------|
  11755. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11756. * |-------------------------------------------------------------------------|
  11757. * | htt_tlv_hdr_t |
  11758. * |-------------------------------------------------------------------------|
  11759. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11760. * |-------------------------------------------------------------------------|
  11761. *
  11762. * Where:
  11763. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11764. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11765. * V (valid) - 1 Bit Bit17
  11766. * CHIPID - 3 Bits
  11767. * TIDMASK - 8 Bits
  11768. * CACHE_SET_NUM - 8 Bits
  11769. *
  11770. * The following field definitions describe the format of the rx MLO peer map
  11771. * messages sent from the target to the host.
  11772. * - MSG_TYPE
  11773. * Bits 7:0
  11774. * Purpose: identifies this as an rx mlo peer map message
  11775. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11776. *
  11777. * - MLO_PEER_ID
  11778. * Bits 23:8
  11779. * Purpose: The MLO peer ID (index).
  11780. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11781. * Value: MLO peer ID
  11782. *
  11783. * - NUMLINK
  11784. * Bits: 26:24 (3Bits)
  11785. * Purpose: Indicate the max number of logical links supported per client.
  11786. * Value: number of logical links
  11787. *
  11788. * - PRC
  11789. * Bits: 29:27 (3Bits)
  11790. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11791. * if there is migration of the primary chip.
  11792. * Value: Primary REO CHIPID
  11793. *
  11794. * - MAC_ADDR_L32
  11795. * Bits 31:0
  11796. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11797. * Value: lower 4 bytes of peer node's MAC address
  11798. *
  11799. * - MAC_ADDR_U16
  11800. * Bits 15:0
  11801. * Purpose: Identifies which peer node the peer ID is for.
  11802. * Value: upper 2 bytes of peer node's MAC address
  11803. *
  11804. * - PRIMARY_TCL_AST_IDX
  11805. * Bits 15:0
  11806. * Purpose: Primary TCL AST index for this peer.
  11807. *
  11808. * - V
  11809. * 1 Bit Position 16
  11810. * Purpose: If the ast idx is valid.
  11811. *
  11812. * - CHIPID
  11813. * Bits 19:17
  11814. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11815. *
  11816. * - TIDMASK
  11817. * Bits 27:20
  11818. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11819. *
  11820. * - CACHE_SET_NUM
  11821. * Bits 31:28
  11822. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11823. * Cache set number that should be used to cache the index based
  11824. * search results, for address and flow search.
  11825. * This value should be equal to LSB four bits of the hash value
  11826. * of match data, in case of search index points to an entry which
  11827. * may be used in content based search also. The value can be
  11828. * anything when the entry pointed by search index will not be
  11829. * used for content based search.
  11830. *
  11831. * - htt_tlv_hdr_t
  11832. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11833. *
  11834. * Bits 11:0
  11835. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11836. *
  11837. * Bits 23:12
  11838. * Purpose: Length, Length of the value that follows the header
  11839. *
  11840. * Bits 31:28
  11841. * Purpose: Reserved.
  11842. *
  11843. *
  11844. * - SW_PEER_ID
  11845. * Bits 15:0
  11846. * Purpose: The peer ID (index) that WAL is allocating
  11847. * Value: (rx) peer ID
  11848. *
  11849. * - VDEV_ID
  11850. * Bits 23:16
  11851. * Purpose: Indicates which virtual device the peer is associated with.
  11852. * Value: vdev ID (used in the host to look up the vdev object)
  11853. *
  11854. * - CHIPID
  11855. * Bits 26:24
  11856. * Purpose: Indicates which Chip id the peer is associated with.
  11857. * Value: chip ID (Provided by Host as part of QMI exchange)
  11858. */
  11859. typedef enum {
  11860. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11861. } MLO_PEER_MAP_TLV_TAG_ID;
  11862. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11863. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11864. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11865. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11866. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11867. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11868. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11869. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11870. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11871. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11872. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11873. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11874. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11875. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11876. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11877. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11878. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11879. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11880. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11881. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11882. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11883. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11884. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11885. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11886. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11887. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11888. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11889. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11890. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11891. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11892. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11893. do { \
  11894. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11895. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11896. } while (0)
  11897. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11898. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11899. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11900. do { \
  11901. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11902. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11903. } while (0)
  11904. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11905. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11906. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11907. do { \
  11908. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11909. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11910. } while (0)
  11911. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11912. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11913. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11914. do { \
  11915. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11916. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11917. } while (0)
  11918. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11919. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11920. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11921. do { \
  11922. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11923. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11924. } while (0)
  11925. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11926. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11927. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11928. do { \
  11929. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11930. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11931. } while (0)
  11932. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11933. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11934. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11935. do { \
  11936. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11937. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11938. } while (0)
  11939. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11940. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11941. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11942. do { \
  11943. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11944. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11945. } while (0)
  11946. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11947. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11948. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11949. do { \
  11950. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11951. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11952. } while (0)
  11953. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11954. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11955. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11956. do { \
  11957. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11958. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11959. } while (0)
  11960. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11961. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11962. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11963. do { \
  11964. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11965. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11966. } while (0)
  11967. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11968. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11969. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11970. do { \
  11971. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11972. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11973. } while (0)
  11974. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11975. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11976. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11977. do { \
  11978. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11979. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11980. } while (0)
  11981. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11982. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11983. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11984. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11985. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11986. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11987. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11988. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11989. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11990. *
  11991. * The following diagram shows the format of the rx mlo peer unmap message sent
  11992. * from the target to the host.
  11993. *
  11994. * |31 24|23 16|15 8|7 0|
  11995. * |-----------------------------------------------------------------------|
  11996. * | RSVD_24_31 | MLO peer ID | msg type |
  11997. * |-----------------------------------------------------------------------|
  11998. */
  11999. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  12000. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  12001. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  12002. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  12003. /**
  12004. * @brief target -> host message specifying security parameters
  12005. *
  12006. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  12007. *
  12008. * @details
  12009. * The following diagram shows the format of the security specification
  12010. * message sent from the target to the host.
  12011. * This security specification message tells the host whether a PN check is
  12012. * necessary on rx data frames, and if so, how large the PN counter is.
  12013. * This message also tells the host about the security processing to apply
  12014. * to defragmented rx frames - specifically, whether a Message Integrity
  12015. * Check is required, and the Michael key to use.
  12016. *
  12017. * |31 24|23 16|15|14 8|7 0|
  12018. * |-----------------------------------------------------------------------|
  12019. * | peer ID | U| security type | msg type |
  12020. * |-----------------------------------------------------------------------|
  12021. * | Michael Key K0 |
  12022. * |-----------------------------------------------------------------------|
  12023. * | Michael Key K1 |
  12024. * |-----------------------------------------------------------------------|
  12025. * | WAPI RSC Low0 |
  12026. * |-----------------------------------------------------------------------|
  12027. * | WAPI RSC Low1 |
  12028. * |-----------------------------------------------------------------------|
  12029. * | WAPI RSC Hi0 |
  12030. * |-----------------------------------------------------------------------|
  12031. * | WAPI RSC Hi1 |
  12032. * |-----------------------------------------------------------------------|
  12033. *
  12034. * The following field definitions describe the format of the security
  12035. * indication message sent from the target to the host.
  12036. * - MSG_TYPE
  12037. * Bits 7:0
  12038. * Purpose: identifies this as a security specification message
  12039. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  12040. * - SEC_TYPE
  12041. * Bits 14:8
  12042. * Purpose: specifies which type of security applies to the peer
  12043. * Value: htt_sec_type enum value
  12044. * - UNICAST
  12045. * Bit 15
  12046. * Purpose: whether this security is applied to unicast or multicast data
  12047. * Value: 1 -> unicast, 0 -> multicast
  12048. * - PEER_ID
  12049. * Bits 31:16
  12050. * Purpose: The ID number for the peer the security specification is for
  12051. * Value: peer ID
  12052. * - MICHAEL_KEY_K0
  12053. * Bits 31:0
  12054. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  12055. * Value: Michael Key K0 (if security type is TKIP)
  12056. * - MICHAEL_KEY_K1
  12057. * Bits 31:0
  12058. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  12059. * Value: Michael Key K1 (if security type is TKIP)
  12060. * - WAPI_RSC_LOW0
  12061. * Bits 31:0
  12062. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  12063. * Value: WAPI RSC Low0 (if security type is WAPI)
  12064. * - WAPI_RSC_LOW1
  12065. * Bits 31:0
  12066. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  12067. * Value: WAPI RSC Low1 (if security type is WAPI)
  12068. * - WAPI_RSC_HI0
  12069. * Bits 31:0
  12070. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  12071. * Value: WAPI RSC Hi0 (if security type is WAPI)
  12072. * - WAPI_RSC_HI1
  12073. * Bits 31:0
  12074. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  12075. * Value: WAPI RSC Hi1 (if security type is WAPI)
  12076. */
  12077. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  12078. #define HTT_SEC_IND_SEC_TYPE_S 8
  12079. #define HTT_SEC_IND_UNICAST_M 0x00008000
  12080. #define HTT_SEC_IND_UNICAST_S 15
  12081. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  12082. #define HTT_SEC_IND_PEER_ID_S 16
  12083. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  12084. do { \
  12085. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  12086. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  12087. } while (0)
  12088. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  12089. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  12090. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  12091. do { \
  12092. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  12093. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  12094. } while (0)
  12095. #define HTT_SEC_IND_UNICAST_GET(word) \
  12096. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  12097. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  12098. do { \
  12099. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  12100. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  12101. } while (0)
  12102. #define HTT_SEC_IND_PEER_ID_GET(word) \
  12103. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  12104. #define HTT_SEC_IND_BYTES 28
  12105. /**
  12106. * @brief target -> host rx ADDBA / DELBA message definitions
  12107. *
  12108. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  12109. *
  12110. * @details
  12111. * The following diagram shows the format of the rx ADDBA message sent
  12112. * from the target to the host:
  12113. *
  12114. * |31 20|19 16|15 8|7 0|
  12115. * |---------------------------------------------------------------------|
  12116. * | peer ID | TID | window size | msg type |
  12117. * |---------------------------------------------------------------------|
  12118. *
  12119. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  12120. *
  12121. * The following diagram shows the format of the rx DELBA message sent
  12122. * from the target to the host:
  12123. *
  12124. * |31 20|19 16|15 10|9 8|7 0|
  12125. * |---------------------------------------------------------------------|
  12126. * | peer ID | TID | window size | IR| msg type |
  12127. * |---------------------------------------------------------------------|
  12128. *
  12129. * The following field definitions describe the format of the rx ADDBA
  12130. * and DELBA messages sent from the target to the host.
  12131. * - MSG_TYPE
  12132. * Bits 7:0
  12133. * Purpose: identifies this as an rx ADDBA or DELBA message
  12134. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  12135. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  12136. * - IR (initiator / recipient)
  12137. * Bits 9:8 (DELBA only)
  12138. * Purpose: specify whether the DELBA handshake was initiated by the
  12139. * local STA/AP, or by the peer STA/AP
  12140. * Value:
  12141. * 0 - unspecified
  12142. * 1 - initiator (a.k.a. originator)
  12143. * 2 - recipient (a.k.a. responder)
  12144. * 3 - unused / reserved
  12145. * - WIN_SIZE
  12146. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  12147. * Purpose: Specifies the length of the block ack window (max = 64).
  12148. * Value:
  12149. * block ack window length specified by the received ADDBA/DELBA
  12150. * management message.
  12151. * - TID
  12152. * Bits 19:16
  12153. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12154. * Value:
  12155. * TID specified by the received ADDBA or DELBA management message.
  12156. * - PEER_ID
  12157. * Bits 31:20
  12158. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12159. * Value:
  12160. * ID (hash value) used by the host for fast, direct lookup of
  12161. * host SW peer info, including rx reorder states.
  12162. */
  12163. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  12164. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  12165. #define HTT_RX_ADDBA_TID_M 0xf0000
  12166. #define HTT_RX_ADDBA_TID_S 16
  12167. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  12168. #define HTT_RX_ADDBA_PEER_ID_S 20
  12169. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  12170. do { \
  12171. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  12172. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  12173. } while (0)
  12174. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  12175. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12176. #define HTT_RX_ADDBA_TID_SET(word, value) \
  12177. do { \
  12178. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  12179. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  12180. } while (0)
  12181. #define HTT_RX_ADDBA_TID_GET(word) \
  12182. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  12183. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  12184. do { \
  12185. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  12186. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  12187. } while (0)
  12188. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  12189. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  12190. #define HTT_RX_ADDBA_BYTES 4
  12191. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  12192. #define HTT_RX_DELBA_INITIATOR_S 8
  12193. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  12194. #define HTT_RX_DELBA_WIN_SIZE_S 10
  12195. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  12196. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  12197. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  12198. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  12199. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  12200. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  12201. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  12202. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  12203. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12204. do { \
  12205. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12206. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12207. } while (0)
  12208. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12209. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12210. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  12211. do { \
  12212. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  12213. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  12214. } while (0)
  12215. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  12216. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  12217. #define HTT_RX_DELBA_BYTES 4
  12218. /**
  12219. * @brief target -> host rx ADDBA / DELBA message definitions
  12220. *
  12221. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN
  12222. *
  12223. * @details
  12224. * The following diagram shows the format of the rx ADDBA extn message sent
  12225. * from the target to the host:
  12226. *
  12227. * |31 20|19 16|15 13|12 8|7 0|
  12228. * |---------------------------------------------------------------------|
  12229. * | peer ID | TID | reserved | msg type |
  12230. * |---------------------------------------------------------------------|
  12231. * | reserved | window size |
  12232. * |---------------------------------------------------------------------|
  12233. *
  12234. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA_EXTN
  12235. *
  12236. * The following diagram shows the format of the rx DELBA message sent
  12237. * from the target to the host:
  12238. *
  12239. * |31 20|19 16|15 13|12 10|9 8|7 0|
  12240. * |---------------------------------------------------------------------|
  12241. * | peer ID | TID | reserved | IR| msg type |
  12242. * |---------------------------------------------------------------------|
  12243. * | reserved | window size |
  12244. * |---------------------------------------------------------------------|
  12245. *
  12246. * The following field definitions describe the format of the rx ADDBA
  12247. * and DELBA messages sent from the target to the host.
  12248. * - MSG_TYPE
  12249. * Bits 7:0
  12250. * Purpose: identifies this as an rx ADDBA or DELBA message
  12251. * Value: ADDBA -> 0x31 (HTT_T2H_MSG_TYPE_RX_ADDBA_EXTN),
  12252. * DELBA -> 0x32 (HTT_T2H_MSG_TYPE_RX_DELBA_EXTN)
  12253. * - IR (initiator / recipient)
  12254. * Bits 9:8 (DELBA only)
  12255. * Purpose: specify whether the DELBA handshake was initiated by the
  12256. * local STA/AP, or by the peer STA/AP
  12257. * Value:
  12258. * 0 - unspecified
  12259. * 1 - initiator (a.k.a. originator)
  12260. * 2 - recipient (a.k.a. responder)
  12261. * 3 - unused / reserved
  12262. * Value:
  12263. * block ack window length specified by the received ADDBA/DELBA
  12264. * management message.
  12265. * - TID
  12266. * Bits 19:16
  12267. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  12268. * Value:
  12269. * TID specified by the received ADDBA or DELBA management message.
  12270. * - PEER_ID
  12271. * Bits 31:20
  12272. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  12273. * Value:
  12274. * ID (hash value) used by the host for fast, direct lookup of
  12275. * host SW peer info, including rx reorder states.
  12276. * == DWORD 1
  12277. * - WIN_SIZE
  12278. * Bits 12:0 for ADDBA, bits 12:0 for DELBA
  12279. * Purpose: Specifies the length of the block ack window (max = 8191).
  12280. */
  12281. #define HTT_RX_ADDBA_EXTN_TID_M 0xf0000
  12282. #define HTT_RX_ADDBA_EXTN_TID_S 16
  12283. #define HTT_RX_ADDBA_EXTN_PEER_ID_M 0xfff00000
  12284. #define HTT_RX_ADDBA_EXTN_PEER_ID_S 20
  12285. /*--- Dword 0 ---*/
  12286. #define HTT_RX_ADDBA_EXTN_TID_SET(word, value) \
  12287. do { \
  12288. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_TID, value); \
  12289. (word) |= (value) << HTT_RX_ADDBA_EXTN_TID_S; \
  12290. } while (0)
  12291. #define HTT_RX_ADDBA_EXTN_TID_GET(word) \
  12292. (((word) & HTT_RX_ADDBA_EXTN_TID_M) >> HTT_RX_ADDBA_EXTN_TID_S)
  12293. #define HTT_RX_ADDBA_EXTN_PEER_ID_SET(word, value) \
  12294. do { \
  12295. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_PEER_ID, value); \
  12296. (word) |= (value) << HTT_RX_ADDBA_EXTN_PEER_ID_S; \
  12297. } while (0)
  12298. #define HTT_RX_ADDBA_EXTN_PEER_ID_GET(word) \
  12299. (((word) & HTT_RX_ADDBA_EXTN_PEER_ID_M) >> HTT_RX_ADDBA_EXTN_PEER_ID_S)
  12300. /*--- Dword 1 ---*/
  12301. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_M 0x1fff
  12302. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_S 0
  12303. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_SET(word, value) \
  12304. do { \
  12305. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_EXTN_WIN_SIZE, value); \
  12306. (word) |= (value) << HTT_RX_ADDBA_EXTN_WIN_SIZE_S; \
  12307. } while (0)
  12308. #define HTT_RX_ADDBA_EXTN_WIN_SIZE_GET(word) \
  12309. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  12310. #define HTT_RX_ADDBA_EXTN_BYTES 8
  12311. #define HTT_RX_DELBA_EXTN_INITIATOR_M 0x00000300
  12312. #define HTT_RX_DELBA_EXTN_INITIATOR_S 8
  12313. #define HTT_RX_DELBA_EXTN_TID_M 0xf0000
  12314. #define HTT_RX_DELBA_EXTN_TID_S 16
  12315. #define HTT_RX_DELBA_EXTN_PEER_ID_M 0xfff00000
  12316. #define HTT_RX_DELBA_EXTN_PEER_ID_S 20
  12317. /*--- Dword 0 ---*/
  12318. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  12319. do { \
  12320. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  12321. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  12322. } while (0)
  12323. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  12324. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  12325. #define HTT_RX_DELBA_EXTN_TID_SET(word, value) \
  12326. do { \
  12327. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_TID, value); \
  12328. (word) |= (value) << HTT_RX_DELBA_EXTN_TID_S; \
  12329. } while (0)
  12330. #define HTT_RX_DELBA_EXTN_TID_GET(word) \
  12331. (((word) & HTT_RX_DELBA_EXTN_TID_M) >> HTT_RX_DELBA_EXTN_TID_S)
  12332. #define HTT_RX_DELBA_EXTN_PEER_ID_SET(word, value) \
  12333. do { \
  12334. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_PEER_ID, value); \
  12335. (word) |= (value) << HTT_RX_DELBA_EXTN_PEER_ID_S; \
  12336. } while (0)
  12337. #define HTT_RX_DELBA_EXTN_PEER_ID_GET(word) \
  12338. (((word) & HTT_RX_DELBA_EXTN_PEER_ID_M) >> HTT_RX_DELBA_EXTN_PEER_ID_S)
  12339. /*--- Dword 1 ---*/
  12340. #define HTT_RX_DELBA_EXTN_WIN_SIZE_M 0x1fff
  12341. #define HTT_RX_DELBA_EXTN_WIN_SIZE_S 0
  12342. #define HTT_RX_DELBA_EXTN_WIN_SIZE_SET(word, value) \
  12343. do { \
  12344. HTT_CHECK_SET_VAL(HTT_RX_DELBA_EXTN_WIN_SIZE, value); \
  12345. (word) |= (value) << HTT_RX_DELBA_EXTN_WIN_SIZE_S; \
  12346. } while (0)
  12347. #define HTT_RX_DELBA_EXTN_WIN_SIZE_GET(word) \
  12348. (((word) & HTT_RX_DELBA_EXTN_WIN_SIZE_M) >> HTT_RX_DELBA_EXTN_WIN_SIZE_S)
  12349. #define HTT_RX_DELBA_EXTN_BYTES 8
  12350. /**
  12351. * @brief tx queue group information element definition
  12352. *
  12353. * @details
  12354. * The following diagram shows the format of the tx queue group
  12355. * information element, which can be included in target --> host
  12356. * messages to specify the number of tx "credits" (tx descriptors
  12357. * for LL, or tx buffers for HL) available to a particular group
  12358. * of host-side tx queues, and which host-side tx queues belong to
  12359. * the group.
  12360. *
  12361. * |31|30 24|23 16|15|14|13 0|
  12362. * |------------------------------------------------------------------------|
  12363. * | X| reserved | tx queue grp ID | A| S| credit count |
  12364. * |------------------------------------------------------------------------|
  12365. * | vdev ID mask | AC mask |
  12366. * |------------------------------------------------------------------------|
  12367. *
  12368. * The following definitions describe the fields within the tx queue group
  12369. * information element:
  12370. * - credit_count
  12371. * Bits 13:1
  12372. * Purpose: specify how many tx credits are available to the tx queue group
  12373. * Value: An absolute or relative, positive or negative credit value
  12374. * The 'A' bit specifies whether the value is absolute or relative.
  12375. * The 'S' bit specifies whether the value is positive or negative.
  12376. * A negative value can only be relative, not absolute.
  12377. * An absolute value replaces any prior credit value the host has for
  12378. * the tx queue group in question.
  12379. * A relative value is added to the prior credit value the host has for
  12380. * the tx queue group in question.
  12381. * - sign
  12382. * Bit 14
  12383. * Purpose: specify whether the credit count is positive or negative
  12384. * Value: 0 -> positive, 1 -> negative
  12385. * - absolute
  12386. * Bit 15
  12387. * Purpose: specify whether the credit count is absolute or relative
  12388. * Value: 0 -> relative, 1 -> absolute
  12389. * - txq_group_id
  12390. * Bits 23:16
  12391. * Purpose: indicate which tx queue group's credit and/or membership are
  12392. * being specified
  12393. * Value: 0 to max_tx_queue_groups-1
  12394. * - reserved
  12395. * Bits 30:16
  12396. * Value: 0x0
  12397. * - eXtension
  12398. * Bit 31
  12399. * Purpose: specify whether another tx queue group info element follows
  12400. * Value: 0 -> no more tx queue group information elements
  12401. * 1 -> another tx queue group information element immediately follows
  12402. * - ac_mask
  12403. * Bits 15:0
  12404. * Purpose: specify which Access Categories belong to the tx queue group
  12405. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  12406. * the tx queue group.
  12407. * The AC bit-mask values are obtained by left-shifting by the
  12408. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  12409. * - vdev_id_mask
  12410. * Bits 31:16
  12411. * Purpose: specify which vdev's tx queues belong to the tx queue group
  12412. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  12413. * belong to the tx queue group.
  12414. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  12415. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  12416. */
  12417. PREPACK struct htt_txq_group {
  12418. A_UINT32
  12419. credit_count: 14,
  12420. sign: 1,
  12421. absolute: 1,
  12422. tx_queue_group_id: 8,
  12423. reserved0: 7,
  12424. extension: 1;
  12425. A_UINT32
  12426. ac_mask: 16,
  12427. vdev_id_mask: 16;
  12428. } POSTPACK;
  12429. /* first word */
  12430. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  12431. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  12432. #define HTT_TXQ_GROUP_SIGN_S 14
  12433. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  12434. #define HTT_TXQ_GROUP_ABS_S 15
  12435. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  12436. #define HTT_TXQ_GROUP_ID_S 16
  12437. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  12438. #define HTT_TXQ_GROUP_EXT_S 31
  12439. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  12440. /* second word */
  12441. #define HTT_TXQ_GROUP_AC_MASK_S 0
  12442. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  12443. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  12444. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  12445. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  12446. do { \
  12447. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  12448. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  12449. } while (0)
  12450. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  12451. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  12452. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  12453. do { \
  12454. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  12455. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  12456. } while (0)
  12457. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12458. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12459. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12460. do { \
  12461. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12462. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12463. } while (0)
  12464. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12465. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12466. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12467. do { \
  12468. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12469. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12470. } while (0)
  12471. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12472. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12473. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12474. do { \
  12475. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12476. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12477. } while (0)
  12478. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12479. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12480. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12481. do { \
  12482. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12483. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12484. } while (0)
  12485. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12486. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12487. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12488. do { \
  12489. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12490. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12491. } while (0)
  12492. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12493. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12494. /**
  12495. * @brief target -> host TX completion indication message definition
  12496. *
  12497. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12498. *
  12499. * @details
  12500. * The following diagram shows the format of the TX completion indication sent
  12501. * from the target to the host
  12502. *
  12503. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12504. * |-------------------------------------------------------------------|
  12505. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12506. * |-------------------------------------------------------------------|
  12507. * payload:| MSDU1 ID | MSDU0 ID |
  12508. * |-------------------------------------------------------------------|
  12509. * : MSDU3 ID | MSDU2 ID :
  12510. * |-------------------------------------------------------------------|
  12511. * | struct htt_tx_compl_ind_append_retries |
  12512. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12513. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12514. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12515. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12516. * |-------------------------------------------------------------------|
  12517. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12518. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12519. * | MSDU0 tx_tsf64_low |
  12520. * |-------------------------------------------------------------------|
  12521. * | MSDU0 tx_tsf64_high |
  12522. * |-------------------------------------------------------------------|
  12523. * | MSDU1 tx_tsf64_low |
  12524. * |-------------------------------------------------------------------|
  12525. * | MSDU1 tx_tsf64_high |
  12526. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12527. * | phy_timestamp |
  12528. * |-------------------------------------------------------------------|
  12529. * | rate specs (see below) |
  12530. * |-------------------------------------------------------------------|
  12531. * | seqctrl | framectrl |
  12532. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12533. * Where:
  12534. * A0 = append (a.k.a. append0)
  12535. * A1 = append1
  12536. * TP = MSDU tx power presence
  12537. * A2 = append2
  12538. * A3 = append3
  12539. * A4 = append4
  12540. *
  12541. * The following field definitions describe the format of the TX completion
  12542. * indication sent from the target to the host
  12543. * Header fields:
  12544. * - msg_type
  12545. * Bits 7:0
  12546. * Purpose: identifies this as HTT TX completion indication
  12547. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12548. * - status
  12549. * Bits 10:8
  12550. * Purpose: the TX completion status of payload fragmentations descriptors
  12551. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12552. * - tid
  12553. * Bits 14:11
  12554. * Purpose: the tid associated with those fragmentation descriptors. It is
  12555. * valid or not, depending on the tid_invalid bit.
  12556. * Value: 0 to 15
  12557. * - tid_invalid
  12558. * Bits 15:15
  12559. * Purpose: this bit indicates whether the tid field is valid or not
  12560. * Value: 0 indicates valid; 1 indicates invalid
  12561. * - num
  12562. * Bits 23:16
  12563. * Purpose: the number of payload in this indication
  12564. * Value: 1 to 255
  12565. * - append (a.k.a. append0)
  12566. * Bits 24:24
  12567. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12568. * the number of tx retries for one MSDU at the end of this message
  12569. * Value: 0 indicates no appending; 1 indicates appending
  12570. * - append1
  12571. * Bits 25:25
  12572. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12573. * contains the timestamp info for each TX msdu id in payload.
  12574. * The order of the timestamps matches the order of the MSDU IDs.
  12575. * Note that a big-endian host needs to account for the reordering
  12576. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12577. * conversion) when determining which tx timestamp corresponds to
  12578. * which MSDU ID.
  12579. * Value: 0 indicates no appending; 1 indicates appending
  12580. * - msdu_tx_power_presence
  12581. * Bits 26:26
  12582. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12583. * for each MSDU referenced by the TX_COMPL_IND message.
  12584. * The tx power is reported in 0.5 dBm units.
  12585. * The order of the per-MSDU tx power reports matches the order
  12586. * of the MSDU IDs.
  12587. * Note that a big-endian host needs to account for the reordering
  12588. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12589. * conversion) when determining which Tx Power corresponds to
  12590. * which MSDU ID.
  12591. * Value: 0 indicates MSDU tx power reports are not appended,
  12592. * 1 indicates MSDU tx power reports are appended
  12593. * - append2
  12594. * Bits 27:27
  12595. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12596. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12597. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12598. * same for all MSDUs within a single PPDU, the RSSI is duplicated
  12599. * for each MSDU, for convenience.
  12600. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12601. * this append2 bit is set).
  12602. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12603. * dB above the noise floor.
  12604. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12605. * 1 indicates MSDU ACK RSSI values are appended.
  12606. * - append3
  12607. * Bits 28:28
  12608. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12609. * contains the tx tsf info based on wlan global TSF for
  12610. * each TX msdu id in payload.
  12611. * The order of the tx tsf matches the order of the MSDU IDs.
  12612. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12613. * values to indicate the the lower 32 bits and higher 32 bits of
  12614. * the tx tsf.
  12615. * The tx_tsf64 here represents the time MSDU was acked and the
  12616. * tx_tsf64 has microseconds units.
  12617. * Value: 0 indicates no appending; 1 indicates appending
  12618. * - append4
  12619. * Bits 29:29
  12620. * Purpose: Indicate whether data frame control fields and fields required
  12621. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12622. * message. The order of the this message matches the order of
  12623. * the MSDU IDs.
  12624. * Value: 0 indicates frame control fields and fields required for
  12625. * radio tap header values are not appended,
  12626. * 1 indicates frame control fields and fields required for
  12627. * radio tap header values are appended.
  12628. * Payload fields:
  12629. * - hmsdu_id
  12630. * Bits 15:0
  12631. * Purpose: this ID is used to track the Tx buffer in host
  12632. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12633. */
  12634. PREPACK struct htt_tx_data_hdr_information {
  12635. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12636. A_UINT32 /* word 1 */
  12637. /* preamble:
  12638. * 0-OFDM,
  12639. * 1-CCk,
  12640. * 2-HT,
  12641. * 3-VHT
  12642. */
  12643. preamble: 2, /* [1:0] */
  12644. /* mcs:
  12645. * In case of HT preamble interpret
  12646. * MCS along with NSS.
  12647. * Valid values for HT are 0 to 7.
  12648. * HT mcs 0 with NSS 2 is mcs 8.
  12649. * Valid values for VHT are 0 to 9.
  12650. */
  12651. mcs: 4, /* [5:2] */
  12652. /* rate:
  12653. * This is applicable only for
  12654. * CCK and OFDM preamble type
  12655. * rate 0: OFDM 48 Mbps,
  12656. * 1: OFDM 24 Mbps,
  12657. * 2: OFDM 12 Mbps
  12658. * 3: OFDM 6 Mbps
  12659. * 4: OFDM 54 Mbps
  12660. * 5: OFDM 36 Mbps
  12661. * 6: OFDM 18 Mbps
  12662. * 7: OFDM 9 Mbps
  12663. * rate 0: CCK 11 Mbps Long
  12664. * 1: CCK 5.5 Mbps Long
  12665. * 2: CCK 2 Mbps Long
  12666. * 3: CCK 1 Mbps Long
  12667. * 4: CCK 11 Mbps Short
  12668. * 5: CCK 5.5 Mbps Short
  12669. * 6: CCK 2 Mbps Short
  12670. */
  12671. rate : 3, /* [ 8: 6] */
  12672. rssi : 8, /* [16: 9] units=dBm */
  12673. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12674. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12675. stbc : 1, /* [22] */
  12676. sgi : 1, /* [23] */
  12677. ldpc : 1, /* [24] */
  12678. beamformed: 1, /* [25] */
  12679. /* tx_retry_cnt:
  12680. * Indicates retry count of data tx frames provided by the host.
  12681. */
  12682. tx_retry_cnt: 6; /* [31:26] */
  12683. A_UINT32 /* word 2 */
  12684. framectrl:16, /* [15: 0] */
  12685. seqno:16; /* [31:16] */
  12686. } POSTPACK;
  12687. #define HTT_TX_COMPL_IND_STATUS_S 8
  12688. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12689. #define HTT_TX_COMPL_IND_TID_S 11
  12690. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12691. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12692. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12693. #define HTT_TX_COMPL_IND_NUM_S 16
  12694. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12695. #define HTT_TX_COMPL_IND_APPEND_S 24
  12696. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12697. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12698. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12699. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12700. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12701. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12702. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12703. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12704. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12705. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12706. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12707. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12708. do { \
  12709. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12710. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12711. } while (0)
  12712. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12713. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12714. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12715. do { \
  12716. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12717. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12718. } while (0)
  12719. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12720. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12721. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12722. do { \
  12723. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12724. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12725. } while (0)
  12726. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12727. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12728. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12729. do { \
  12730. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12731. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12732. } while (0)
  12733. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12734. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12735. HTT_TX_COMPL_IND_TID_INV_S)
  12736. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12737. do { \
  12738. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12739. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12740. } while (0)
  12741. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12742. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12743. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12744. do { \
  12745. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12746. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12747. } while (0)
  12748. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12749. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12750. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12751. do { \
  12752. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12753. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12754. } while (0)
  12755. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12756. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12757. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12758. do { \
  12759. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12760. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12761. } while (0)
  12762. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12763. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12764. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12765. do { \
  12766. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12767. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12768. } while (0)
  12769. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12770. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12771. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12772. do { \
  12773. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12774. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12775. } while (0)
  12776. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12777. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12778. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12779. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12780. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12781. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12782. #define HTT_TX_COMPL_IND_STAT_OK 0
  12783. /* DISCARD:
  12784. * current meaning:
  12785. * MSDUs were queued for transmission but filtered by HW or SW
  12786. * without any over the air attempts
  12787. * legacy meaning (HL Rome):
  12788. * MSDUs were discarded by the target FW without any over the air
  12789. * attempts due to lack of space
  12790. */
  12791. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12792. /* NO_ACK:
  12793. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12794. */
  12795. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12796. /* POSTPONE:
  12797. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12798. * be downloaded again later (in the appropriate order), when they are
  12799. * deliverable.
  12800. */
  12801. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12802. /*
  12803. * The PEER_DEL tx completion status is used for HL cases
  12804. * where the peer the frame is for has been deleted.
  12805. * The host has already discarded its copy of the frame, but
  12806. * it still needs the tx completion to restore its credit.
  12807. */
  12808. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12809. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12810. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12811. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12812. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12813. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12814. PREPACK struct htt_tx_compl_ind_base {
  12815. A_UINT32 hdr;
  12816. A_UINT16 payload[1/*or more*/];
  12817. } POSTPACK;
  12818. PREPACK struct htt_tx_compl_ind_append_retries {
  12819. A_UINT16 msdu_id;
  12820. A_UINT8 tx_retries;
  12821. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12822. 0: this is the last append_retries struct */
  12823. } POSTPACK;
  12824. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12825. A_UINT32 timestamp[1/*or more*/];
  12826. } POSTPACK;
  12827. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12828. A_UINT32 tx_tsf64_low;
  12829. A_UINT32 tx_tsf64_high;
  12830. } POSTPACK;
  12831. /* htt_tx_data_hdr_information payload extension fields: */
  12832. /* DWORD zero */
  12833. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12834. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12835. /* DWORD one */
  12836. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12837. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12838. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12839. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12840. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12841. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12842. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12843. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12844. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12845. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12846. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12847. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12848. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12849. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12850. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12851. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12852. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12853. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12854. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12855. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12856. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12857. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12858. /* DWORD two */
  12859. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12860. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12861. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12862. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12863. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12864. do { \
  12865. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12866. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12867. } while (0)
  12868. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12869. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12870. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12871. do { \
  12872. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12873. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12874. } while (0)
  12875. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12876. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12877. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12878. do { \
  12879. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12880. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12881. } while (0)
  12882. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12883. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12884. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12885. do { \
  12886. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12887. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12888. } while (0)
  12889. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12890. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12891. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12892. do { \
  12893. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12894. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12895. } while (0)
  12896. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12897. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12898. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12899. do { \
  12900. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12901. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12902. } while (0)
  12903. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12904. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12905. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12906. do { \
  12907. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12908. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12909. } while (0)
  12910. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12911. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12912. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12913. do { \
  12914. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12915. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12916. } while (0)
  12917. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12918. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12919. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12920. do { \
  12921. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12922. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12923. } while (0)
  12924. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12925. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12926. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12927. do { \
  12928. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12929. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12930. } while (0)
  12931. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12932. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12933. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12934. do { \
  12935. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12936. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12937. } while (0)
  12938. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12939. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12940. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12941. do { \
  12942. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12943. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12944. } while (0)
  12945. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12946. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12947. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12948. do { \
  12949. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12950. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12951. } while (0)
  12952. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12953. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12954. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12955. do { \
  12956. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12957. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12958. } while (0)
  12959. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12960. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12961. /**
  12962. * @brief target -> host rate-control update indication message
  12963. *
  12964. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12965. *
  12966. * @details
  12967. * The following diagram shows the format of the RC Update message
  12968. * sent from the target to the host, while processing the tx-completion
  12969. * of a transmitted PPDU.
  12970. *
  12971. * |31 24|23 16|15 8|7 0|
  12972. * |-------------------------------------------------------------|
  12973. * | peer ID | vdev ID | msg_type |
  12974. * |-------------------------------------------------------------|
  12975. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12976. * |-------------------------------------------------------------|
  12977. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12978. * |-------------------------------------------------------------|
  12979. * | : |
  12980. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12981. * | : |
  12982. * |-------------------------------------------------------------|
  12983. * | : |
  12984. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12985. * | : |
  12986. * |-------------------------------------------------------------|
  12987. * : :
  12988. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12989. *
  12990. */
  12991. typedef struct {
  12992. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12993. A_UINT32 rate_code_flags;
  12994. A_UINT32 flags; /* Encodes information such as excessive
  12995. retransmission, aggregate, some info
  12996. from .11 frame control,
  12997. STBC, LDPC, (SGI and Tx Chain Mask
  12998. are encoded in ptx_rc->flags field),
  12999. AMPDU truncation (BT/time based etc.),
  13000. RTS/CTS attempt */
  13001. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  13002. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  13003. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  13004. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  13005. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  13006. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  13007. } HTT_RC_TX_DONE_PARAMS;
  13008. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  13009. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  13010. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  13011. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  13012. #define HTT_RC_UPDATE_VDEVID_S 8
  13013. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  13014. #define HTT_RC_UPDATE_PEERID_S 16
  13015. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  13016. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  13017. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  13018. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  13019. do { \
  13020. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  13021. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  13022. } while (0)
  13023. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  13024. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  13025. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  13026. do { \
  13027. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  13028. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  13029. } while (0)
  13030. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  13031. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  13032. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  13033. do { \
  13034. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  13035. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  13036. } while (0)
  13037. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  13038. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  13039. /**
  13040. * @brief target -> host rx fragment indication message definition
  13041. *
  13042. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  13043. *
  13044. * @details
  13045. * The following field definitions describe the format of the rx fragment
  13046. * indication message sent from the target to the host.
  13047. * The rx fragment indication message shares the format of the
  13048. * rx indication message, but not all fields from the rx indication message
  13049. * are relevant to the rx fragment indication message.
  13050. *
  13051. *
  13052. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  13053. * |-----------+-------------------+---------------------+-------------|
  13054. * | peer ID | |FV| ext TID | msg type |
  13055. * |-------------------------------------------------------------------|
  13056. * | | flush | flush |
  13057. * | | end | start |
  13058. * | | seq num | seq num |
  13059. * |-------------------------------------------------------------------|
  13060. * | reserved | FW rx desc bytes |
  13061. * |-------------------------------------------------------------------|
  13062. * | | FW MSDU Rx |
  13063. * | | desc B0 |
  13064. * |-------------------------------------------------------------------|
  13065. * Header fields:
  13066. * - MSG_TYPE
  13067. * Bits 7:0
  13068. * Purpose: identifies this as an rx fragment indication message
  13069. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  13070. * - EXT_TID
  13071. * Bits 12:8
  13072. * Purpose: identify the traffic ID of the rx data, including
  13073. * special "extended" TID values for multicast, broadcast, and
  13074. * non-QoS data frames
  13075. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  13076. * - FLUSH_VALID (FV)
  13077. * Bit 13
  13078. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  13079. * is valid
  13080. * Value:
  13081. * 1 -> flush IE is valid and needs to be processed
  13082. * 0 -> flush IE is not valid and should be ignored
  13083. * - PEER_ID
  13084. * Bits 31:16
  13085. * Purpose: Identify, by ID, which peer sent the rx data
  13086. * Value: ID of the peer who sent the rx data
  13087. * - FLUSH_SEQ_NUM_START
  13088. * Bits 5:0
  13089. * Purpose: Indicate the start of a series of MPDUs to flush
  13090. * Not all MPDUs within this series are necessarily valid - the host
  13091. * must check each sequence number within this range to see if the
  13092. * corresponding MPDU is actually present.
  13093. * This field is only valid if the FV bit is set.
  13094. * Value:
  13095. * The sequence number for the first MPDUs to check to flush.
  13096. * The sequence number is masked by 0x3f.
  13097. * - FLUSH_SEQ_NUM_END
  13098. * Bits 11:6
  13099. * Purpose: Indicate the end of a series of MPDUs to flush
  13100. * Value:
  13101. * The sequence number one larger than the sequence number of the
  13102. * last MPDU to check to flush.
  13103. * The sequence number is masked by 0x3f.
  13104. * Not all MPDUs within this series are necessarily valid - the host
  13105. * must check each sequence number within this range to see if the
  13106. * corresponding MPDU is actually present.
  13107. * This field is only valid if the FV bit is set.
  13108. * Rx descriptor fields:
  13109. * - FW_RX_DESC_BYTES
  13110. * Bits 15:0
  13111. * Purpose: Indicate how many bytes in the Rx indication are used for
  13112. * FW Rx descriptors
  13113. * Value: 1
  13114. */
  13115. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  13116. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  13117. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  13118. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  13119. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  13120. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  13121. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  13122. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  13123. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  13124. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  13125. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  13126. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  13127. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  13128. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  13129. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  13130. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  13131. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  13132. #define HTT_RX_FRAG_IND_BYTES \
  13133. (4 /* msg hdr */ + \
  13134. 4 /* flush spec */ + \
  13135. 4 /* (unused) FW rx desc bytes spec */ + \
  13136. 4 /* FW rx desc */)
  13137. /**
  13138. * @brief target -> host test message definition
  13139. *
  13140. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  13141. *
  13142. * @details
  13143. * The following field definitions describe the format of the test
  13144. * message sent from the target to the host.
  13145. * The message consists of a 4-octet header, followed by a variable
  13146. * number of 32-bit integer values, followed by a variable number
  13147. * of 8-bit character values.
  13148. *
  13149. * |31 16|15 8|7 0|
  13150. * |-----------------------------------------------------------|
  13151. * | num chars | num ints | msg type |
  13152. * |-----------------------------------------------------------|
  13153. * | int 0 |
  13154. * |-----------------------------------------------------------|
  13155. * | int 1 |
  13156. * |-----------------------------------------------------------|
  13157. * | ... |
  13158. * |-----------------------------------------------------------|
  13159. * | char 3 | char 2 | char 1 | char 0 |
  13160. * |-----------------------------------------------------------|
  13161. * | | | ... | char 4 |
  13162. * |-----------------------------------------------------------|
  13163. * - MSG_TYPE
  13164. * Bits 7:0
  13165. * Purpose: identifies this as a test message
  13166. * Value: HTT_MSG_TYPE_TEST
  13167. * - NUM_INTS
  13168. * Bits 15:8
  13169. * Purpose: indicate how many 32-bit integers follow the message header
  13170. * - NUM_CHARS
  13171. * Bits 31:16
  13172. * Purpose: indicate how many 8-bit characters follow the series of integers
  13173. */
  13174. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  13175. #define HTT_RX_TEST_NUM_INTS_S 8
  13176. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  13177. #define HTT_RX_TEST_NUM_CHARS_S 16
  13178. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  13179. do { \
  13180. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  13181. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  13182. } while (0)
  13183. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  13184. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  13185. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  13186. do { \
  13187. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  13188. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  13189. } while (0)
  13190. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  13191. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  13192. /**
  13193. * @brief target -> host packet log message
  13194. *
  13195. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  13196. *
  13197. * @details
  13198. * The following field definitions describe the format of the packet log
  13199. * message sent from the target to the host.
  13200. * The message consists of a 4-octet header,followed by a variable number
  13201. * of 32-bit character values.
  13202. *
  13203. * |31 16|15 12|11 10|9 8|7 0|
  13204. * |------------------------------------------------------------------|
  13205. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  13206. * |------------------------------------------------------------------|
  13207. * | payload |
  13208. * |------------------------------------------------------------------|
  13209. * - MSG_TYPE
  13210. * Bits 7:0
  13211. * Purpose: identifies this as a pktlog message
  13212. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  13213. * - mac_id
  13214. * Bits 9:8
  13215. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  13216. * Value: 0-3
  13217. * - pdev_id
  13218. * Bits 11:10
  13219. * Purpose: pdev_id
  13220. * Value: 0-3
  13221. * 0 (for rings at SOC level),
  13222. * 1/2/3 PDEV -> 0/1/2
  13223. * - payload_size
  13224. * Bits 31:16
  13225. * Purpose: explicitly specify the payload size
  13226. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  13227. */
  13228. PREPACK struct htt_pktlog_msg {
  13229. A_UINT32 header;
  13230. A_UINT32 payload[1/* or more */];
  13231. } POSTPACK;
  13232. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  13233. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  13234. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  13235. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  13236. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  13237. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  13238. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  13239. do { \
  13240. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  13241. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  13242. } while (0)
  13243. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  13244. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  13245. HTT_T2H_PKTLOG_MAC_ID_S)
  13246. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  13247. do { \
  13248. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  13249. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  13250. } while (0)
  13251. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  13252. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  13253. HTT_T2H_PKTLOG_PDEV_ID_S)
  13254. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  13255. do { \
  13256. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  13257. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  13258. } while (0)
  13259. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  13260. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  13261. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  13262. /*
  13263. * Rx reorder statistics
  13264. * NB: all the fields must be defined in 4 octets size.
  13265. */
  13266. struct rx_reorder_stats {
  13267. /* Non QoS MPDUs received */
  13268. A_UINT32 deliver_non_qos;
  13269. /* MPDUs received in-order */
  13270. A_UINT32 deliver_in_order;
  13271. /* Flush due to reorder timer expired */
  13272. A_UINT32 deliver_flush_timeout;
  13273. /* Flush due to move out of window */
  13274. A_UINT32 deliver_flush_oow;
  13275. /* Flush due to DELBA */
  13276. A_UINT32 deliver_flush_delba;
  13277. /* MPDUs dropped due to FCS error */
  13278. A_UINT32 fcs_error;
  13279. /* MPDUs dropped due to monitor mode non-data packet */
  13280. A_UINT32 mgmt_ctrl;
  13281. /* Unicast-data MPDUs dropped due to invalid peer */
  13282. A_UINT32 invalid_peer;
  13283. /* MPDUs dropped due to duplication (non aggregation) */
  13284. A_UINT32 dup_non_aggr;
  13285. /* MPDUs dropped due to processed before */
  13286. A_UINT32 dup_past;
  13287. /* MPDUs dropped due to duplicate in reorder queue */
  13288. A_UINT32 dup_in_reorder;
  13289. /* Reorder timeout happened */
  13290. A_UINT32 reorder_timeout;
  13291. /* invalid bar ssn */
  13292. A_UINT32 invalid_bar_ssn;
  13293. /* reorder reset due to bar ssn */
  13294. A_UINT32 ssn_reset;
  13295. /* Flush due to delete peer */
  13296. A_UINT32 deliver_flush_delpeer;
  13297. /* Flush due to offload*/
  13298. A_UINT32 deliver_flush_offload;
  13299. /* Flush due to out of buffer*/
  13300. A_UINT32 deliver_flush_oob;
  13301. /* MPDUs dropped due to PN check fail */
  13302. A_UINT32 pn_fail;
  13303. /* MPDUs dropped due to unable to allocate memory */
  13304. A_UINT32 store_fail;
  13305. /* Number of times the tid pool alloc succeeded */
  13306. A_UINT32 tid_pool_alloc_succ;
  13307. /* Number of times the MPDU pool alloc succeeded */
  13308. A_UINT32 mpdu_pool_alloc_succ;
  13309. /* Number of times the MSDU pool alloc succeeded */
  13310. A_UINT32 msdu_pool_alloc_succ;
  13311. /* Number of times the tid pool alloc failed */
  13312. A_UINT32 tid_pool_alloc_fail;
  13313. /* Number of times the MPDU pool alloc failed */
  13314. A_UINT32 mpdu_pool_alloc_fail;
  13315. /* Number of times the MSDU pool alloc failed */
  13316. A_UINT32 msdu_pool_alloc_fail;
  13317. /* Number of times the tid pool freed */
  13318. A_UINT32 tid_pool_free;
  13319. /* Number of times the MPDU pool freed */
  13320. A_UINT32 mpdu_pool_free;
  13321. /* Number of times the MSDU pool freed */
  13322. A_UINT32 msdu_pool_free;
  13323. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  13324. A_UINT32 msdu_queued;
  13325. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  13326. A_UINT32 msdu_recycled;
  13327. /* Number of MPDUs with invalid peer but A2 found in AST */
  13328. A_UINT32 invalid_peer_a2_in_ast;
  13329. /* Number of MPDUs with invalid peer but A3 found in AST */
  13330. A_UINT32 invalid_peer_a3_in_ast;
  13331. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  13332. A_UINT32 invalid_peer_bmc_mpdus;
  13333. /* Number of MSDUs with err attention word */
  13334. A_UINT32 rxdesc_err_att;
  13335. /* Number of MSDUs with flag of peer_idx_invalid */
  13336. A_UINT32 rxdesc_err_peer_idx_inv;
  13337. /* Number of MSDUs with flag of peer_idx_timeout */
  13338. A_UINT32 rxdesc_err_peer_idx_to;
  13339. /* Number of MSDUs with flag of overflow */
  13340. A_UINT32 rxdesc_err_ov;
  13341. /* Number of MSDUs with flag of msdu_length_err */
  13342. A_UINT32 rxdesc_err_msdu_len;
  13343. /* Number of MSDUs with flag of mpdu_length_err */
  13344. A_UINT32 rxdesc_err_mpdu_len;
  13345. /* Number of MSDUs with flag of tkip_mic_err */
  13346. A_UINT32 rxdesc_err_tkip_mic;
  13347. /* Number of MSDUs with flag of decrypt_err */
  13348. A_UINT32 rxdesc_err_decrypt;
  13349. /* Number of MSDUs with flag of fcs_err */
  13350. A_UINT32 rxdesc_err_fcs;
  13351. /* Number of Unicast (bc_mc bit is not set in attention word)
  13352. * frames with invalid peer handler
  13353. */
  13354. A_UINT32 rxdesc_uc_msdus_inv_peer;
  13355. /* Number of unicast frame directly (direct bit is set in attention word)
  13356. * to DUT with invalid peer handler
  13357. */
  13358. A_UINT32 rxdesc_direct_msdus_inv_peer;
  13359. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  13360. * frames with invalid peer handler
  13361. */
  13362. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  13363. /* Number of MSDUs dropped due to no first MSDU flag */
  13364. A_UINT32 rxdesc_no_1st_msdu;
  13365. /* Number of MSDUs dropped due to ring overflow */
  13366. A_UINT32 msdu_drop_ring_ov;
  13367. /* Number of MSDUs dropped due to FC mismatch */
  13368. A_UINT32 msdu_drop_fc_mismatch;
  13369. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  13370. A_UINT32 msdu_drop_mgmt_remote_ring;
  13371. /* Number of MSDUs dropped due to errors not reported in attention word */
  13372. A_UINT32 msdu_drop_misc;
  13373. /* Number of MSDUs go to offload before reorder */
  13374. A_UINT32 offload_msdu_wal;
  13375. /* Number of data frame dropped by offload after reorder */
  13376. A_UINT32 offload_msdu_reorder;
  13377. /* Number of MPDUs with sequence number in the past and within the BA window */
  13378. A_UINT32 dup_past_within_window;
  13379. /* Number of MPDUs with sequence number in the past and outside the BA window */
  13380. A_UINT32 dup_past_outside_window;
  13381. /* Number of MSDUs with decrypt/MIC error */
  13382. A_UINT32 rxdesc_err_decrypt_mic;
  13383. /* Number of data MSDUs received on both local and remote rings */
  13384. A_UINT32 data_msdus_on_both_rings;
  13385. /* MPDUs never filled */
  13386. A_UINT32 holes_not_filled;
  13387. };
  13388. /*
  13389. * Rx Remote buffer statistics
  13390. * NB: all the fields must be defined in 4 octets size.
  13391. */
  13392. struct rx_remote_buffer_mgmt_stats {
  13393. /* Total number of MSDUs reaped for Rx processing */
  13394. A_UINT32 remote_reaped;
  13395. /* MSDUs recycled within firmware */
  13396. A_UINT32 remote_recycled;
  13397. /* MSDUs stored by Data Rx */
  13398. A_UINT32 data_rx_msdus_stored;
  13399. /* Number of HTT indications from WAL Rx MSDU */
  13400. A_UINT32 wal_rx_ind;
  13401. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  13402. A_UINT32 wal_rx_ind_unconsumed;
  13403. /* Number of HTT indications from Data Rx MSDU */
  13404. A_UINT32 data_rx_ind;
  13405. /* Number of unconsumed HTT indications from Data Rx MSDU */
  13406. A_UINT32 data_rx_ind_unconsumed;
  13407. /* Number of HTT indications from ATHBUF */
  13408. A_UINT32 athbuf_rx_ind;
  13409. /* Number of remote buffers requested for refill */
  13410. A_UINT32 refill_buf_req;
  13411. /* Number of remote buffers filled by the host */
  13412. A_UINT32 refill_buf_rsp;
  13413. /* Number of times MAC hw_index = f/w write_index */
  13414. A_INT32 mac_no_bufs;
  13415. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  13416. A_INT32 fw_indices_equal;
  13417. /* Number of times f/w finds no buffers to post */
  13418. A_INT32 host_no_bufs;
  13419. };
  13420. /*
  13421. * TXBF MU/SU packets and NDPA statistics
  13422. * NB: all the fields must be defined in 4 octets size.
  13423. */
  13424. struct rx_txbf_musu_ndpa_pkts_stats {
  13425. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  13426. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  13427. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  13428. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  13429. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  13430. A_UINT32 reserved[3]; /* must be set to 0x0 */
  13431. };
  13432. /*
  13433. * htt_dbg_stats_status -
  13434. * present - The requested stats have been delivered in full.
  13435. * This indicates that either the stats information was contained
  13436. * in its entirety within this message, or else this message
  13437. * completes the delivery of the requested stats info that was
  13438. * partially delivered through earlier STATS_CONF messages.
  13439. * partial - The requested stats have been delivered in part.
  13440. * One or more subsequent STATS_CONF messages with the same
  13441. * cookie value will be sent to deliver the remainder of the
  13442. * information.
  13443. * error - The requested stats could not be delivered, for example due
  13444. * to a shortage of memory to construct a message holding the
  13445. * requested stats.
  13446. * invalid - The requested stat type is either not recognized, or the
  13447. * target is configured to not gather the stats type in question.
  13448. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  13449. * series_done - This special value indicates that no further stats info
  13450. * elements are present within a series of stats info elems
  13451. * (within a stats upload confirmation message).
  13452. */
  13453. enum htt_dbg_stats_status {
  13454. HTT_DBG_STATS_STATUS_PRESENT = 0,
  13455. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  13456. HTT_DBG_STATS_STATUS_ERROR = 2,
  13457. HTT_DBG_STATS_STATUS_INVALID = 3,
  13458. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13459. };
  13460. /**
  13461. * @brief target -> host statistics upload
  13462. *
  13463. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13464. *
  13465. * @details
  13466. * The following field definitions describe the format of the HTT target
  13467. * to host stats upload confirmation message.
  13468. * The message contains a cookie echoed from the HTT host->target stats
  13469. * upload request, which identifies which request the confirmation is
  13470. * for, and a series of tag-length-value stats information elements.
  13471. * The tag-length header for each stats info element also includes a
  13472. * status field, to indicate whether the request for the stat type in
  13473. * question was fully met, partially met, unable to be met, or invalid
  13474. * (if the stat type in question is disabled in the target).
  13475. * A special value of all 1's in this status field is used to indicate
  13476. * the end of the series of stats info elements.
  13477. *
  13478. *
  13479. * |31 16|15 8|7 5|4 0|
  13480. * |------------------------------------------------------------|
  13481. * | reserved | msg type |
  13482. * |------------------------------------------------------------|
  13483. * | cookie LSBs |
  13484. * |------------------------------------------------------------|
  13485. * | cookie MSBs |
  13486. * |------------------------------------------------------------|
  13487. * | stats entry length | reserved | S |stat type|
  13488. * |------------------------------------------------------------|
  13489. * | |
  13490. * | type-specific stats info |
  13491. * | |
  13492. * |------------------------------------------------------------|
  13493. * | stats entry length | reserved | S |stat type|
  13494. * |------------------------------------------------------------|
  13495. * | |
  13496. * | type-specific stats info |
  13497. * | |
  13498. * |------------------------------------------------------------|
  13499. * | n/a | reserved | 111 | n/a |
  13500. * |------------------------------------------------------------|
  13501. * Header fields:
  13502. * - MSG_TYPE
  13503. * Bits 7:0
  13504. * Purpose: identifies this is a statistics upload confirmation message
  13505. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13506. * - COOKIE_LSBS
  13507. * Bits 31:0
  13508. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13509. * message with its preceding host->target stats request message.
  13510. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13511. * - COOKIE_MSBS
  13512. * Bits 31:0
  13513. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13514. * message with its preceding host->target stats request message.
  13515. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13516. *
  13517. * Stats Information Element tag-length header fields:
  13518. * - STAT_TYPE
  13519. * Bits 4:0
  13520. * Purpose: identifies the type of statistics info held in the
  13521. * following information element
  13522. * Value: htt_dbg_stats_type
  13523. * - STATUS
  13524. * Bits 7:5
  13525. * Purpose: indicate whether the requested stats are present
  13526. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13527. * the completion of the stats entry series
  13528. * - LENGTH
  13529. * Bits 31:16
  13530. * Purpose: indicate the stats information size
  13531. * Value: This field specifies the number of bytes of stats information
  13532. * that follows the element tag-length header.
  13533. * It is expected but not required that this length is a multiple of
  13534. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13535. * subsequent stats entry header will begin on a 4-byte aligned
  13536. * boundary.
  13537. */
  13538. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13539. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13540. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13541. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13542. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13543. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13544. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13545. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13546. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13547. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13548. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13549. do { \
  13550. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13551. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13552. } while (0)
  13553. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13554. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13555. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13556. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13557. do { \
  13558. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13559. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13560. } while (0)
  13561. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13562. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13563. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13564. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13565. do { \
  13566. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13567. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13568. } while (0)
  13569. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13570. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13571. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13572. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13573. #define HTT_MAX_AGGR 64
  13574. #define HTT_HL_MAX_AGGR 18
  13575. /**
  13576. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13577. *
  13578. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13579. *
  13580. * @details
  13581. * The following field definitions describe the format of the HTT host
  13582. * to target frag_desc/msdu_ext bank configuration message.
  13583. * The message contains the based address and the min and max id of the
  13584. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13585. * MSDU_EXT/FRAG_DESC.
  13586. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13587. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13588. * the hardware does the mapping/translation.
  13589. *
  13590. * Total banks that can be configured is configured to 16.
  13591. *
  13592. * This should be called before any TX has be initiated by the HTT
  13593. *
  13594. * |31 16|15 8|7 5|4 0|
  13595. * |------------------------------------------------------------|
  13596. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13597. * |------------------------------------------------------------|
  13598. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13599. #if HTT_PADDR64
  13600. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13601. #endif
  13602. * |------------------------------------------------------------|
  13603. * | ... |
  13604. * |------------------------------------------------------------|
  13605. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13606. #if HTT_PADDR64
  13607. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13608. #endif
  13609. * |------------------------------------------------------------|
  13610. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13611. * |------------------------------------------------------------|
  13612. * | ... |
  13613. * |------------------------------------------------------------|
  13614. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13615. * |------------------------------------------------------------|
  13616. * Header fields:
  13617. * - MSG_TYPE
  13618. * Bits 7:0
  13619. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13620. * for systems with 64-bit format for bus addresses:
  13621. * - BANKx_BASE_ADDRESS_LO
  13622. * Bits 31:0
  13623. * Purpose: Provide a mechanism to specify the base address of the
  13624. * MSDU_EXT bank physical/bus address.
  13625. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13626. * - BANKx_BASE_ADDRESS_HI
  13627. * Bits 31:0
  13628. * Purpose: Provide a mechanism to specify the base address of the
  13629. * MSDU_EXT bank physical/bus address.
  13630. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13631. * for systems with 32-bit format for bus addresses:
  13632. * - BANKx_BASE_ADDRESS
  13633. * Bits 31:0
  13634. * Purpose: Provide a mechanism to specify the base address of the
  13635. * MSDU_EXT bank physical/bus address.
  13636. * Value: MSDU_EXT bank physical / bus address
  13637. * - BANKx_MIN_ID
  13638. * Bits 15:0
  13639. * Purpose: Provide a mechanism to specify the min index that needs to
  13640. * mapped.
  13641. * - BANKx_MAX_ID
  13642. * Bits 31:16
  13643. * Purpose: Provide a mechanism to specify the max index that needs to
  13644. * mapped.
  13645. *
  13646. */
  13647. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13648. * safe value.
  13649. * @note MAX supported banks is 16.
  13650. */
  13651. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13652. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13653. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13654. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13655. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13656. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13657. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13658. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13659. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13660. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13661. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13662. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13663. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13664. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13665. do { \
  13666. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13667. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13668. } while (0)
  13669. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13670. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13671. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13672. do { \
  13673. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13674. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13675. } while (0)
  13676. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13677. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13678. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13679. do { \
  13680. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13681. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13682. } while (0)
  13683. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13684. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13685. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13686. do { \
  13687. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13688. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13689. } while (0)
  13690. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13691. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13692. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13693. do { \
  13694. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13695. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13696. } while (0)
  13697. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13698. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13699. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13700. do { \
  13701. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13702. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13703. } while (0)
  13704. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13705. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13706. /*
  13707. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13708. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13709. * addresses are stored in a XXX-bit field.
  13710. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13711. * htt_tx_frag_desc64_bank_cfg_t structs.
  13712. */
  13713. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13714. _paddr_bits_, \
  13715. _paddr__bank_base_address_) \
  13716. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13717. /** word 0 \
  13718. * msg_type: 8, \
  13719. * pdev_id: 2, \
  13720. * swap: 1, \
  13721. * reserved0: 5, \
  13722. * num_banks: 8, \
  13723. * desc_size: 8; \
  13724. */ \
  13725. A_UINT32 word0; \
  13726. /* \
  13727. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13728. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13729. * the second A_UINT32). \
  13730. */ \
  13731. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13732. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13733. } POSTPACK
  13734. /* define htt_tx_frag_desc32_bank_cfg_t */
  13735. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13736. /* define htt_tx_frag_desc64_bank_cfg_t */
  13737. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13738. /*
  13739. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13740. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13741. */
  13742. #if HTT_PADDR64
  13743. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13744. #else
  13745. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13746. #endif
  13747. /**
  13748. * @brief target -> host HTT TX Credit total count update message definition
  13749. *
  13750. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13751. *
  13752. *|31 16|15|14 9| 8 |7 0 |
  13753. *|---------------------+--+----------+-------+----------|
  13754. *|cur htt credit delta | Q| reserved | sign | msg type |
  13755. *|------------------------------------------------------|
  13756. *
  13757. * Header fields:
  13758. * - MSG_TYPE
  13759. * Bits 7:0
  13760. * Purpose: identifies this as a htt tx credit delta update message
  13761. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13762. * - SIGN
  13763. * Bits 8
  13764. * identifies whether credit delta is positive or negative
  13765. * Value:
  13766. * - 0x0: credit delta is positive, rebalance in some buffers
  13767. * - 0x1: credit delta is negative, rebalance out some buffers
  13768. * - reserved
  13769. * Bits 14:9
  13770. * Value: 0x0
  13771. * - TXQ_GRP
  13772. * Bit 15
  13773. * Purpose: indicates whether any tx queue group information elements
  13774. * are appended to the tx credit update message
  13775. * Value: 0 -> no tx queue group information element is present
  13776. * 1 -> a tx queue group information element immediately follows
  13777. * - DELTA_COUNT
  13778. * Bits 31:16
  13779. * Purpose: Specify current htt credit delta absolute count
  13780. */
  13781. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13782. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13783. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13784. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13785. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13786. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13787. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13788. do { \
  13789. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13790. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13791. } while (0)
  13792. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13793. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13794. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13795. do { \
  13796. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13797. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13798. } while (0)
  13799. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13800. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13801. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13802. do { \
  13803. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13804. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13805. } while (0)
  13806. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13807. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13808. #define HTT_TX_CREDIT_MSG_BYTES 4
  13809. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13810. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13811. /**
  13812. * @brief HTT WDI_IPA Operation Response Message
  13813. *
  13814. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13815. *
  13816. * @details
  13817. * HTT WDI_IPA Operation Response message is sent by target
  13818. * to host confirming suspend or resume operation.
  13819. * |31 24|23 16|15 8|7 0|
  13820. * |----------------+----------------+----------------+----------------|
  13821. * | op_code | Rsvd | msg_type |
  13822. * |-------------------------------------------------------------------|
  13823. * | Rsvd | Response len |
  13824. * |-------------------------------------------------------------------|
  13825. * | |
  13826. * | Response-type specific info |
  13827. * | |
  13828. * | |
  13829. * |-------------------------------------------------------------------|
  13830. * Header fields:
  13831. * - MSG_TYPE
  13832. * Bits 7:0
  13833. * Purpose: Identifies this as WDI_IPA Operation Response message
  13834. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13835. * - OP_CODE
  13836. * Bits 31:16
  13837. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13838. * value: = enum htt_wdi_ipa_op_code
  13839. * - RSP_LEN
  13840. * Bits 16:0
  13841. * Purpose: length for the response-type specific info
  13842. * value: = length in bytes for response-type specific info
  13843. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13844. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13845. */
  13846. PREPACK struct htt_wdi_ipa_op_response_t
  13847. {
  13848. /* DWORD 0: flags and meta-data */
  13849. A_UINT32
  13850. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13851. reserved1: 8,
  13852. op_code: 16;
  13853. A_UINT32
  13854. rsp_len: 16,
  13855. reserved2: 16;
  13856. } POSTPACK;
  13857. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13858. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13859. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13860. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13861. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13862. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13863. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13864. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13865. do { \
  13866. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13867. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13868. } while (0)
  13869. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13870. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13871. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13872. do { \
  13873. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13874. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13875. } while (0)
  13876. enum htt_phy_mode {
  13877. htt_phy_mode_11a = 0,
  13878. htt_phy_mode_11g = 1,
  13879. htt_phy_mode_11b = 2,
  13880. htt_phy_mode_11g_only = 3,
  13881. htt_phy_mode_11na_ht20 = 4,
  13882. htt_phy_mode_11ng_ht20 = 5,
  13883. htt_phy_mode_11na_ht40 = 6,
  13884. htt_phy_mode_11ng_ht40 = 7,
  13885. htt_phy_mode_11ac_vht20 = 8,
  13886. htt_phy_mode_11ac_vht40 = 9,
  13887. htt_phy_mode_11ac_vht80 = 10,
  13888. htt_phy_mode_11ac_vht20_2g = 11,
  13889. htt_phy_mode_11ac_vht40_2g = 12,
  13890. htt_phy_mode_11ac_vht80_2g = 13,
  13891. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13892. htt_phy_mode_11ac_vht160 = 15,
  13893. htt_phy_mode_max,
  13894. };
  13895. /**
  13896. * @brief target -> host HTT channel change indication
  13897. *
  13898. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13899. *
  13900. * @details
  13901. * Specify when a channel change occurs.
  13902. * This allows the host to precisely determine which rx frames arrived
  13903. * on the old channel and which rx frames arrived on the new channel.
  13904. *
  13905. *|31 |7 0 |
  13906. *|-------------------------------------------+----------|
  13907. *| reserved | msg type |
  13908. *|------------------------------------------------------|
  13909. *| primary_chan_center_freq_mhz |
  13910. *|------------------------------------------------------|
  13911. *| contiguous_chan1_center_freq_mhz |
  13912. *|------------------------------------------------------|
  13913. *| contiguous_chan2_center_freq_mhz |
  13914. *|------------------------------------------------------|
  13915. *| phy_mode |
  13916. *|------------------------------------------------------|
  13917. *
  13918. * Header fields:
  13919. * - MSG_TYPE
  13920. * Bits 7:0
  13921. * Purpose: identifies this as a htt channel change indication message
  13922. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13923. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13924. * Bits 31:0
  13925. * Purpose: identify the (center of the) new 20 MHz primary channel
  13926. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13927. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13928. * Bits 31:0
  13929. * Purpose: identify the (center of the) contiguous frequency range
  13930. * comprising the new channel.
  13931. * For example, if the new channel is a 80 MHz channel extending
  13932. * 60 MHz beyond the primary channel, this field would be 30 larger
  13933. * than the primary channel center frequency field.
  13934. * Value: center frequency of the contiguous frequency range comprising
  13935. * the full channel in MHz units
  13936. * (80+80 channels also use the CONTIG_CHAN2 field)
  13937. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13938. * Bits 31:0
  13939. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13940. * within a VHT 80+80 channel.
  13941. * This field is only relevant for VHT 80+80 channels.
  13942. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13943. * channel (arbitrary value for cases besides VHT 80+80)
  13944. * - PHY_MODE
  13945. * Bits 31:0
  13946. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13947. * and band
  13948. * Value: htt_phy_mode enum value
  13949. */
  13950. PREPACK struct htt_chan_change_t
  13951. {
  13952. /* DWORD 0: flags and meta-data */
  13953. A_UINT32
  13954. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13955. reserved1: 24;
  13956. A_UINT32 primary_chan_center_freq_mhz;
  13957. A_UINT32 contig_chan1_center_freq_mhz;
  13958. A_UINT32 contig_chan2_center_freq_mhz;
  13959. A_UINT32 phy_mode;
  13960. } POSTPACK;
  13961. /*
  13962. * Due to historical / backwards-compatibility reasons, maintain the
  13963. * below htt_chan_change_msg struct definition, which needs to be
  13964. * consistent with the above htt_chan_change_t struct definition
  13965. * (aside from the htt_chan_change_t definition including the msg_type
  13966. * dword within the message, and the htt_chan_change_msg only containing
  13967. * the payload of the message that follows the msg_type dword).
  13968. */
  13969. PREPACK struct htt_chan_change_msg {
  13970. A_UINT32 chan_mhz; /* frequency in mhz */
  13971. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13972. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13973. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13974. } POSTPACK;
  13975. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13976. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13977. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13978. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13979. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13980. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13981. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13982. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13983. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13984. do { \
  13985. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13986. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13987. } while (0)
  13988. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13989. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13990. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13991. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13992. do { \
  13993. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13994. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13995. } while (0)
  13996. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13997. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13998. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13999. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  14000. do { \
  14001. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  14002. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  14003. } while (0)
  14004. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  14005. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  14006. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  14007. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  14008. do { \
  14009. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  14010. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  14011. } while (0)
  14012. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  14013. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  14014. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  14015. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  14016. /**
  14017. * @brief rx offload packet error message
  14018. *
  14019. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  14020. *
  14021. * @details
  14022. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  14023. * of target payload like mic err.
  14024. *
  14025. * |31 24|23 16|15 8|7 0|
  14026. * |----------------+----------------+----------------+----------------|
  14027. * | tid | vdev_id | msg_sub_type | msg_type |
  14028. * |-------------------------------------------------------------------|
  14029. * : (sub-type dependent content) :
  14030. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14031. * Header fields:
  14032. * - msg_type
  14033. * Bits 7:0
  14034. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  14035. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  14036. * - msg_sub_type
  14037. * Bits 15:8
  14038. * Purpose: Identifies which type of rx error is reported by this message
  14039. * value: htt_rx_ofld_pkt_err_type
  14040. * - vdev_id
  14041. * Bits 23:16
  14042. * Purpose: Identifies which vdev received the erroneous rx frame
  14043. * value:
  14044. * - tid
  14045. * Bits 31:24
  14046. * Purpose: Identifies the traffic type of the rx frame
  14047. * value:
  14048. *
  14049. * - The payload fields used if the sub-type == MIC error are shown below.
  14050. * Note - MIC err is per MSDU, while PN is per MPDU.
  14051. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  14052. * with MIC err in A-MSDU case, so FW will send only one HTT message
  14053. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  14054. * instead of sending separate HTT messages for each wrong MSDU within
  14055. * the MPDU.
  14056. *
  14057. * |31 24|23 16|15 8|7 0|
  14058. * |----------------+----------------+----------------+----------------|
  14059. * | Rsvd | key_id | peer_id |
  14060. * |-------------------------------------------------------------------|
  14061. * | receiver MAC addr 31:0 |
  14062. * |-------------------------------------------------------------------|
  14063. * | Rsvd | receiver MAC addr 47:32 |
  14064. * |-------------------------------------------------------------------|
  14065. * | transmitter MAC addr 31:0 |
  14066. * |-------------------------------------------------------------------|
  14067. * | Rsvd | transmitter MAC addr 47:32 |
  14068. * |-------------------------------------------------------------------|
  14069. * | PN 31:0 |
  14070. * |-------------------------------------------------------------------|
  14071. * | Rsvd | PN 47:32 |
  14072. * |-------------------------------------------------------------------|
  14073. * - peer_id
  14074. * Bits 15:0
  14075. * Purpose: identifies which peer is frame is from
  14076. * value:
  14077. * - key_id
  14078. * Bits 23:16
  14079. * Purpose: identifies key_id of rx frame
  14080. * value:
  14081. * - RA_31_0 (receiver MAC addr 31:0)
  14082. * Bits 31:0
  14083. * Purpose: identifies by MAC address which vdev received the frame
  14084. * value: MAC address lower 4 bytes
  14085. * - RA_47_32 (receiver MAC addr 47:32)
  14086. * Bits 15:0
  14087. * Purpose: identifies by MAC address which vdev received the frame
  14088. * value: MAC address upper 2 bytes
  14089. * - TA_31_0 (transmitter MAC addr 31:0)
  14090. * Bits 31:0
  14091. * Purpose: identifies by MAC address which peer transmitted the frame
  14092. * value: MAC address lower 4 bytes
  14093. * - TA_47_32 (transmitter MAC addr 47:32)
  14094. * Bits 15:0
  14095. * Purpose: identifies by MAC address which peer transmitted the frame
  14096. * value: MAC address upper 2 bytes
  14097. * - PN_31_0
  14098. * Bits 31:0
  14099. * Purpose: Identifies pn of rx frame
  14100. * value: PN lower 4 bytes
  14101. * - PN_47_32
  14102. * Bits 15:0
  14103. * Purpose: Identifies pn of rx frame
  14104. * value:
  14105. * TKIP or CCMP: PN upper 2 bytes
  14106. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  14107. */
  14108. enum htt_rx_ofld_pkt_err_type {
  14109. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  14110. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  14111. };
  14112. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  14113. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  14114. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  14115. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  14116. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  14117. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  14118. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  14119. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  14120. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  14121. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  14122. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  14123. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  14124. do { \
  14125. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  14126. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  14127. } while (0)
  14128. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  14129. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  14130. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  14131. do { \
  14132. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  14133. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  14134. } while (0)
  14135. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  14136. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  14137. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  14138. do { \
  14139. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  14140. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  14141. } while (0)
  14142. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  14143. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  14144. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  14145. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  14146. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  14147. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  14148. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  14149. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  14150. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  14151. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  14152. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  14153. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  14154. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  14155. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  14156. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  14157. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  14158. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  14159. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  14160. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  14161. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  14162. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  14163. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  14164. do { \
  14165. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  14166. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  14167. } while (0)
  14168. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  14169. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  14170. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  14171. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  14172. do { \
  14173. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  14174. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  14175. } while (0)
  14176. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  14177. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  14178. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  14179. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  14180. do { \
  14181. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  14182. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  14183. } while (0)
  14184. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  14185. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  14186. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  14187. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  14188. do { \
  14189. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  14190. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  14191. } while (0)
  14192. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  14193. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  14194. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  14195. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  14196. do { \
  14197. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  14198. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  14199. } while (0)
  14200. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  14201. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  14202. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  14203. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  14204. do { \
  14205. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  14206. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  14207. } while (0)
  14208. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  14209. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  14210. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  14211. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  14212. do { \
  14213. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  14214. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  14215. } while (0)
  14216. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  14217. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  14218. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  14219. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  14220. do { \
  14221. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  14222. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  14223. } while (0)
  14224. /**
  14225. * @brief target -> host peer rate report message
  14226. *
  14227. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  14228. *
  14229. * @details
  14230. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  14231. * justified rate of all the peers.
  14232. *
  14233. * |31 24|23 16|15 8|7 0|
  14234. * |----------------+----------------+----------------+----------------|
  14235. * | peer_count | | msg_type |
  14236. * |-------------------------------------------------------------------|
  14237. * : Payload (variant number of peer rate report) :
  14238. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  14239. * Header fields:
  14240. * - msg_type
  14241. * Bits 7:0
  14242. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  14243. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  14244. * - reserved
  14245. * Bits 15:8
  14246. * Purpose:
  14247. * value:
  14248. * - peer_count
  14249. * Bits 31:16
  14250. * Purpose: Specify how many peer rate report elements are present in the payload.
  14251. * value:
  14252. *
  14253. * Payload:
  14254. * There are variant number of peer rate report follow the first 32 bits.
  14255. * The peer rate report is defined as follows.
  14256. *
  14257. * |31 20|19 16|15 0|
  14258. * |-----------------------+---------+---------------------------------|-
  14259. * | reserved | phy | peer_id | \
  14260. * |-------------------------------------------------------------------| -> report #0
  14261. * | rate | /
  14262. * |-----------------------+---------+---------------------------------|-
  14263. * | reserved | phy | peer_id | \
  14264. * |-------------------------------------------------------------------| -> report #1
  14265. * | rate | /
  14266. * |-----------------------+---------+---------------------------------|-
  14267. * | reserved | phy | peer_id | \
  14268. * |-------------------------------------------------------------------| -> report #2
  14269. * | rate | /
  14270. * |-------------------------------------------------------------------|-
  14271. * : :
  14272. * : :
  14273. * : :
  14274. * :-------------------------------------------------------------------:
  14275. *
  14276. * - peer_id
  14277. * Bits 15:0
  14278. * Purpose: identify the peer
  14279. * value:
  14280. * - phy
  14281. * Bits 19:16
  14282. * Purpose: identify which phy is in use
  14283. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  14284. * Please see enum htt_peer_report_phy_type for detail.
  14285. * - reserved
  14286. * Bits 31:20
  14287. * Purpose:
  14288. * value:
  14289. * - rate
  14290. * Bits 31:0
  14291. * Purpose: represent the justified rate of the peer specified by peer_id
  14292. * value:
  14293. */
  14294. enum htt_peer_rate_report_phy_type {
  14295. HTT_PEER_RATE_REPORT_11B = 0,
  14296. HTT_PEER_RATE_REPORT_11A_G,
  14297. HTT_PEER_RATE_REPORT_11N,
  14298. HTT_PEER_RATE_REPORT_11AC,
  14299. };
  14300. #define HTT_PEER_RATE_REPORT_SIZE 8
  14301. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  14302. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  14303. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  14304. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  14305. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  14306. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  14307. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  14308. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  14309. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  14310. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  14311. do { \
  14312. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  14313. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  14314. } while (0)
  14315. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  14316. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  14317. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  14318. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  14319. do { \
  14320. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  14321. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  14322. } while (0)
  14323. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  14324. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  14325. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  14326. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  14327. do { \
  14328. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  14329. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  14330. } while (0)
  14331. /**
  14332. * @brief target -> host flow pool map message
  14333. *
  14334. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  14335. *
  14336. * @details
  14337. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  14338. * a flow of descriptors.
  14339. *
  14340. * This message is in TLV format and indicates the parameters to be setup a
  14341. * flow in the host. Each entry indicates that a particular flow ID is ready to
  14342. * receive descriptors from a specified pool.
  14343. *
  14344. * The message would appear as follows:
  14345. *
  14346. * |31 24|23 16|15 8|7 0|
  14347. * |----------------+----------------+----------------+----------------|
  14348. * header | reserved | num_flows | msg_type |
  14349. * |-------------------------------------------------------------------|
  14350. * | |
  14351. * : payload :
  14352. * | |
  14353. * |-------------------------------------------------------------------|
  14354. *
  14355. * The header field is one DWORD long and is interpreted as follows:
  14356. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  14357. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  14358. * this message
  14359. * b'16-31 - reserved: These bits are reserved for future use
  14360. *
  14361. * Payload:
  14362. * The payload would contain multiple objects of the following structure. Each
  14363. * object represents a flow.
  14364. *
  14365. * |31 24|23 16|15 8|7 0|
  14366. * |----------------+----------------+----------------+----------------|
  14367. * header | reserved | num_flows | msg_type |
  14368. * |-------------------------------------------------------------------|
  14369. * payload0| flow_type |
  14370. * |-------------------------------------------------------------------|
  14371. * | flow_id |
  14372. * |-------------------------------------------------------------------|
  14373. * | reserved0 | flow_pool_id |
  14374. * |-------------------------------------------------------------------|
  14375. * | reserved1 | flow_pool_size |
  14376. * |-------------------------------------------------------------------|
  14377. * | reserved2 |
  14378. * |-------------------------------------------------------------------|
  14379. * payload1| flow_type |
  14380. * |-------------------------------------------------------------------|
  14381. * | flow_id |
  14382. * |-------------------------------------------------------------------|
  14383. * | reserved0 | flow_pool_id |
  14384. * |-------------------------------------------------------------------|
  14385. * | reserved1 | flow_pool_size |
  14386. * |-------------------------------------------------------------------|
  14387. * | reserved2 |
  14388. * |-------------------------------------------------------------------|
  14389. * | . |
  14390. * | . |
  14391. * | . |
  14392. * |-------------------------------------------------------------------|
  14393. *
  14394. * Each payload is 5 DWORDS long and is interpreted as follows:
  14395. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  14396. * this flow is associated. It can be VDEV, peer,
  14397. * or tid (AC). Based on enum htt_flow_type.
  14398. *
  14399. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14400. * object. For flow_type vdev it is set to the
  14401. * vdevid, for peer it is peerid and for tid, it is
  14402. * tid_num.
  14403. *
  14404. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  14405. * in the host for this flow
  14406. * b'16:31 - reserved0: This field in reserved for the future. In case
  14407. * we have a hierarchical implementation (HCM) of
  14408. * pools, it can be used to indicate the ID of the
  14409. * parent-pool.
  14410. *
  14411. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  14412. * Descriptors for this flow will be
  14413. * allocated from this pool in the host.
  14414. * b'16:31 - reserved1: This field in reserved for the future. In case
  14415. * we have a hierarchical implementation of pools,
  14416. * it can be used to indicate the max number of
  14417. * descriptors in the pool. The b'0:15 can be used
  14418. * to indicate min number of descriptors in the
  14419. * HCM scheme.
  14420. *
  14421. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  14422. * we have a hierarchical implementation of pools,
  14423. * b'0:15 can be used to indicate the
  14424. * priority-based borrowing (PBB) threshold of
  14425. * the flow's pool. The b'16:31 are still left
  14426. * reserved.
  14427. */
  14428. enum htt_flow_type {
  14429. FLOW_TYPE_VDEV = 0,
  14430. /* Insert new flow types above this line */
  14431. };
  14432. PREPACK struct htt_flow_pool_map_payload_t {
  14433. A_UINT32 flow_type;
  14434. A_UINT32 flow_id;
  14435. A_UINT32 flow_pool_id:16,
  14436. reserved0:16;
  14437. A_UINT32 flow_pool_size:16,
  14438. reserved1:16;
  14439. A_UINT32 reserved2;
  14440. } POSTPACK;
  14441. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  14442. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  14443. (sizeof(struct htt_flow_pool_map_payload_t))
  14444. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  14445. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  14446. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  14447. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  14448. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  14449. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  14450. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  14451. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  14452. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  14453. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  14454. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  14455. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  14456. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  14457. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14458. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14459. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14460. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14461. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14462. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14463. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14464. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14465. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14466. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14467. do { \
  14468. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14469. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14470. } while (0)
  14471. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14472. do { \
  14473. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14474. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14475. } while (0)
  14476. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14477. do { \
  14478. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14479. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14480. } while (0)
  14481. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14482. do { \
  14483. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14484. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14485. } while (0)
  14486. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14487. do { \
  14488. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14489. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14490. } while (0)
  14491. /**
  14492. * @brief target -> host flow pool unmap message
  14493. *
  14494. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14495. *
  14496. * @details
  14497. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14498. * down a flow of descriptors.
  14499. * This message indicates that for the flow (whose ID is provided) is wanting
  14500. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14501. * pool of descriptors from where descriptors are being allocated for this
  14502. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14503. * be unmapped by the host.
  14504. *
  14505. * The message would appear as follows:
  14506. *
  14507. * |31 24|23 16|15 8|7 0|
  14508. * |----------------+----------------+----------------+----------------|
  14509. * | reserved0 | msg_type |
  14510. * |-------------------------------------------------------------------|
  14511. * | flow_type |
  14512. * |-------------------------------------------------------------------|
  14513. * | flow_id |
  14514. * |-------------------------------------------------------------------|
  14515. * | reserved1 | flow_pool_id |
  14516. * |-------------------------------------------------------------------|
  14517. *
  14518. * The message is interpreted as follows:
  14519. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14520. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14521. * b'8:31 - reserved0: Reserved for future use
  14522. *
  14523. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14524. * this flow is associated. It can be VDEV, peer,
  14525. * or tid (AC). Based on enum htt_flow_type.
  14526. *
  14527. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14528. * object. For flow_type vdev it is set to the
  14529. * vdevid, for peer it is peerid and for tid, it is
  14530. * tid_num.
  14531. *
  14532. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14533. * used in the host for this flow
  14534. * b'16:31 - reserved0: This field in reserved for the future.
  14535. *
  14536. */
  14537. PREPACK struct htt_flow_pool_unmap_t {
  14538. A_UINT32 msg_type:8,
  14539. reserved0:24;
  14540. A_UINT32 flow_type;
  14541. A_UINT32 flow_id;
  14542. A_UINT32 flow_pool_id:16,
  14543. reserved1:16;
  14544. } POSTPACK;
  14545. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14546. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14547. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14548. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14549. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14550. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14551. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14552. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14553. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14554. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14555. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14556. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14557. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14558. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14559. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14560. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14561. do { \
  14562. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14563. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14564. } while (0)
  14565. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14566. do { \
  14567. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14568. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14569. } while (0)
  14570. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14571. do { \
  14572. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14573. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14574. } while (0)
  14575. /**
  14576. * @brief target -> host SRING setup done message
  14577. *
  14578. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14579. *
  14580. * @details
  14581. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14582. * SRNG ring setup is done
  14583. *
  14584. * This message indicates whether the last setup operation is successful.
  14585. * It will be sent to host when host set respose_required bit in
  14586. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14587. * The message would appear as follows:
  14588. *
  14589. * |31 24|23 16|15 8|7 0|
  14590. * |--------------- +----------------+----------------+----------------|
  14591. * | setup_status | ring_id | pdev_id | msg_type |
  14592. * |-------------------------------------------------------------------|
  14593. *
  14594. * The message is interpreted as follows:
  14595. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14596. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14597. * b'8:15 - pdev_id:
  14598. * 0 (for rings at SOC/UMAC level),
  14599. * 1/2/3 mac id (for rings at LMAC level)
  14600. * b'16:23 - ring_id: Identify the ring which is set up
  14601. * More details can be got from enum htt_srng_ring_id
  14602. * b'24:31 - setup_status: Indicate status of setup operation
  14603. * Refer to htt_ring_setup_status
  14604. */
  14605. PREPACK struct htt_sring_setup_done_t {
  14606. A_UINT32 msg_type: 8,
  14607. pdev_id: 8,
  14608. ring_id: 8,
  14609. setup_status: 8;
  14610. } POSTPACK;
  14611. enum htt_ring_setup_status {
  14612. htt_ring_setup_status_ok = 0,
  14613. htt_ring_setup_status_error,
  14614. };
  14615. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14616. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14617. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14618. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14619. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14620. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14621. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14622. do { \
  14623. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14624. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14625. } while (0)
  14626. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14627. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14628. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14629. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14630. HTT_SRING_SETUP_DONE_RING_ID_S)
  14631. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14632. do { \
  14633. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14634. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14635. } while (0)
  14636. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14637. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14638. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14639. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14640. HTT_SRING_SETUP_DONE_STATUS_S)
  14641. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14642. do { \
  14643. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14644. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14645. } while (0)
  14646. /**
  14647. * @brief target -> flow map flow info
  14648. *
  14649. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14650. *
  14651. * @details
  14652. * HTT TX map flow entry with tqm flow pointer
  14653. * Sent from firmware to host to add tqm flow pointer in corresponding
  14654. * flow search entry. Flow metadata is replayed back to host as part of this
  14655. * struct to enable host to find the specific flow search entry
  14656. *
  14657. * The message would appear as follows:
  14658. *
  14659. * |31 28|27 18|17 14|13 8|7 0|
  14660. * |-------+------------------------------------------+----------------|
  14661. * | rsvd0 | fse_hsh_idx | msg_type |
  14662. * |-------------------------------------------------------------------|
  14663. * | rsvd1 | tid | peer_id |
  14664. * |-------------------------------------------------------------------|
  14665. * | tqm_flow_pntr_lo |
  14666. * |-------------------------------------------------------------------|
  14667. * | tqm_flow_pntr_hi |
  14668. * |-------------------------------------------------------------------|
  14669. * | fse_meta_data |
  14670. * |-------------------------------------------------------------------|
  14671. *
  14672. * The message is interpreted as follows:
  14673. *
  14674. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14675. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14676. *
  14677. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14678. * for this flow entry
  14679. *
  14680. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14681. *
  14682. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14683. *
  14684. * dword1 - b'14:17 - tid
  14685. *
  14686. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14687. *
  14688. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14689. *
  14690. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14691. *
  14692. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14693. * given by host
  14694. */
  14695. PREPACK struct htt_tx_map_flow_info {
  14696. A_UINT32
  14697. msg_type: 8,
  14698. fse_hsh_idx: 20,
  14699. rsvd0: 4;
  14700. A_UINT32
  14701. peer_id: 14,
  14702. tid: 4,
  14703. rsvd1: 14;
  14704. A_UINT32 tqm_flow_pntr_lo;
  14705. A_UINT32 tqm_flow_pntr_hi;
  14706. struct htt_tx_flow_metadata fse_meta_data;
  14707. } POSTPACK;
  14708. /* DWORD 0 */
  14709. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14710. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14711. /* DWORD 1 */
  14712. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14713. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14714. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14715. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14716. /* DWORD 0 */
  14717. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14718. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14719. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14720. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14721. do { \
  14722. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14723. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14724. } while (0)
  14725. /* DWORD 1 */
  14726. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14727. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14728. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14729. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14730. do { \
  14731. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14732. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14733. } while (0)
  14734. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14735. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14736. HTT_TX_MAP_FLOW_INFO_TID_S)
  14737. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14738. do { \
  14739. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14740. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14741. } while (0)
  14742. /*
  14743. * htt_dbg_ext_stats_status -
  14744. * present - The requested stats have been delivered in full.
  14745. * This indicates that either the stats information was contained
  14746. * in its entirety within this message, or else this message
  14747. * completes the delivery of the requested stats info that was
  14748. * partially delivered through earlier STATS_CONF messages.
  14749. * partial - The requested stats have been delivered in part.
  14750. * One or more subsequent STATS_CONF messages with the same
  14751. * cookie value will be sent to deliver the remainder of the
  14752. * information.
  14753. * error - The requested stats could not be delivered, for example due
  14754. * to a shortage of memory to construct a message holding the
  14755. * requested stats.
  14756. * invalid - The requested stat type is either not recognized, or the
  14757. * target is configured to not gather the stats type in question.
  14758. */
  14759. enum htt_dbg_ext_stats_status {
  14760. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14761. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14762. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14763. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14764. };
  14765. /**
  14766. * @brief target -> host ppdu stats upload
  14767. *
  14768. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14769. *
  14770. * @details
  14771. * The following field definitions describe the format of the HTT target
  14772. * to host ppdu stats indication message.
  14773. *
  14774. *
  14775. * |31 16|15 12|11 10|9 8|7 0 |
  14776. * |----------------------------------------------------------------------|
  14777. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14778. * |----------------------------------------------------------------------|
  14779. * | ppdu_id |
  14780. * |----------------------------------------------------------------------|
  14781. * | Timestamp in us |
  14782. * |----------------------------------------------------------------------|
  14783. * | reserved |
  14784. * |----------------------------------------------------------------------|
  14785. * | type-specific stats info |
  14786. * | (see htt_ppdu_stats.h) |
  14787. * |----------------------------------------------------------------------|
  14788. * Header fields:
  14789. * - MSG_TYPE
  14790. * Bits 7:0
  14791. * Purpose: Identifies this is a PPDU STATS indication
  14792. * message.
  14793. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14794. * - mac_id
  14795. * Bits 9:8
  14796. * Purpose: mac_id of this ppdu_id
  14797. * Value: 0-3
  14798. * - pdev_id
  14799. * Bits 11:10
  14800. * Purpose: pdev_id of this ppdu_id
  14801. * Value: 0-3
  14802. * 0 (for rings at SOC level),
  14803. * 1/2/3 PDEV -> 0/1/2
  14804. * - payload_size
  14805. * Bits 31:16
  14806. * Purpose: total tlv size
  14807. * Value: payload_size in bytes
  14808. */
  14809. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14810. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14811. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14812. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14813. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14814. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14815. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14816. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14817. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14818. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14819. do { \
  14820. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14821. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14822. } while (0)
  14823. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14824. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14825. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14826. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14827. do { \
  14828. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14829. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14830. } while (0)
  14831. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14832. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14833. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14834. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14835. do { \
  14836. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14837. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14838. } while (0)
  14839. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14840. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14841. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14842. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14843. do { \
  14844. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14845. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14846. } while (0)
  14847. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14848. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14849. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14850. /* htt_t2h_ppdu_stats_ind_hdr_t
  14851. * This struct contains the fields within the header of the
  14852. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14853. * stats info.
  14854. * This struct assumes little-endian layout, and thus is only
  14855. * suitable for use within processors known to be little-endian
  14856. * (such as the target).
  14857. * In contrast, the above macros provide endian-portable methods
  14858. * to get and set the bitfields within this PPDU_STATS_IND header.
  14859. */
  14860. typedef struct {
  14861. A_UINT32 msg_type: 8, /* bits 7:0 */
  14862. mac_id: 2, /* bits 9:8 */
  14863. pdev_id: 2, /* bits 11:10 */
  14864. reserved1: 4, /* bits 15:12 */
  14865. payload_size: 16; /* bits 31:16 */
  14866. A_UINT32 ppdu_id;
  14867. A_UINT32 timestamp_us;
  14868. A_UINT32 reserved2;
  14869. } htt_t2h_ppdu_stats_ind_hdr_t;
  14870. /**
  14871. * @brief target -> host extended statistics upload
  14872. *
  14873. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14874. *
  14875. * @details
  14876. * The following field definitions describe the format of the HTT target
  14877. * to host stats upload confirmation message.
  14878. * The message contains a cookie echoed from the HTT host->target stats
  14879. * upload request, which identifies which request the confirmation is
  14880. * for, and a single stats can span over multiple HTT stats indication
  14881. * due to the HTT message size limitation so every HTT ext stats indication
  14882. * will have tag-length-value stats information elements.
  14883. * The tag-length header for each HTT stats IND message also includes a
  14884. * status field, to indicate whether the request for the stat type in
  14885. * question was fully met, partially met, unable to be met, or invalid
  14886. * (if the stat type in question is disabled in the target).
  14887. * A Done bit 1's indicate the end of the of stats info elements.
  14888. *
  14889. *
  14890. * |31 16|15 12|11|10 8|7 5|4 0|
  14891. * |--------------------------------------------------------------|
  14892. * | reserved | msg type |
  14893. * |--------------------------------------------------------------|
  14894. * | cookie LSBs |
  14895. * |--------------------------------------------------------------|
  14896. * | cookie MSBs |
  14897. * |--------------------------------------------------------------|
  14898. * | stats entry length | rsvd | D| S | stat type |
  14899. * |--------------------------------------------------------------|
  14900. * | type-specific stats info |
  14901. * | (see htt_stats.h) |
  14902. * |--------------------------------------------------------------|
  14903. * Header fields:
  14904. * - MSG_TYPE
  14905. * Bits 7:0
  14906. * Purpose: Identifies this is a extended statistics upload confirmation
  14907. * message.
  14908. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14909. * - COOKIE_LSBS
  14910. * Bits 31:0
  14911. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14912. * message with its preceding host->target stats request message.
  14913. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14914. * - COOKIE_MSBS
  14915. * Bits 31:0
  14916. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14917. * message with its preceding host->target stats request message.
  14918. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14919. *
  14920. * Stats Information Element tag-length header fields:
  14921. * - STAT_TYPE
  14922. * Bits 7:0
  14923. * Purpose: identifies the type of statistics info held in the
  14924. * following information element
  14925. * Value: htt_dbg_ext_stats_type
  14926. * - STATUS
  14927. * Bits 10:8
  14928. * Purpose: indicate whether the requested stats are present
  14929. * Value: htt_dbg_ext_stats_status
  14930. * - DONE
  14931. * Bits 11
  14932. * Purpose:
  14933. * Indicates the completion of the stats entry, this will be the last
  14934. * stats conf HTT segment for the requested stats type.
  14935. * Value:
  14936. * 0 -> the stats retrieval is ongoing
  14937. * 1 -> the stats retrieval is complete
  14938. * - LENGTH
  14939. * Bits 31:16
  14940. * Purpose: indicate the stats information size
  14941. * Value: This field specifies the number of bytes of stats information
  14942. * that follows the element tag-length header.
  14943. * It is expected but not required that this length is a multiple of
  14944. * 4 bytes.
  14945. */
  14946. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14947. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14948. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14949. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14950. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14951. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14952. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14953. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14954. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14955. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14956. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14957. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14958. do { \
  14959. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14960. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14961. } while (0)
  14962. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14963. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14964. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14965. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14966. do { \
  14967. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14968. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14969. } while (0)
  14970. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14971. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14972. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14973. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14974. do { \
  14975. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14976. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14977. } while (0)
  14978. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14979. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14980. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14981. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14982. do { \
  14983. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14984. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14985. } while (0)
  14986. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14987. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14988. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14989. /**
  14990. * @brief target -> host streaming statistics upload
  14991. *
  14992. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  14993. *
  14994. * @details
  14995. * The following field definitions describe the format of the HTT target
  14996. * to host streaming stats upload indication message.
  14997. * The host can use a STREAMING_STATS_REQ message to enable the target to
  14998. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  14999. * use the STREAMING_STATS_REQ message to halt the target's production of
  15000. * STREAMING_STATS_IND messages.
  15001. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  15002. * the stats enabled by the host's STREAMING_STATS_REQ message.
  15003. *
  15004. * |31 8|7 0|
  15005. * |--------------------------------------------------------------|
  15006. * | reserved | msg type |
  15007. * |--------------------------------------------------------------|
  15008. * | type-specific stats info |
  15009. * | (see htt_stats.h) |
  15010. * |--------------------------------------------------------------|
  15011. * Header fields:
  15012. * - MSG_TYPE
  15013. * Bits 7:0
  15014. * Purpose: Identifies this as a streaming statistics upload indication
  15015. * message.
  15016. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  15017. */
  15018. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  15019. typedef enum {
  15020. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  15021. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  15022. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  15023. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  15024. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  15025. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  15026. /* Reserved from 128 - 255 for target internal use.*/
  15027. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  15028. } HTT_PEER_TYPE;
  15029. /** macro to convert MAC address from char array to HTT word format */
  15030. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  15031. (phtt_mac_addr)->mac_addr31to0 = \
  15032. (((c_macaddr)[0] << 0) | \
  15033. ((c_macaddr)[1] << 8) | \
  15034. ((c_macaddr)[2] << 16) | \
  15035. ((c_macaddr)[3] << 24)); \
  15036. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  15037. } while (0)
  15038. /**
  15039. * @brief target -> host monitor mac header indication message
  15040. *
  15041. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  15042. *
  15043. * @details
  15044. * The following diagram shows the format of the monitor mac header message
  15045. * sent from the target to the host.
  15046. * This message is primarily sent when promiscuous rx mode is enabled.
  15047. * One message is sent per rx PPDU.
  15048. *
  15049. * |31 24|23 16|15 8|7 0|
  15050. * |-------------------------------------------------------------|
  15051. * | peer_id | reserved0 | msg_type |
  15052. * |-------------------------------------------------------------|
  15053. * | reserved1 | num_mpdu |
  15054. * |-------------------------------------------------------------|
  15055. * | struct hw_rx_desc |
  15056. * | (see wal_rx_desc.h) |
  15057. * |-------------------------------------------------------------|
  15058. * | struct ieee80211_frame_addr4 |
  15059. * | (see ieee80211_defs.h) |
  15060. * |-------------------------------------------------------------|
  15061. * | struct ieee80211_frame_addr4 |
  15062. * | (see ieee80211_defs.h) |
  15063. * |-------------------------------------------------------------|
  15064. * | ...... |
  15065. * |-------------------------------------------------------------|
  15066. *
  15067. * Header fields:
  15068. * - msg_type
  15069. * Bits 7:0
  15070. * Purpose: Identifies this is a monitor mac header indication message.
  15071. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  15072. * - peer_id
  15073. * Bits 31:16
  15074. * Purpose: Software peer id given by host during association,
  15075. * During promiscuous mode, the peer ID will be invalid (0xFF)
  15076. * for rx PPDUs received from unassociated peers.
  15077. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  15078. * - num_mpdu
  15079. * Bits 15:0
  15080. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  15081. * delivered within the message.
  15082. * Value: 1 to 32
  15083. * num_mpdu is limited to a maximum value of 32, due to buffer
  15084. * size limits. For PPDUs with more than 32 MPDUs, only the
  15085. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  15086. * the PPDU will be provided.
  15087. */
  15088. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  15089. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  15090. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  15091. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  15092. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  15093. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  15094. do { \
  15095. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  15096. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  15097. } while (0)
  15098. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  15099. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  15100. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  15101. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  15102. do { \
  15103. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  15104. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  15105. } while (0)
  15106. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  15107. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  15108. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  15109. /**
  15110. * @brief target -> host flow pool resize Message
  15111. *
  15112. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  15113. *
  15114. * @details
  15115. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  15116. * the flow pool associated with the specified ID is resized
  15117. *
  15118. * The message would appear as follows:
  15119. *
  15120. * |31 16|15 8|7 0|
  15121. * |---------------------------------+----------------+----------------|
  15122. * | reserved0 | Msg type |
  15123. * |-------------------------------------------------------------------|
  15124. * | flow pool new size | flow pool ID |
  15125. * |-------------------------------------------------------------------|
  15126. *
  15127. * The message is interpreted as follows:
  15128. * b'0:7 - msg_type: This will be set to 0x21
  15129. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  15130. *
  15131. * b'0:15 - flow pool ID: Existing flow pool ID
  15132. *
  15133. * b'16:31 - flow pool new size: new pool size for existing flow pool ID
  15134. *
  15135. */
  15136. PREPACK struct htt_flow_pool_resize_t {
  15137. A_UINT32 msg_type:8,
  15138. reserved0:24;
  15139. A_UINT32 flow_pool_id:16,
  15140. flow_pool_new_size:16;
  15141. } POSTPACK;
  15142. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  15143. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  15144. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  15145. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  15146. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  15147. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  15148. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  15149. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  15150. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  15151. do { \
  15152. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  15153. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  15154. } while (0)
  15155. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  15156. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  15157. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  15158. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  15159. do { \
  15160. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  15161. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  15162. } while (0)
  15163. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  15164. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  15165. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  15166. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  15167. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  15168. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  15169. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  15170. /*
  15171. * The read and write indices point to the data within the host buffer.
  15172. * Because the first 4 bytes of the host buffer is used for the read index and
  15173. * the next 4 bytes for the write index, the data itself starts at offset 8.
  15174. * The read index and write index are the byte offsets from the base of the
  15175. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  15176. * Refer the ASCII text picture below.
  15177. */
  15178. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  15179. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  15180. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  15181. /*
  15182. ***************************************************************************
  15183. *
  15184. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15185. *
  15186. ***************************************************************************
  15187. *
  15188. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  15189. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  15190. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  15191. * written into the Host memory region mentioned below.
  15192. *
  15193. * Read index is updated by the Host. At any point of time, the read index will
  15194. * indicate the index that will next be read by the Host. The read index is
  15195. * in units of bytes offset from the base of the meta-data buffer.
  15196. *
  15197. * Write index is updated by the FW. At any point of time, the write index will
  15198. * indicate from where the FW can start writing any new data. The write index is
  15199. * in units of bytes offset from the base of the meta-data buffer.
  15200. *
  15201. * If the Host is not fast enough in reading the CFR data, any new capture data
  15202. * would be dropped if there is no space left to write the new captures.
  15203. *
  15204. * The last 4 bytes of the memory region will have the magic pattern
  15205. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  15206. * not overrun the host buffer.
  15207. *
  15208. * ,--------------------. read and write indices store the
  15209. * | | byte offset from the base of the
  15210. * | ,--------+--------. meta-data buffer to the next
  15211. * | | | | location within the data buffer
  15212. * | | v v that will be read / written
  15213. * ************************************************************************
  15214. * * Read * Write * * Magic *
  15215. * * index * index * CFR data1 ...... CFR data N * pattern *
  15216. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  15217. * ************************************************************************
  15218. * |<---------- data buffer ---------->|
  15219. *
  15220. * |<----------------- meta-data buffer allocated in Host ----------------|
  15221. *
  15222. * Note:
  15223. * - Considering the 4 bytes needed to store the Read index (R) and the
  15224. * Write index (W), the initial value is as follows:
  15225. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  15226. * - Buffer empty condition:
  15227. * R = W
  15228. *
  15229. * Regarding CFR data format:
  15230. * --------------------------
  15231. *
  15232. * Each CFR tone is stored in HW as 16-bits with the following format:
  15233. * {bits[15:12], bits[11:6], bits[5:0]} =
  15234. * {unsigned exponent (4 bits),
  15235. * signed mantissa_real (6 bits),
  15236. * signed mantissa_imag (6 bits)}
  15237. *
  15238. * CFR_real = mantissa_real * 2^(exponent-5)
  15239. * CFR_imag = mantissa_imag * 2^(exponent-5)
  15240. *
  15241. *
  15242. * The CFR data is written to the 16-bit unsigned output array (buff) in
  15243. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  15244. *
  15245. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  15246. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  15247. * .
  15248. * .
  15249. * .
  15250. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  15251. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  15252. */
  15253. /* Bandwidth of peer CFR captures */
  15254. typedef enum {
  15255. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  15256. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  15257. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  15258. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  15259. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  15260. HTT_PEER_CFR_CAPTURE_BW_MAX,
  15261. } HTT_PEER_CFR_CAPTURE_BW;
  15262. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  15263. * was captured
  15264. */
  15265. typedef enum {
  15266. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  15267. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  15268. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  15269. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  15270. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  15271. } HTT_PEER_CFR_CAPTURE_MODE;
  15272. typedef enum {
  15273. /* This message type is currently used for the below purpose:
  15274. *
  15275. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  15276. * wmi_peer_cfr_capture_cmd.
  15277. * If payload_present bit is set to 0 then the associated memory region
  15278. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  15279. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  15280. * message; the CFR dump will be present at the end of the message,
  15281. * after the chan_phy_mode.
  15282. */
  15283. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  15284. /* Always keep this last */
  15285. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  15286. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  15287. /**
  15288. * @brief target -> host CFR dump completion indication message definition
  15289. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  15290. *
  15291. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  15292. *
  15293. * @details
  15294. * The following diagram shows the format of the Channel Frequency Response
  15295. * (CFR) dump completion indication. This inidcation is sent to the Host when
  15296. * the channel capture of a peer is copied by Firmware into the Host memory
  15297. *
  15298. * **************************************************************************
  15299. *
  15300. * Message format when the CFR capture message type is
  15301. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  15302. *
  15303. * **************************************************************************
  15304. *
  15305. * |31 16|15 |8|7 0|
  15306. * |----------------------------------------------------------------|
  15307. * header: | reserved |P| msg_type |
  15308. * word 0 | | | |
  15309. * |----------------------------------------------------------------|
  15310. * payload: | cfr_capture_msg_type |
  15311. * word 1 | |
  15312. * |----------------------------------------------------------------|
  15313. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  15314. * word 2 | | | | | | | | |
  15315. * |----------------------------------------------------------------|
  15316. * | mac_addr31to0 |
  15317. * word 3 | |
  15318. * |----------------------------------------------------------------|
  15319. * | unused / reserved | mac_addr47to32 |
  15320. * word 4 | | |
  15321. * |----------------------------------------------------------------|
  15322. * | index |
  15323. * word 5 | |
  15324. * |----------------------------------------------------------------|
  15325. * | length |
  15326. * word 6 | |
  15327. * |----------------------------------------------------------------|
  15328. * | timestamp |
  15329. * word 7 | |
  15330. * |----------------------------------------------------------------|
  15331. * | counter |
  15332. * word 8 | |
  15333. * |----------------------------------------------------------------|
  15334. * | chan_mhz |
  15335. * word 9 | |
  15336. * |----------------------------------------------------------------|
  15337. * | band_center_freq1 |
  15338. * word 10 | |
  15339. * |----------------------------------------------------------------|
  15340. * | band_center_freq2 |
  15341. * word 11 | |
  15342. * |----------------------------------------------------------------|
  15343. * | chan_phy_mode |
  15344. * word 12 | |
  15345. * |----------------------------------------------------------------|
  15346. * where,
  15347. * P - payload present bit (payload_present explained below)
  15348. * req_id - memory request id (mem_req_id explained below)
  15349. * S - status field (status explained below)
  15350. * capbw - capture bandwidth (capture_bw explained below)
  15351. * mode - mode of capture (mode explained below)
  15352. * sts - space time streams (sts_count explained below)
  15353. * chbw - channel bandwidth (channel_bw explained below)
  15354. * captype - capture type (cap_type explained below)
  15355. *
  15356. * The following field definitions describe the format of the CFR dump
  15357. * completion indication sent from the target to the host
  15358. *
  15359. * Header fields:
  15360. *
  15361. * Word 0
  15362. * - msg_type
  15363. * Bits 7:0
  15364. * Purpose: Identifies this as CFR TX completion indication
  15365. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  15366. * - payload_present
  15367. * Bit 8
  15368. * Purpose: Identifies how CFR data is sent to host
  15369. * Value: 0 - If CFR Payload is written to host memory
  15370. * 1 - If CFR Payload is sent as part of HTT message
  15371. * (This is the requirement for SDIO/USB where it is
  15372. * not possible to write CFR data to host memory)
  15373. * - reserved
  15374. * Bits 31:9
  15375. * Purpose: Reserved
  15376. * Value: 0
  15377. *
  15378. * Payload fields:
  15379. *
  15380. * Word 1
  15381. * - cfr_capture_msg_type
  15382. * Bits 31:0
  15383. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  15384. * to specify the format used for the remainder of the message
  15385. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15386. * (currently only MSG_TYPE_1 is defined)
  15387. *
  15388. * Word 2
  15389. * - mem_req_id
  15390. * Bits 6:0
  15391. * Purpose: Contain the mem request id of the region where the CFR capture
  15392. * has been stored - of type WMI_HOST_MEM_REQ_ID
  15393. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  15394. this value is invalid)
  15395. * - status
  15396. * Bit 7
  15397. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  15398. * Value: 1 (True) - Successful; 0 (False) - Not successful
  15399. * - capture_bw
  15400. * Bits 10:8
  15401. * Purpose: Carry the bandwidth of the CFR capture
  15402. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  15403. * - mode
  15404. * Bits 13:11
  15405. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  15406. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  15407. * - sts_count
  15408. * Bits 16:14
  15409. * Purpose: Carry the number of space time streams
  15410. * Value: Number of space time streams
  15411. * - channel_bw
  15412. * Bits 19:17
  15413. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  15414. * measurement
  15415. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  15416. * - cap_type
  15417. * Bits 23:20
  15418. * Purpose: Carry the type of the capture
  15419. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  15420. * - vdev_id
  15421. * Bits 31:24
  15422. * Purpose: Carry the virtual device id
  15423. * Value: vdev ID
  15424. *
  15425. * Word 3
  15426. * - mac_addr31to0
  15427. * Bits 31:0
  15428. * Purpose: Contain the bits 31:0 of the peer MAC address
  15429. * Value: Bits 31:0 of the peer MAC address
  15430. *
  15431. * Word 4
  15432. * - mac_addr47to32
  15433. * Bits 15:0
  15434. * Purpose: Contain the bits 47:32 of the peer MAC address
  15435. * Value: Bits 47:32 of the peer MAC address
  15436. *
  15437. * Word 5
  15438. * - index
  15439. * Bits 31:0
  15440. * Purpose: Contain the index at which this CFR dump was written in the Host
  15441. * allocated memory. This index is the number of bytes from the base address.
  15442. * Value: Index position
  15443. *
  15444. * Word 6
  15445. * - length
  15446. * Bits 31:0
  15447. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  15448. * Value: Length of the CFR capture of the peer
  15449. *
  15450. * Word 7
  15451. * - timestamp
  15452. * Bits 31:0
  15453. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  15454. * clock used for this timestamp is private to the target and not visible to
  15455. * the host i.e., Host can interpret only the relative timestamp deltas from
  15456. * one message to the next, but can't interpret the absolute timestamp from a
  15457. * single message.
  15458. * Value: Timestamp in microseconds
  15459. *
  15460. * Word 8
  15461. * - counter
  15462. * Bits 31:0
  15463. * Purpose: Carry the count of the current CFR capture from FW. This is
  15464. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15465. * in host memory)
  15466. * Value: Count of the current CFR capture
  15467. *
  15468. * Word 9
  15469. * - chan_mhz
  15470. * Bits 31:0
  15471. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15472. * Value: Primary 20 channel frequency
  15473. *
  15474. * Word 10
  15475. * - band_center_freq1
  15476. * Bits 31:0
  15477. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15478. * Value: Center frequency 1 in MHz
  15479. *
  15480. * Word 11
  15481. * - band_center_freq2
  15482. * Bits 31:0
  15483. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15484. * the VDEV
  15485. * 80plus80 mode
  15486. * Value: Center frequency 2 in MHz
  15487. *
  15488. * Word 12
  15489. * - chan_phy_mode
  15490. * Bits 31:0
  15491. * Purpose: Carry the phy mode of the channel, of the VDEV
  15492. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15493. */
  15494. PREPACK struct htt_cfr_dump_ind_type_1 {
  15495. A_UINT32 mem_req_id:7,
  15496. status:1,
  15497. capture_bw:3,
  15498. mode:3,
  15499. sts_count:3,
  15500. channel_bw:3,
  15501. cap_type:4,
  15502. vdev_id:8;
  15503. htt_mac_addr addr;
  15504. A_UINT32 index;
  15505. A_UINT32 length;
  15506. A_UINT32 timestamp;
  15507. A_UINT32 counter;
  15508. struct htt_chan_change_msg chan;
  15509. } POSTPACK;
  15510. PREPACK struct htt_cfr_dump_compl_ind {
  15511. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15512. union {
  15513. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15514. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15515. /* If there is a need to change the memory layout and its associated
  15516. * HTT indication format, a new CFR capture message type can be
  15517. * introduced and added into this union.
  15518. */
  15519. };
  15520. } POSTPACK;
  15521. /*
  15522. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15523. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15524. */
  15525. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15526. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15527. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15528. do { \
  15529. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15530. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15531. } while(0)
  15532. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15533. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15534. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15535. /*
  15536. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15537. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15538. */
  15539. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15540. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15541. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15542. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15543. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15544. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15545. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15546. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15547. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15548. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15549. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15550. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15551. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15552. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15553. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15554. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15555. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15556. do { \
  15557. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15558. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15559. } while (0)
  15560. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15561. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15562. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15563. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15564. do { \
  15565. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15566. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15567. } while (0)
  15568. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15569. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15570. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15571. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15572. do { \
  15573. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15574. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15575. } while (0)
  15576. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15577. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15578. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15579. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15580. do { \
  15581. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15582. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15583. } while (0)
  15584. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15585. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15586. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15587. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15588. do { \
  15589. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15590. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15591. } while (0)
  15592. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15593. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15594. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15595. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15596. do { \
  15597. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15598. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15599. } while (0)
  15600. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15601. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15602. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15603. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15604. do { \
  15605. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15606. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15607. } while (0)
  15608. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15609. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15610. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15611. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15612. do { \
  15613. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15614. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15615. } while (0)
  15616. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15617. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15618. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15619. /**
  15620. * @brief target -> host peer (PPDU) stats message
  15621. *
  15622. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15623. *
  15624. * @details
  15625. * This message is generated by FW when FW is sending stats to host
  15626. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15627. * This message is sent autonomously by the target rather than upon request
  15628. * by the host.
  15629. * The following field definitions describe the format of the HTT target
  15630. * to host peer stats indication message.
  15631. *
  15632. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15633. * or more PPDU stats records.
  15634. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15635. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15636. * then the message would start with the
  15637. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15638. * below.
  15639. *
  15640. * |31 16|15|14|13 11|10 9|8|7 0|
  15641. * |-------------------------------------------------------------|
  15642. * | reserved |MSG_TYPE |
  15643. * |-------------------------------------------------------------|
  15644. * rec 0 | TLV header |
  15645. * rec 0 |-------------------------------------------------------------|
  15646. * rec 0 | ppdu successful bytes |
  15647. * rec 0 |-------------------------------------------------------------|
  15648. * rec 0 | ppdu retry bytes |
  15649. * rec 0 |-------------------------------------------------------------|
  15650. * rec 0 | ppdu failed bytes |
  15651. * rec 0 |-------------------------------------------------------------|
  15652. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15653. * rec 0 |-------------------------------------------------------------|
  15654. * rec 0 | retried MSDUs | successful MSDUs |
  15655. * rec 0 |-------------------------------------------------------------|
  15656. * rec 0 | TX duration | failed MSDUs |
  15657. * rec 0 |-------------------------------------------------------------|
  15658. * ...
  15659. * |-------------------------------------------------------------|
  15660. * rec N | TLV header |
  15661. * rec N |-------------------------------------------------------------|
  15662. * rec N | ppdu successful bytes |
  15663. * rec N |-------------------------------------------------------------|
  15664. * rec N | ppdu retry bytes |
  15665. * rec N |-------------------------------------------------------------|
  15666. * rec N | ppdu failed bytes |
  15667. * rec N |-------------------------------------------------------------|
  15668. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15669. * rec N |-------------------------------------------------------------|
  15670. * rec N | retried MSDUs | successful MSDUs |
  15671. * rec N |-------------------------------------------------------------|
  15672. * rec N | TX duration | failed MSDUs |
  15673. * rec N |-------------------------------------------------------------|
  15674. *
  15675. * where:
  15676. * A = is A-MPDU flag
  15677. * BA = block-ack failure flags
  15678. * BW = bandwidth spec
  15679. * SG = SGI enabled spec
  15680. * S = skipped rate ctrl
  15681. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15682. *
  15683. * Header
  15684. * ------
  15685. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15686. * dword0 - b'8:31 - reserved : Reserved for future use
  15687. *
  15688. * payload include below peer_stats information
  15689. * --------------------------------------------
  15690. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15691. * @tx_success_bytes : total successful bytes in the PPDU.
  15692. * @tx_retry_bytes : total retried bytes in the PPDU.
  15693. * @tx_failed_bytes : total failed bytes in the PPDU.
  15694. * @tx_ratecode : rate code used for the PPDU.
  15695. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15696. * @ba_ack_failed : BA/ACK failed for this PPDU
  15697. * b00 -> BA received
  15698. * b01 -> BA failed once
  15699. * b10 -> BA failed twice, when HW retry is enabled.
  15700. * @bw : BW
  15701. * b00 -> 20 MHz
  15702. * b01 -> 40 MHz
  15703. * b10 -> 80 MHz
  15704. * b11 -> 160 MHz (or 80+80)
  15705. * @sg : SGI enabled
  15706. * @s : skipped ratectrl
  15707. * @peer_id : peer id
  15708. * @tx_success_msdus : successful MSDUs
  15709. * @tx_retry_msdus : retried MSDUs
  15710. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15711. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15712. */
  15713. /**
  15714. * @brief target -> host backpressure event
  15715. *
  15716. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15717. *
  15718. * @details
  15719. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15720. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15721. * This message will only be sent if the backpressure condition has existed
  15722. * continuously for an initial period (100 ms).
  15723. * Repeat messages with updated information will be sent after each
  15724. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15725. * This message indicates the ring id along with current head and tail index
  15726. * locations (i.e. write and read indices).
  15727. * The backpressure time indicates the time in ms for which continuous
  15728. * backpressure has been observed in the ring.
  15729. *
  15730. * The message format is as follows:
  15731. *
  15732. * |31 24|23 16|15 8|7 0|
  15733. * |----------------+----------------+----------------+----------------|
  15734. * | ring_id | ring_type | pdev_id | msg_type |
  15735. * |-------------------------------------------------------------------|
  15736. * | tail_idx | head_idx |
  15737. * |-------------------------------------------------------------------|
  15738. * | backpressure_time_ms |
  15739. * |-------------------------------------------------------------------|
  15740. *
  15741. * The message is interpreted as follows:
  15742. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15743. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15744. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15745. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15746. * the msg is for LMAC ring.
  15747. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15748. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15749. * htt_backpressure_lmac_ring_id. This represents
  15750. * the ring id for which continuous backpressure
  15751. * is seen
  15752. *
  15753. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15754. * the ring indicated by the ring_id
  15755. *
  15756. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15757. * the ring indicated by the ring id
  15758. *
  15759. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continuous
  15760. * backpressure has been seen in the ring
  15761. * indicated by the ring_id.
  15762. * Units = milliseconds
  15763. */
  15764. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15765. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15766. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15767. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15768. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15769. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15770. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15771. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15772. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15773. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15774. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15775. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15776. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15777. do { \
  15778. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15779. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15780. } while (0)
  15781. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15782. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15783. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15784. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15785. do { \
  15786. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15787. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15788. } while (0)
  15789. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15790. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15791. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15792. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15793. do { \
  15794. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15795. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15796. } while (0)
  15797. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15798. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15799. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15800. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15801. do { \
  15802. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15803. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15804. } while (0)
  15805. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15806. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15807. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15808. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15809. do { \
  15810. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15811. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15812. } while (0)
  15813. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15814. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15815. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15816. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15817. do { \
  15818. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15819. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15820. } while (0)
  15821. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15822. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15823. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15824. enum htt_backpressure_ring_type {
  15825. HTT_SW_RING_TYPE_UMAC,
  15826. HTT_SW_RING_TYPE_LMAC,
  15827. HTT_SW_RING_TYPE_MAX,
  15828. };
  15829. /* Ring id for which the message is sent to host */
  15830. enum htt_backpressure_umac_ringid {
  15831. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15832. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15833. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15834. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15835. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15836. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15837. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15838. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15839. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15840. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15841. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15842. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15843. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15844. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15845. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15846. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15847. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15848. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15849. HTT_SW_UMAC_RING_IDX_MAX,
  15850. };
  15851. enum htt_backpressure_lmac_ringid {
  15852. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15853. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15854. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15855. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15856. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15857. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15858. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15859. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15860. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15861. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15862. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15863. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15864. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15865. HTT_SW_LMAC_RING_IDX_MAX,
  15866. };
  15867. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15868. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15869. pdev_id: 8,
  15870. ring_type: 8, /* htt_backpressure_ring_type */
  15871. /*
  15872. * ring_id holds an enum value from either
  15873. * htt_backpressure_umac_ringid or
  15874. * htt_backpressure_lmac_ringid, based on
  15875. * the ring_type setting.
  15876. */
  15877. ring_id: 8;
  15878. A_UINT16 head_idx;
  15879. A_UINT16 tail_idx;
  15880. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15881. } POSTPACK;
  15882. /*
  15883. * Defines two 32 bit words that can be used by the target to indicate a per
  15884. * user RU allocation and rate information.
  15885. *
  15886. * This information is currently provided in the "sw_response_reference_ptr"
  15887. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15888. * "rx_ppdu_end_user_stats" TLV.
  15889. *
  15890. * VALID:
  15891. * The consumer of these words must explicitly check the valid bit,
  15892. * and only attempt interpretation of any of the remaining fields if
  15893. * the valid bit is set to 1.
  15894. *
  15895. * VERSION:
  15896. * The consumer of these words must also explicitly check the version bit,
  15897. * and only use the V0 definition if the VERSION field is set to 0.
  15898. *
  15899. * Version 1 is currently undefined, with the exception of the VALID and
  15900. * VERSION fields.
  15901. *
  15902. * Version 0:
  15903. *
  15904. * The fields below are duplicated per BW.
  15905. *
  15906. * The consumer must determine which BW field to use, based on the UL OFDMA
  15907. * PPDU BW indicated by HW.
  15908. *
  15909. * RU_START: RU26 start index for the user.
  15910. * Note that this is always using the RU26 index, regardless
  15911. * of the actual RU assigned to the user
  15912. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15913. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15914. *
  15915. * For example, 20MHz (the value in the top row is RU_START)
  15916. *
  15917. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15918. * RU Size 1 (52): | | | | | |
  15919. * RU Size 2 (106): | | | |
  15920. * RU Size 3 (242): | |
  15921. *
  15922. * RU_SIZE: Indicates the RU size, as defined by enum
  15923. * htt_ul_ofdma_user_info_ru_size.
  15924. *
  15925. * LDPC: LDPC enabled (if 0, BCC is used)
  15926. *
  15927. * DCM: DCM enabled
  15928. *
  15929. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15930. * |---------------------------------+--------------------------------|
  15931. * |Ver|Valid| FW internal |
  15932. * |---------------------------------+--------------------------------|
  15933. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15934. * |---------------------------------+--------------------------------|
  15935. */
  15936. enum htt_ul_ofdma_user_info_ru_size {
  15937. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15938. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15939. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15940. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15941. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15942. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15943. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15944. };
  15945. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15946. struct htt_ul_ofdma_user_info_v0 {
  15947. A_UINT32 word0;
  15948. A_UINT32 word1;
  15949. };
  15950. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15951. A_UINT32 w0_fw_rsvd:30; \
  15952. A_UINT32 w0_valid:1; \
  15953. A_UINT32 w0_version:1;
  15954. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15955. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15956. };
  15957. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15958. A_UINT32 w1_nss:3; \
  15959. A_UINT32 w1_mcs:4; \
  15960. A_UINT32 w1_ldpc:1; \
  15961. A_UINT32 w1_dcm:1; \
  15962. A_UINT32 w1_ru_start:7; \
  15963. A_UINT32 w1_ru_size:3; \
  15964. A_UINT32 w1_trig_type:4; \
  15965. A_UINT32 w1_unused:9;
  15966. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15967. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15968. };
  15969. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15970. A_UINT32 w0_fw_rsvd:27; \
  15971. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15972. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15973. 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) */
  15974. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15975. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15976. };
  15977. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15978. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15979. A_UINT32 w1_trig_type:4; \
  15980. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15981. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15982. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15983. };
  15984. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15985. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15986. union {
  15987. A_UINT32 word0;
  15988. struct {
  15989. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15990. };
  15991. };
  15992. union {
  15993. A_UINT32 word1;
  15994. struct {
  15995. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15996. };
  15997. };
  15998. } POSTPACK;
  15999. /*
  16000. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  16001. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  16002. * this should be picked.
  16003. */
  16004. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  16005. union {
  16006. A_UINT32 word0;
  16007. struct {
  16008. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  16009. };
  16010. };
  16011. union {
  16012. A_UINT32 word1;
  16013. struct {
  16014. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  16015. };
  16016. };
  16017. } POSTPACK;
  16018. enum HTT_UL_OFDMA_TRIG_TYPE {
  16019. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  16020. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  16021. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  16022. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  16023. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  16024. };
  16025. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  16026. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  16027. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  16028. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  16029. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  16030. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  16031. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  16032. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  16033. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  16034. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  16035. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  16036. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  16037. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  16038. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  16039. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  16040. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  16041. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  16042. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  16043. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  16044. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  16045. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  16046. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  16047. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  16048. /*--- word 0 ---*/
  16049. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  16050. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  16051. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  16052. do { \
  16053. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  16054. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  16055. } while (0)
  16056. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  16057. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  16058. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  16059. do { \
  16060. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  16061. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  16062. } while (0)
  16063. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  16064. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  16065. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  16066. do { \
  16067. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  16068. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  16069. } while (0)
  16070. /*--- word 1 ---*/
  16071. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  16072. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  16073. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  16074. do { \
  16075. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  16076. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  16077. } while (0)
  16078. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  16079. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  16080. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  16081. do { \
  16082. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  16083. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  16084. } while (0)
  16085. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  16086. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  16087. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  16088. do { \
  16089. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  16090. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  16091. } while (0)
  16092. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  16093. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  16094. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  16095. do { \
  16096. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  16097. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  16098. } while (0)
  16099. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  16100. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  16101. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  16102. do { \
  16103. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  16104. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  16105. } while (0)
  16106. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  16107. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  16108. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  16109. do { \
  16110. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  16111. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  16112. } while (0)
  16113. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  16114. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  16115. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  16116. do { \
  16117. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  16118. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  16119. } while (0)
  16120. /**
  16121. * @brief target -> host channel calibration data message
  16122. *
  16123. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  16124. *
  16125. * @brief host -> target channel calibration data message
  16126. *
  16127. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  16128. *
  16129. * @details
  16130. * The following field definitions describe the format of the channel
  16131. * calibration data message sent from the target to the host when
  16132. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  16133. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  16134. * The message is defined as htt_chan_caldata_msg followed by a variable
  16135. * number of 32-bit character values.
  16136. *
  16137. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  16138. * |------------------------------------------------------------------|
  16139. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  16140. * |------------------------------------------------------------------|
  16141. * | payload size | mhz |
  16142. * |------------------------------------------------------------------|
  16143. * | center frequency 2 | center frequency 1 |
  16144. * |------------------------------------------------------------------|
  16145. * | check sum |
  16146. * |------------------------------------------------------------------|
  16147. * | payload |
  16148. * |------------------------------------------------------------------|
  16149. * message info field:
  16150. * - MSG_TYPE
  16151. * Bits 7:0
  16152. * Purpose: identifies this as a channel calibration data message
  16153. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  16154. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  16155. * - SUB_TYPE
  16156. * Bits 11:8
  16157. * Purpose: T2H: indicates whether target is providing chan cal data
  16158. * to the host to store, or requesting that the host
  16159. * download previously-stored data.
  16160. * H2T: indicates whether the host is providing the requested
  16161. * channel cal data, or if it is rejecting the data
  16162. * request because it does not have the requested data.
  16163. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  16164. * - CHKSUM_VALID
  16165. * Bit 12
  16166. * Purpose: indicates if the checksum field is valid
  16167. * value:
  16168. * - FRAG
  16169. * Bit 19:16
  16170. * Purpose: indicates the fragment index for message
  16171. * value: 0 for first fragment, 1 for second fragment, ...
  16172. * - APPEND
  16173. * Bit 20
  16174. * Purpose: indicates if this is the last fragment
  16175. * value: 0 = final fragment, 1 = more fragments will be appended
  16176. *
  16177. * channel and payload size field
  16178. * - MHZ
  16179. * Bits 15:0
  16180. * Purpose: indicates the channel primary frequency
  16181. * Value:
  16182. * - PAYLOAD_SIZE
  16183. * Bits 31:16
  16184. * Purpose: indicates the bytes of calibration data in payload
  16185. * Value:
  16186. *
  16187. * center frequency field
  16188. * - CENTER FREQUENCY 1
  16189. * Bits 15:0
  16190. * Purpose: indicates the channel center frequency
  16191. * Value: channel center frequency, in MHz units
  16192. * - CENTER FREQUENCY 2
  16193. * Bits 31:16
  16194. * Purpose: indicates the secondary channel center frequency,
  16195. * only for 11acvht 80plus80 mode
  16196. * Value: secondary channel center frequency, in MHz units, if applicable
  16197. *
  16198. * checksum field
  16199. * - CHECK_SUM
  16200. * Bits 31:0
  16201. * Purpose: check the payload data, it is just for this fragment.
  16202. * This is intended for the target to check that the channel
  16203. * calibration data returned by the host is the unmodified data
  16204. * that was previously provided to the host by the target.
  16205. * value: checksum of fragment payload
  16206. */
  16207. PREPACK struct htt_chan_caldata_msg {
  16208. /* DWORD 0: message info */
  16209. A_UINT32
  16210. msg_type: 8,
  16211. sub_type: 4 ,
  16212. chksum_valid: 1, /** 1:valid, 0:invalid */
  16213. reserved1: 3,
  16214. frag_idx: 4, /** fragment index for calibration data */
  16215. appending: 1, /** 0: no fragment appending,
  16216. * 1: extra fragment appending */
  16217. reserved2: 11;
  16218. /* DWORD 1: channel and payload size */
  16219. A_UINT32
  16220. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  16221. payload_size: 16; /** unit: bytes */
  16222. /* DWORD 2: center frequency */
  16223. A_UINT32
  16224. band_center_freq1: 16, /** Center frequency 1 in MHz */
  16225. band_center_freq2: 16; /** Center frequency 2 in MHz,
  16226. * valid only for 11acvht 80plus80 mode */
  16227. /* DWORD 3: check sum */
  16228. A_UINT32 chksum;
  16229. /* variable length for calibration data */
  16230. A_UINT32 payload[1/* or more */];
  16231. } POSTPACK;
  16232. /* T2H SUBTYPE */
  16233. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  16234. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  16235. /* H2T SUBTYPE */
  16236. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  16237. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  16238. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  16239. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  16240. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  16241. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  16242. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  16243. do { \
  16244. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  16245. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  16246. } while (0)
  16247. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  16248. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  16249. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  16250. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  16251. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  16252. do { \
  16253. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  16254. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  16255. } while (0)
  16256. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  16257. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  16258. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  16259. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  16260. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  16261. do { \
  16262. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  16263. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  16264. } while (0)
  16265. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  16266. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  16267. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  16268. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  16269. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  16270. do { \
  16271. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  16272. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  16273. } while (0)
  16274. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  16275. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  16276. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  16277. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  16278. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  16279. do { \
  16280. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  16281. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  16282. } while (0)
  16283. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  16284. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  16285. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  16286. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  16287. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  16288. do { \
  16289. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  16290. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  16291. } while (0)
  16292. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  16293. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  16294. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  16295. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  16296. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  16297. do { \
  16298. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  16299. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  16300. } while (0)
  16301. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  16302. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  16303. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  16304. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  16305. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  16306. do { \
  16307. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  16308. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  16309. } while (0)
  16310. /**
  16311. * @brief target -> host FSE CMEM based send
  16312. *
  16313. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  16314. *
  16315. * @details
  16316. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  16317. * FSE placement in CMEM is enabled.
  16318. *
  16319. * This message sends the non-secure CMEM base address.
  16320. * It will be sent to host in response to message
  16321. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  16322. * The message would appear as follows:
  16323. *
  16324. * |31 24|23 16|15 8|7 0|
  16325. * |----------------+----------------+----------------+----------------|
  16326. * | reserved | num_entries | msg_type |
  16327. * |----------------+----------------+----------------+----------------|
  16328. * | base_address_lo |
  16329. * |----------------+----------------+----------------+----------------|
  16330. * | base_address_hi |
  16331. * |-------------------------------------------------------------------|
  16332. *
  16333. * The message is interpreted as follows:
  16334. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  16335. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  16336. * b'8:15 - number_entries: Indicated the number of entries
  16337. * programmed.
  16338. * b'16:31 - reserved.
  16339. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  16340. * CMEM base address
  16341. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  16342. * CMEM base address
  16343. */
  16344. PREPACK struct htt_cmem_base_send_t {
  16345. A_UINT32 msg_type: 8,
  16346. num_entries: 8,
  16347. reserved: 16;
  16348. A_UINT32 base_address_lo;
  16349. A_UINT32 base_address_hi;
  16350. } POSTPACK;
  16351. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  16352. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  16353. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  16354. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  16355. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  16356. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  16357. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  16358. do { \
  16359. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  16360. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  16361. } while (0)
  16362. /**
  16363. * @brief - HTT PPDU ID format
  16364. *
  16365. * @details
  16366. * The following field definitions describe the format of the PPDU ID.
  16367. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  16368. *
  16369. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  16370. * +--------------------------------------------------------------------------
  16371. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  16372. * +--------------------------------------------------------------------------
  16373. *
  16374. * sch id :Schedule command id
  16375. * Bits [11 : 0] : monotonically increasing counter to track the
  16376. * PPDU posted to a specific transmit queue.
  16377. *
  16378. * hwq_id: Hardware Queue ID.
  16379. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  16380. *
  16381. * mac_id: MAC ID
  16382. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  16383. *
  16384. * seq_idx: Sequence index.
  16385. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  16386. * a particular TXOP.
  16387. *
  16388. * tqm_cmd: HWSCH/TQM flag.
  16389. * Bit [23] : Always set to 0.
  16390. *
  16391. * seq_cmd_type: Sequence command type.
  16392. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  16393. * Refer to enum HTT_STATS_FTYPE for values.
  16394. */
  16395. PREPACK struct htt_ppdu_id {
  16396. A_UINT32
  16397. sch_id: 12,
  16398. hwq_id: 5,
  16399. mac_id: 2,
  16400. seq_idx: 2,
  16401. reserved1: 2,
  16402. tqm_cmd: 1,
  16403. seq_cmd_type: 6,
  16404. reserved2: 2;
  16405. } POSTPACK;
  16406. #define HTT_PPDU_ID_SCH_ID_S 0
  16407. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  16408. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  16409. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  16410. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  16411. do { \
  16412. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  16413. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  16414. } while (0)
  16415. #define HTT_PPDU_ID_HWQ_ID_S 12
  16416. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  16417. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  16418. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  16419. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  16420. do { \
  16421. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  16422. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  16423. } while (0)
  16424. #define HTT_PPDU_ID_MAC_ID_S 17
  16425. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  16426. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  16427. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  16428. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  16429. do { \
  16430. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  16431. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  16432. } while (0)
  16433. #define HTT_PPDU_ID_SEQ_IDX_S 19
  16434. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  16435. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  16436. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  16437. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  16438. do { \
  16439. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  16440. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  16441. } while (0)
  16442. #define HTT_PPDU_ID_TQM_CMD_S 23
  16443. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  16444. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  16445. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  16446. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  16447. do { \
  16448. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  16449. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  16450. } while (0)
  16451. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  16452. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  16453. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  16454. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  16455. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  16456. do { \
  16457. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  16458. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16459. } while (0)
  16460. /**
  16461. * @brief target -> RX PEER METADATA V0 format
  16462. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16463. * message from target, and will confirm to the target which peer metadata
  16464. * version to use in the wmi_init message.
  16465. *
  16466. * The following diagram shows the format of the RX PEER METADATA.
  16467. *
  16468. * |31 24|23 16|15 8|7 0|
  16469. * |-----------------------------------------------------------------------|
  16470. * | Reserved | VDEV ID | PEER ID |
  16471. * |-----------------------------------------------------------------------|
  16472. */
  16473. PREPACK struct htt_rx_peer_metadata_v0 {
  16474. A_UINT32
  16475. peer_id: 16,
  16476. vdev_id: 8,
  16477. reserved1: 8;
  16478. } POSTPACK;
  16479. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16480. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16481. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16482. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16483. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16484. do { \
  16485. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16486. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16487. } while (0)
  16488. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16489. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16490. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16491. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16492. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16493. do { \
  16494. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16495. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16496. } while (0)
  16497. /**
  16498. * @brief target -> RX PEER METADATA V1 format
  16499. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16500. * message from target, and will confirm to the target which peer metadata
  16501. * version to use in the wmi_init message.
  16502. *
  16503. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16504. *
  16505. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16506. * |-----------------------------------------------------------------------|
  16507. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  16508. * |-----------------------------------------------------------------------|
  16509. */
  16510. PREPACK struct htt_rx_peer_metadata_v1 {
  16511. A_UINT32
  16512. peer_id: 13,
  16513. ml_peer_valid: 1,
  16514. reserved1: 2,
  16515. vdev_id: 8,
  16516. lmac_id: 2,
  16517. chip_id: 3,
  16518. reserved2: 3;
  16519. } POSTPACK;
  16520. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16521. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16522. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16523. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16524. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16525. do { \
  16526. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16527. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16528. } while (0)
  16529. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16530. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16531. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16532. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16533. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16534. do { \
  16535. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16536. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16537. } while (0)
  16538. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16539. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16540. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16541. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16542. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16543. do { \
  16544. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16545. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16546. } while (0)
  16547. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16548. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16549. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16550. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16551. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16552. do { \
  16553. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16554. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16555. } while (0)
  16556. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16557. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16558. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16559. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16560. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16561. do { \
  16562. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16563. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16564. } while (0)
  16565. /*
  16566. * In some systems, the host SW wants to specify priorities between
  16567. * different MSDU / flow queues within the same peer-TID.
  16568. * The below enums are used for the host to identify to the target
  16569. * which MSDU queue's priority it wants to adjust.
  16570. */
  16571. /*
  16572. * The MSDUQ index describe index of TCL HW, where each index is
  16573. * used for queuing particular types of MSDUs.
  16574. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16575. */
  16576. enum HTT_MSDUQ_INDEX {
  16577. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16578. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16579. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16580. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16581. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16582. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16583. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16584. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16585. HTT_MSDUQ_MAX_INDEX,
  16586. };
  16587. /* MSDU qtype definition */
  16588. enum HTT_MSDU_QTYPE {
  16589. /*
  16590. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16591. * relative priority. Instead, the relative priority of CRIT_0 versus
  16592. * CRIT_1 is controlled by the FW, through the configuration parameters
  16593. * it applies to the queues.
  16594. */
  16595. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16596. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16597. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16598. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16599. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16600. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16601. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16602. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16603. /* New MSDU_QTYPE should be added above this line */
  16604. /*
  16605. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16606. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16607. * any host/target message definitions. The QTYPE_MAX value can
  16608. * only be used internally within the host or within the target.
  16609. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16610. * it must regard the unexpected value as a default qtype value,
  16611. * or ignore it.
  16612. */
  16613. HTT_MSDU_QTYPE_MAX,
  16614. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16615. };
  16616. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16617. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16618. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16619. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16620. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16621. };
  16622. /**
  16623. * @brief target -> host mlo timestamp offset indication
  16624. *
  16625. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16626. *
  16627. * @details
  16628. * The following field definitions describe the format of the HTT target
  16629. * to host mlo timestamp offset indication message.
  16630. *
  16631. *
  16632. * |31 16|15 12|11 10|9 8|7 0 |
  16633. * |----------------------------------------------------------------------|
  16634. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16635. * |----------------------------------------------------------------------|
  16636. * | Sync time stamp lo in us |
  16637. * |----------------------------------------------------------------------|
  16638. * | Sync time stamp hi in us |
  16639. * |----------------------------------------------------------------------|
  16640. * | mlo time stamp offset lo in us |
  16641. * |----------------------------------------------------------------------|
  16642. * | mlo time stamp offset hi in us |
  16643. * |----------------------------------------------------------------------|
  16644. * | mlo time stamp offset clocks in clock ticks |
  16645. * |----------------------------------------------------------------------|
  16646. * |31 26|25 16|15 0 |
  16647. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16648. * | | compensation in clks | |
  16649. * |----------------------------------------------------------------------|
  16650. * |31 22|21 0 |
  16651. * | rsvd 3 | mlo time stamp comp timer period |
  16652. * |----------------------------------------------------------------------|
  16653. * The message is interpreted as follows:
  16654. *
  16655. * dword0 - b'0:7 - msg_type: This will be set to
  16656. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16657. * value: 0x28
  16658. *
  16659. * dword0 - b'9:8 - pdev_id
  16660. *
  16661. * dword0 - b'11:10 - chip_id
  16662. *
  16663. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16664. *
  16665. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16666. *
  16667. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16668. * which last sync interrupt was received
  16669. *
  16670. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16671. * which last sync interrupt was received
  16672. *
  16673. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16674. *
  16675. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16676. *
  16677. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16678. *
  16679. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16680. *
  16681. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16682. * for sub us resolution
  16683. *
  16684. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16685. *
  16686. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16687. * is applied, in us
  16688. *
  16689. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16690. */
  16691. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16692. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16693. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16694. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16695. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16696. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16697. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16698. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16699. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16700. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16701. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16702. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16703. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16704. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16705. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16706. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16707. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16708. do { \
  16709. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16710. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16711. } while (0)
  16712. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16713. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16714. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16715. do { \
  16716. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16717. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16718. } while (0)
  16719. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16720. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16721. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16722. do { \
  16723. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16724. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16725. } while (0)
  16726. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16727. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16728. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16729. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16730. do { \
  16731. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16732. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16733. } while (0)
  16734. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16735. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16736. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16737. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16738. do { \
  16739. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16740. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16741. } while (0)
  16742. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16743. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16744. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16745. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16746. do { \
  16747. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16748. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16749. } while (0)
  16750. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16751. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16752. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16753. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16754. do { \
  16755. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16756. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16757. } while (0)
  16758. typedef struct {
  16759. A_UINT32 msg_type: 8, /* bits 7:0 */
  16760. pdev_id: 2, /* bits 9:8 */
  16761. chip_id: 2, /* bits 11:10 */
  16762. reserved1: 4, /* bits 15:12 */
  16763. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16764. A_UINT32 sync_timestamp_lo_us;
  16765. A_UINT32 sync_timestamp_hi_us;
  16766. A_UINT32 mlo_timestamp_offset_lo_us;
  16767. A_UINT32 mlo_timestamp_offset_hi_us;
  16768. A_UINT32 mlo_timestamp_offset_clks;
  16769. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16770. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16771. reserved2: 6; /* bits 31:26 */
  16772. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16773. reserved3: 10; /* bits 31:22 */
  16774. } htt_t2h_mlo_offset_ind_t;
  16775. /*
  16776. * @brief target -> host VDEV TX RX STATS
  16777. *
  16778. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16779. *
  16780. * @details
  16781. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16782. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16783. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16784. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16785. * periodically by target even in the absence of any further HTT request
  16786. * messages from host.
  16787. *
  16788. * The message is formatted as follows:
  16789. *
  16790. * |31 16|15 8|7 0|
  16791. * |---------------------------------+----------------+----------------|
  16792. * | payload_size | pdev_id | msg_type |
  16793. * |---------------------------------+----------------+----------------|
  16794. * | reserved0 |
  16795. * |-------------------------------------------------------------------|
  16796. * | reserved1 |
  16797. * |-------------------------------------------------------------------|
  16798. * | reserved2 |
  16799. * |-------------------------------------------------------------------|
  16800. * | |
  16801. * | VDEV specific Tx Rx stats info |
  16802. * | |
  16803. * |-------------------------------------------------------------------|
  16804. *
  16805. * The message is interpreted as follows:
  16806. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16807. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16808. * b'8:15 - pdev_id
  16809. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16810. * message header fields (msg_type through reserved2)
  16811. * dword1 - b'0:31 - reserved0.
  16812. * dword2 - b'0:31 - reserved1.
  16813. * dword3 - b'0:31 - reserved2.
  16814. */
  16815. typedef struct {
  16816. A_UINT32 msg_type: 8,
  16817. pdev_id: 8,
  16818. payload_size: 16;
  16819. A_UINT32 reserved0;
  16820. A_UINT32 reserved1;
  16821. A_UINT32 reserved2;
  16822. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16823. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16824. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16825. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16826. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16827. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16828. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16829. do { \
  16830. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16831. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16832. } while (0)
  16833. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16834. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16835. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16836. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16837. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16838. do { \
  16839. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16840. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16841. } while (0)
  16842. /* SOC related stats */
  16843. typedef struct {
  16844. htt_tlv_hdr_t tlv_hdr;
  16845. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16846. * This can be due to either the peer is deleted or deletion is ongoing
  16847. * */
  16848. A_UINT32 inv_peers_msdu_drop_count_lo;
  16849. A_UINT32 inv_peers_msdu_drop_count_hi;
  16850. } htt_t2h_soc_txrx_stats_common_tlv;
  16851. /* VDEV HW Tx/Rx stats */
  16852. typedef struct {
  16853. htt_tlv_hdr_t tlv_hdr;
  16854. A_UINT32 vdev_id;
  16855. /* Rx msdu byte cnt */
  16856. A_UINT32 rx_msdu_byte_cnt_lo;
  16857. A_UINT32 rx_msdu_byte_cnt_hi;
  16858. /* Rx msdu cnt */
  16859. A_UINT32 rx_msdu_cnt_lo;
  16860. A_UINT32 rx_msdu_cnt_hi;
  16861. /* tx msdu byte cnt */
  16862. A_UINT32 tx_msdu_byte_cnt_lo;
  16863. A_UINT32 tx_msdu_byte_cnt_hi;
  16864. /* tx msdu cnt */
  16865. A_UINT32 tx_msdu_cnt_lo;
  16866. A_UINT32 tx_msdu_cnt_hi;
  16867. /* tx excessive retry discarded msdu cnt */
  16868. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16869. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16870. /* TX congestion ctrl msdu drop cnt */
  16871. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16872. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16873. /* discarded tx msdus cnt coz of time to live expiry */
  16874. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16875. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16876. /* tx excessive retry discarded msdu byte cnt */
  16877. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16878. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16879. /* TX congestion ctrl msdu drop byte cnt */
  16880. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16881. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16882. /* discarded tx msdus byte cnt coz of time to live expiry */
  16883. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16884. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16885. /* TQM bypass frame cnt */
  16886. A_UINT32 tqm_bypass_frame_cnt_lo;
  16887. A_UINT32 tqm_bypass_frame_cnt_hi;
  16888. /* TQM bypass byte cnt */
  16889. A_UINT32 tqm_bypass_byte_cnt_lo;
  16890. A_UINT32 tqm_bypass_byte_cnt_hi;
  16891. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16892. /*
  16893. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16894. *
  16895. * @details
  16896. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16897. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16898. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16899. * the default MSDU queues of each of the specified TIDs for the peer
  16900. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16901. * If the default MSDU queues of a given TID within the peer are not linked
  16902. * to a service class, the svc_class_id field for that TID will have a
  16903. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16904. * queues for that TID are not mapped to any service class.
  16905. *
  16906. * |31 16|15 8|7 0|
  16907. * |------------------------------+--------------+--------------|
  16908. * | peer ID | reserved | msg type |
  16909. * |------------------------------+--------------+------+-------|
  16910. * | reserved | svc class ID | TID |
  16911. * |------------------------------------------------------------|
  16912. * ...
  16913. * |------------------------------------------------------------|
  16914. * | reserved | svc class ID | TID |
  16915. * |------------------------------------------------------------|
  16916. * Header fields:
  16917. * dword0 - b'7:0 - msg_type: This will be set to
  16918. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16919. * b'31:16 - peer ID
  16920. * dword1 - b'7:0 - TID
  16921. * b'15:8 - svc class ID
  16922. * (dword2, etc. same format as dword1)
  16923. */
  16924. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16925. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16926. A_UINT32 msg_type :8,
  16927. reserved0 :8,
  16928. peer_id :16;
  16929. struct {
  16930. A_UINT32 tid :8,
  16931. svc_class_id :8,
  16932. reserved1 :16;
  16933. } tid_reports[1/*or more*/];
  16934. } POSTPACK;
  16935. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16936. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16937. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16938. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16939. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16940. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16941. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16942. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16943. do { \
  16944. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16945. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16946. } while (0)
  16947. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16948. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16949. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16950. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16951. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16952. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16953. do { \
  16954. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16955. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16956. } while (0)
  16957. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16958. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16959. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16960. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16961. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16962. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16963. do { \
  16964. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16965. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16966. } while (0)
  16967. /*
  16968. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16969. *
  16970. * @details
  16971. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16972. * flow if the flow is seen the associated service class is conveyed to the
  16973. * target via TCL Data Command. Target on the other hand internally creates the
  16974. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16975. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16976. * the newly created MSDUQ
  16977. *
  16978. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16979. * |------------------------------+------------------------+--------------|
  16980. * | peer ID | HTT qtype | msg type |
  16981. * |---------------------------------+--------------+--+---+-------+------|
  16982. * | reserved |AST list index|FO|WC | HLOS | remap|
  16983. * | | | | | TID | TID |
  16984. * |---------------------+------------------------------------------------|
  16985. * | reserved1 | tgt_opaque_id |
  16986. * |---------------------+------------------------------------------------|
  16987. *
  16988. * Header fields:
  16989. *
  16990. * dword0 - b'7:0 - msg_type: This will be set to
  16991. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16992. * b'15:8 - HTT qtype
  16993. * b'31:16 - peer ID
  16994. *
  16995. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16996. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16997. * hlos_tid : Common to Lithium and Beryllium
  16998. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16999. * TCL Data Command : Beryllium
  17000. * b10 - flow_override (FO), as sent by host in
  17001. * TCL Data Command: Beryllium
  17002. * b11:14 - ast_list_idx
  17003. * Array index into the list of extension AST entries
  17004. * (not the actual AST 16-bit index).
  17005. * The ast_list_idx is one-based, with the following
  17006. * range of values:
  17007. * - legacy targets supporting 16 user-defined
  17008. * MSDU queues: 1-2
  17009. * - legacy targets supporting 48 user-defined
  17010. * MSDU queues: 1-6
  17011. * - new targets: 0 (peer_id is used instead)
  17012. * Note that since ast_list_idx is one-based,
  17013. * the host will need to subtract 1 to use it as an
  17014. * index into a list of extension AST entries.
  17015. * b15:31 - reserved
  17016. *
  17017. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  17018. * unique MSDUQ id in firmware
  17019. * b'24:31 - reserved1
  17020. */
  17021. PREPACK struct htt_t2h_sawf_msduq_event {
  17022. A_UINT32 msg_type : 8,
  17023. htt_qtype : 8,
  17024. peer_id :16;
  17025. A_UINT32 remap_tid : 4,
  17026. hlos_tid : 4,
  17027. who_classify_info_sel : 2,
  17028. flow_override : 1,
  17029. ast_list_idx : 4,
  17030. reserved :17;
  17031. A_UINT32 tgt_opaque_id :24,
  17032. reserved1 : 8;
  17033. } POSTPACK;
  17034. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  17035. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  17036. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  17037. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  17038. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  17039. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  17040. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  17041. do { \
  17042. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  17043. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  17044. } while (0)
  17045. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  17046. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  17047. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  17048. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  17049. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  17050. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  17051. do { \
  17052. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  17053. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  17054. } while (0)
  17055. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  17056. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  17057. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  17058. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  17059. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  17060. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  17061. do { \
  17062. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  17063. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  17064. } while (0)
  17065. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  17066. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  17067. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  17068. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  17069. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  17070. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  17071. do { \
  17072. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  17073. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  17074. } while (0)
  17075. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  17076. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  17077. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  17078. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  17079. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  17080. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  17081. do { \
  17082. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  17083. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  17084. } while (0)
  17085. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  17086. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  17087. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  17088. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  17089. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  17090. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  17091. do { \
  17092. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  17093. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  17094. } while (0)
  17095. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  17096. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  17097. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  17098. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  17099. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  17100. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  17101. do { \
  17102. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  17103. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  17104. } while (0)
  17105. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  17106. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  17107. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  17108. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  17109. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  17110. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  17111. do { \
  17112. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  17113. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  17114. } while (0)
  17115. /**
  17116. * @brief target -> PPDU id format indication
  17117. *
  17118. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  17119. *
  17120. * @details
  17121. * The following field definitions describe the format of the HTT target
  17122. * to host PPDU ID format indication message.
  17123. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  17124. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  17125. * seq_idx :- Sequence control index of this PPDU.
  17126. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  17127. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  17128. * tqm_cmd:-
  17129. *
  17130. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  17131. * |--------------------------------------------------+------------------------|
  17132. * | rsvd0 | msg type |
  17133. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17134. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  17135. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17136. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  17137. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17138. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  17139. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17140. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  17141. * |-----+----------+----------+---------+-----+----------+----------+---------|
  17142. * Where: OF = bit offset, NB = number of bits, V = valid
  17143. * The message is interpreted as follows:
  17144. *
  17145. * dword0 - b'7:0 - msg_type: This will be set to
  17146. * HTT_T2H_PPDU_ID_FMT_IND
  17147. * value: 0x30
  17148. *
  17149. * dword0 - b'31:8 - reserved
  17150. *
  17151. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  17152. *
  17153. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  17154. *
  17155. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  17156. *
  17157. * dword1 - b'15:11 - reserved for future use
  17158. *
  17159. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  17160. *
  17161. * dword1 - b'21:17 - number of bits in ring_id
  17162. *
  17163. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  17164. *
  17165. * dword1 - b'31:27 - reserved for future use
  17166. *
  17167. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  17168. *
  17169. * dword2 - b'5:1 - number of bits in sequence index
  17170. *
  17171. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  17172. *
  17173. * dword2 - b'15:11 - reserved for future use
  17174. *
  17175. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  17176. *
  17177. * dword2 - b'21:17 - number of bits in link_id
  17178. *
  17179. * dword2 - b'26:22 - offset of link_id (in number of bits)
  17180. *
  17181. * dword2 - b'31:27 - reserved for future use
  17182. *
  17183. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  17184. *
  17185. * dword3 - b'5:1 - number of bits in seq_cmd_type
  17186. *
  17187. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  17188. *
  17189. * dword3 - b'15:11 - reserved for future use
  17190. *
  17191. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  17192. *
  17193. * dword3 - b'21:17 - number of bits in tqm_cmd
  17194. *
  17195. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  17196. *
  17197. * dword3 - b'31:27 - reserved for future use
  17198. *
  17199. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  17200. *
  17201. * dword4 - b'5:1 - number of bits in mac_id
  17202. *
  17203. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  17204. *
  17205. * dword4 - b'15:11 - reserved for future use
  17206. *
  17207. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  17208. *
  17209. * dword4 - b'21:17 - number of bits in crc
  17210. *
  17211. * dword4 - b'26:22 - offset of crc (in number of bits)
  17212. *
  17213. * dword4 - b'31:27 - reserved for future use
  17214. *
  17215. */
  17216. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  17217. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  17218. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  17219. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  17220. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  17221. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  17222. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  17223. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  17224. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  17225. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  17226. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  17227. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  17228. /* macros for accessing lower 16 bits in dword */
  17229. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  17230. do { \
  17231. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  17232. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  17233. } while (0)
  17234. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  17235. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  17236. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  17237. do { \
  17238. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  17239. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  17240. } while (0)
  17241. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  17242. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  17243. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  17244. do { \
  17245. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  17246. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  17247. } while (0)
  17248. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  17249. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  17250. /* macros for accessing upper 16 bits in dword */
  17251. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  17252. do { \
  17253. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  17254. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  17255. } while (0)
  17256. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  17257. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  17258. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  17259. do { \
  17260. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  17261. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  17262. } while (0)
  17263. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  17264. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  17265. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  17266. do { \
  17267. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  17268. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  17269. } while (0)
  17270. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  17271. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  17272. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  17273. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17274. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  17275. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17276. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  17277. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17278. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  17279. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17280. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  17281. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17282. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  17283. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17284. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  17285. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17286. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  17287. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17288. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  17289. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17290. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  17291. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17292. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  17293. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17294. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  17295. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17296. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  17297. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17298. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  17299. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17300. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  17301. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17302. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  17303. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17304. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  17305. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17306. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  17307. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17308. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  17309. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  17310. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  17311. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  17312. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  17313. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  17314. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  17315. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  17316. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  17317. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  17318. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  17319. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  17320. /* offsets in number dwords */
  17321. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  17322. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  17323. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  17324. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  17325. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  17326. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  17327. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  17328. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  17329. typedef struct {
  17330. A_UINT32 msg_type: 8, /* bits 7:0 */
  17331. rsvd0: 24;/* bits 31:8 */
  17332. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  17333. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  17334. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  17335. rsvd1: 5, /* bits 15:11 */
  17336. ring_id_valid: 1, /* bits 16:16 */
  17337. ring_id_bits: 5, /* bits 21:17 */
  17338. ring_id_offset: 5, /* bits 26:22 */
  17339. rsvd2: 5; /* bits 31:27 */
  17340. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  17341. seq_idx_bits: 5, /* bits 5:1 */
  17342. seq_idx_offset: 5, /* bits 10:6 */
  17343. rsvd3: 5, /* bits 15:11 */
  17344. link_id_valid: 1, /* bits 16:16 */
  17345. link_id_bits: 5, /* bits 21:17 */
  17346. link_id_offset: 5, /* bits 26:22 */
  17347. rsvd4: 5; /* bits 31:27 */
  17348. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  17349. seq_cmd_type_bits: 5, /* bits 5:1 */
  17350. seq_cmd_type_offset: 5, /* bits 10:6 */
  17351. rsvd5: 5, /* bits 15:11 */
  17352. tqm_cmd_valid: 1, /* bits 16:16 */
  17353. tqm_cmd_bits: 5, /* bits 21:17 */
  17354. tqm_cmd_offset: 5, /* bits 26:12 */
  17355. rsvd6: 5; /* bits 31:27 */
  17356. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  17357. mac_id_bits: 5, /* bits 5:1 */
  17358. mac_id_offset: 5, /* bits 10:6 */
  17359. rsvd8: 5, /* bits 15:11 */
  17360. crc_valid: 1, /* bits 16:16 */
  17361. crc_bits: 5, /* bits 21:17 */
  17362. crc_offset: 5, /* bits 26:12 */
  17363. rsvd9: 5; /* bits 31:27 */
  17364. } htt_t2h_ppdu_id_fmt_ind_t;
  17365. #endif