htt.h 859 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699
  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. */
  229. #define HTT_CURRENT_VERSION_MAJOR 3
  230. #define HTT_CURRENT_VERSION_MINOR 107
  231. #define HTT_NUM_TX_FRAG_DESC 1024
  232. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  233. #define HTT_CHECK_SET_VAL(field, val) \
  234. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  235. /* macros to assist in sign-extending fields from HTT messages */
  236. #define HTT_SIGN_BIT_MASK(field) \
  237. ((field ## _M + (1 << field ## _S)) >> 1)
  238. #define HTT_SIGN_BIT(_val, field) \
  239. (_val & HTT_SIGN_BIT_MASK(field))
  240. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  241. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  242. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  243. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  244. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  245. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  246. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  247. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  248. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  249. /*
  250. * TEMPORARY:
  251. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  252. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  253. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  254. * updated.
  255. */
  256. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  257. /*
  258. * TEMPORARY:
  259. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  260. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  261. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  262. * updated.
  263. */
  264. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  265. /**
  266. * htt_dbg_stats_type -
  267. * bit positions for each stats type within a stats type bitmask
  268. * The bitmask contains 24 bits.
  269. */
  270. enum htt_dbg_stats_type {
  271. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  272. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  273. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  274. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  275. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  276. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  277. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  278. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  279. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  280. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  281. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  282. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  283. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  284. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  285. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  286. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  287. /* bits 16-23 currently reserved */
  288. /* keep this last */
  289. HTT_DBG_NUM_STATS
  290. };
  291. /*=== HTT option selection TLVs ===
  292. * Certain HTT messages have alternatives or options.
  293. * For such cases, the host and target need to agree on which option to use.
  294. * Option specification TLVs can be appended to the VERSION_REQ and
  295. * VERSION_CONF messages to select options other than the default.
  296. * These TLVs are entirely optional - if they are not provided, there is a
  297. * well-defined default for each option. If they are provided, they can be
  298. * provided in any order. Each TLV can be present or absent independent of
  299. * the presence / absence of other TLVs.
  300. *
  301. * The HTT option selection TLVs use the following format:
  302. * |31 16|15 8|7 0|
  303. * |---------------------------------+----------------+----------------|
  304. * | value (payload) | length | tag |
  305. * |-------------------------------------------------------------------|
  306. * The value portion need not be only 2 bytes; it can be extended by any
  307. * integer number of 4-byte units. The total length of the TLV, including
  308. * the tag and length fields, must be a multiple of 4 bytes. The length
  309. * field specifies the total TLV size in 4-byte units. Thus, the typical
  310. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  311. * field, would store 0x1 in its length field, to show that the TLV occupies
  312. * a single 4-byte unit.
  313. */
  314. /*--- TLV header format - applies to all HTT option TLVs ---*/
  315. enum HTT_OPTION_TLV_TAGS {
  316. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  317. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  318. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  319. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  320. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  321. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  322. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  323. };
  324. #define HTT_TCL_METADATA_VER_SZ 4
  325. PREPACK struct htt_option_tlv_header_t {
  326. A_UINT8 tag;
  327. A_UINT8 length;
  328. } POSTPACK;
  329. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  330. #define HTT_OPTION_TLV_TAG_S 0
  331. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  332. #define HTT_OPTION_TLV_LENGTH_S 8
  333. /*
  334. * value0 - 16 bit value field stored in word0
  335. * The TLV's value field may be longer than 2 bytes, in which case
  336. * the remainder of the value is stored in word1, word2, etc.
  337. */
  338. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  339. #define HTT_OPTION_TLV_VALUE0_S 16
  340. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  341. do { \
  342. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  343. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  344. } while (0)
  345. #define HTT_OPTION_TLV_TAG_GET(word) \
  346. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  347. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  348. do { \
  349. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  350. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  351. } while (0)
  352. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  353. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  354. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  355. do { \
  356. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  357. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  358. } while (0)
  359. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  360. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  361. /*--- format of specific HTT option TLVs ---*/
  362. /*
  363. * HTT option TLV for specifying LL bus address size
  364. * Some chips require bus addresses used by the target to access buffers
  365. * within the host's memory to be 32 bits; others require bus addresses
  366. * used by the target to access buffers within the host's memory to be
  367. * 64 bits.
  368. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  369. * a suffix to the VERSION_CONF message to specify which bus address format
  370. * the target requires.
  371. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  372. * default to providing bus addresses to the target in 32-bit format.
  373. */
  374. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  375. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  376. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  377. };
  378. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  379. struct htt_option_tlv_header_t hdr;
  380. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  381. } POSTPACK;
  382. /*
  383. * HTT option TLV for specifying whether HL systems should indicate
  384. * over-the-air tx completion for individual frames, or should instead
  385. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  386. * requests an OTA tx completion for a particular tx frame.
  387. * This option does not apply to LL systems, where the TX_COMPL_IND
  388. * is mandatory.
  389. * This option is primarily intended for HL systems in which the tx frame
  390. * downloads over the host --> target bus are as slow as or slower than
  391. * the transmissions over the WLAN PHY. For cases where the bus is faster
  392. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  393. * and consquently will send one TX_COMPL_IND message that covers several
  394. * tx frames. For cases where the WLAN PHY is faster than the bus,
  395. * the target will end up transmitting very short A-MPDUs, and consequently
  396. * sending many TX_COMPL_IND messages, which each cover a very small number
  397. * of tx frames.
  398. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  399. * a suffix to the VERSION_REQ message to request whether the host desires to
  400. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  401. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  402. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  403. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  404. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  405. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  406. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  407. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  408. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  409. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  410. * TLV.
  411. */
  412. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  413. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  414. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  415. };
  416. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  417. struct htt_option_tlv_header_t hdr;
  418. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  419. } POSTPACK;
  420. /*
  421. * HTT option TLV for specifying how many tx queue groups the target
  422. * may establish.
  423. * This TLV specifies the maximum value the target may send in the
  424. * txq_group_id field of any TXQ_GROUP information elements sent by
  425. * the target to the host. This allows the host to pre-allocate an
  426. * appropriate number of tx queue group structs.
  427. *
  428. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  429. * a suffix to the VERSION_REQ message to specify whether the host supports
  430. * tx queue groups at all, and if so if there is any limit on the number of
  431. * tx queue groups that the host supports.
  432. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  433. * a suffix to the VERSION_CONF message. If the host has specified in the
  434. * VER_REQ message a limit on the number of tx queue groups the host can
  435. * supprt, the target shall limit its specification of the maximum tx groups
  436. * to be no larger than this host-specified limit.
  437. *
  438. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  439. * shall preallocate 4 tx queue group structs, and the target shall not
  440. * specify a txq_group_id larger than 3.
  441. */
  442. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  443. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  444. /*
  445. * values 1 through N specify the max number of tx queue groups
  446. * the sender supports
  447. */
  448. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  449. };
  450. /* TEMPORARY backwards-compatibility alias for a typo fix -
  451. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  452. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  453. * to support the old name (with the typo) until all references to the
  454. * old name are replaced with the new name.
  455. */
  456. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  457. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  458. struct htt_option_tlv_header_t hdr;
  459. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  460. } POSTPACK;
  461. /*
  462. * HTT option TLV for specifying whether the target supports an extended
  463. * version of the HTT tx descriptor. If the target provides this TLV
  464. * and specifies in the TLV that the target supports an extended version
  465. * of the HTT tx descriptor, the target must check the "extension" bit in
  466. * the HTT tx descriptor, and if the extension bit is set, to expect a
  467. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  468. * descriptor. Furthermore, the target must provide room for the HTT
  469. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  470. * This option is intended for systems where the host needs to explicitly
  471. * control the transmission parameters such as tx power for individual
  472. * tx frames.
  473. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  474. * as a suffix to the VERSION_CONF message to explicitly specify whether
  475. * the target supports the HTT tx MSDU extension descriptor.
  476. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  477. * by the host as lack of target support for the HTT tx MSDU extension
  478. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  479. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  480. * the HTT tx MSDU extension descriptor.
  481. * The host is not required to provide the HTT tx MSDU extension descriptor
  482. * just because the target supports it; the target must check the
  483. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  484. * extension descriptor is present.
  485. */
  486. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  487. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  488. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  489. };
  490. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  491. struct htt_option_tlv_header_t hdr;
  492. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  493. } POSTPACK;
  494. /*
  495. * For the tcl data command V2 and higher support added a new
  496. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  497. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  498. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  499. * HTT option TLV for specifying which version of the TCL metadata struct
  500. * should be used:
  501. * V1 -> use htt_tx_tcl_metadata struct
  502. * V2 -> use htt_tx_tcl_metadata_v2 struct
  503. * Old FW will only support V1.
  504. * New FW will support V2. New FW will still support V1, at least during
  505. * a transition period.
  506. * Similarly, old host will only support V1, and new host will support V1 + V2.
  507. *
  508. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  509. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  510. * of TCL metadata the host supports. If the host doesn't provide a
  511. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  512. * is implicitly understood that the host only supports V1.
  513. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  514. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  515. * the host shall use. The target shall only select one of the versions
  516. * supported by the host. If the target doesn't provide a
  517. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  518. * is implicitly understood that the V1 TCL metadata shall be used.
  519. */
  520. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  521. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  522. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  523. };
  524. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  525. struct htt_option_tlv_header_t hdr;
  526. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  527. } POSTPACK;
  528. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  529. HTT_OPTION_TLV_VALUE0_SET(word, value)
  530. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  531. HTT_OPTION_TLV_VALUE0_GET(word)
  532. typedef struct {
  533. union {
  534. /* BIT [11 : 0] :- tag
  535. * BIT [23 : 12] :- length
  536. * BIT [31 : 24] :- reserved
  537. */
  538. A_UINT32 tag__length;
  539. /*
  540. * The following struct is not endian-portable.
  541. * It is suitable for use within the target, which is known to be
  542. * little-endian.
  543. * The host should use the above endian-portable macros to access
  544. * the tag and length bitfields in an endian-neutral manner.
  545. */
  546. struct {
  547. A_UINT32 tag : 12, /* BIT [11 : 0] */
  548. length : 12, /* BIT [23 : 12] */
  549. reserved : 8; /* BIT [31 : 24] */
  550. };
  551. };
  552. } htt_tlv_hdr_t;
  553. /** HTT stats TLV tag values */
  554. typedef enum {
  555. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  556. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  557. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  558. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  559. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  560. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  561. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  562. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  563. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  564. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  565. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  566. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  567. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  568. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  569. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  570. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  571. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  572. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  573. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  574. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  575. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  576. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  577. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  578. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  579. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  580. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  581. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  582. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  583. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  584. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  585. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  586. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  587. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  588. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  589. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  590. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  591. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  592. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  593. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  594. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  595. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  596. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  597. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  598. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  599. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  600. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  601. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  602. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  603. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  604. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  605. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  606. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  607. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  608. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  609. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  610. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  611. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  612. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  613. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  614. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  615. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  616. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  617. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  618. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  619. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  620. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  621. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  622. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  623. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  624. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  625. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  626. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  627. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  628. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  629. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  630. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  631. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  632. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  633. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  634. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  635. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  636. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  637. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  638. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  639. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  640. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  641. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  642. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  643. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  644. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  645. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  646. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  647. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  648. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  649. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  650. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  651. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  652. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  653. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  654. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  655. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  656. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  657. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  658. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  659. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  660. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  661. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  662. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  663. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  664. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  665. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  666. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  667. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  668. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  669. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  670. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  671. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  672. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  673. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  674. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  675. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  676. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  677. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  678. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  679. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  680. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  681. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  682. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  683. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  684. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  685. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  686. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  687. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  688. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  689. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  690. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  691. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  692. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  693. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  694. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  695. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  696. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  697. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  698. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  699. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  700. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  701. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  702. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  703. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  704. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  705. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  706. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  707. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  708. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  709. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  710. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  711. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  712. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  713. HTT_STATS_MAX_TAG,
  714. } htt_stats_tlv_tag_t;
  715. /* retain deprecated enum name as an alias for the current enum name */
  716. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  717. #define HTT_STATS_TLV_TAG_M 0x00000fff
  718. #define HTT_STATS_TLV_TAG_S 0
  719. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  720. #define HTT_STATS_TLV_LENGTH_S 12
  721. #define HTT_STATS_TLV_TAG_GET(_var) \
  722. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  723. HTT_STATS_TLV_TAG_S)
  724. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  725. do { \
  726. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  727. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  728. } while (0)
  729. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  730. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  731. HTT_STATS_TLV_LENGTH_S)
  732. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  733. do { \
  734. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  735. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  736. } while (0)
  737. /*=== host -> target messages ===============================================*/
  738. enum htt_h2t_msg_type {
  739. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  740. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  741. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  742. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  743. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  744. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  745. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  746. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  747. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  748. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  749. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  750. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  751. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  752. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  753. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  754. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  755. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  756. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  757. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  758. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  759. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  760. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  761. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  762. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  763. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  764. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  765. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  766. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  767. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  768. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  769. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  770. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  771. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  772. /* keep this last */
  773. HTT_H2T_NUM_MSGS
  774. };
  775. /*
  776. * HTT host to target message type -
  777. * stored in bits 7:0 of the first word of the message
  778. */
  779. #define HTT_H2T_MSG_TYPE_M 0xff
  780. #define HTT_H2T_MSG_TYPE_S 0
  781. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  782. do { \
  783. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  784. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  785. } while (0)
  786. #define HTT_H2T_MSG_TYPE_GET(word) \
  787. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  788. /**
  789. * @brief host -> target version number request message definition
  790. *
  791. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  792. *
  793. *
  794. * |31 24|23 16|15 8|7 0|
  795. * |----------------+----------------+----------------+----------------|
  796. * | reserved | msg type |
  797. * |-------------------------------------------------------------------|
  798. * : option request TLV (optional) |
  799. * :...................................................................:
  800. *
  801. * The VER_REQ message may consist of a single 4-byte word, or may be
  802. * extended with TLVs that specify which HTT options the host is requesting
  803. * from the target.
  804. * The following option TLVs may be appended to the VER_REQ message:
  805. * - HL_SUPPRESS_TX_COMPL_IND
  806. * - HL_MAX_TX_QUEUE_GROUPS
  807. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  808. * may be appended to the VER_REQ message (but only one TLV of each type).
  809. *
  810. * Header fields:
  811. * - MSG_TYPE
  812. * Bits 7:0
  813. * Purpose: identifies this as a version number request message
  814. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  815. */
  816. #define HTT_VER_REQ_BYTES 4
  817. /* TBDXXX: figure out a reasonable number */
  818. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  819. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  820. /**
  821. * @brief HTT tx MSDU descriptor
  822. *
  823. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  824. *
  825. * @details
  826. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  827. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  828. * the target firmware needs for the FW's tx processing, particularly
  829. * for creating the HW msdu descriptor.
  830. * The same HTT tx descriptor is used for HL and LL systems, though
  831. * a few fields within the tx descriptor are used only by LL or
  832. * only by HL.
  833. * The HTT tx descriptor is defined in two manners: by a struct with
  834. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  835. * definitions.
  836. * The target should use the struct def, for simplicitly and clarity,
  837. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  838. * neutral. Specifically, the host shall use the get/set macros built
  839. * around the mask + shift defs.
  840. */
  841. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  842. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  843. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  844. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  845. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  846. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  847. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  848. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  849. #define HTT_TX_VDEV_ID_WORD 0
  850. #define HTT_TX_VDEV_ID_MASK 0x3f
  851. #define HTT_TX_VDEV_ID_SHIFT 16
  852. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  853. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  854. #define HTT_TX_MSDU_LEN_DWORD 1
  855. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  856. /*
  857. * HTT_VAR_PADDR macros
  858. * Allow physical / bus addresses to be either a single 32-bit value,
  859. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  860. */
  861. #define HTT_VAR_PADDR32(var_name) \
  862. A_UINT32 var_name
  863. #define HTT_VAR_PADDR64_LE(var_name) \
  864. struct { \
  865. /* little-endian: lo precedes hi */ \
  866. A_UINT32 lo; \
  867. A_UINT32 hi; \
  868. } var_name
  869. /*
  870. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  871. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  872. * addresses are stored in a XXX-bit field.
  873. * This macro is used to define both htt_tx_msdu_desc32_t and
  874. * htt_tx_msdu_desc64_t structs.
  875. */
  876. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  877. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  878. { \
  879. /* DWORD 0: flags and meta-data */ \
  880. A_UINT32 \
  881. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  882. \
  883. /* pkt_subtype - \
  884. * Detailed specification of the tx frame contents, extending the \
  885. * general specification provided by pkt_type. \
  886. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  887. * pkt_type | pkt_subtype \
  888. * ============================================================== \
  889. * 802.3 | bit 0:3 - Reserved \
  890. * | bit 4: 0x0 - Copy-Engine Classification Results \
  891. * | not appended to the HTT message \
  892. * | 0x1 - Copy-Engine Classification Results \
  893. * | appended to the HTT message in the \
  894. * | format: \
  895. * | [HTT tx desc, frame header, \
  896. * | CE classification results] \
  897. * | The CE classification results begin \
  898. * | at the next 4-byte boundary after \
  899. * | the frame header. \
  900. * ------------+------------------------------------------------- \
  901. * Eth2 | bit 0:3 - Reserved \
  902. * | bit 4: 0x0 - Copy-Engine Classification Results \
  903. * | not appended to the HTT message \
  904. * | 0x1 - Copy-Engine Classification Results \
  905. * | appended to the HTT message. \
  906. * | See the above specification of the \
  907. * | CE classification results location. \
  908. * ------------+------------------------------------------------- \
  909. * native WiFi | bit 0:3 - Reserved \
  910. * | bit 4: 0x0 - Copy-Engine Classification Results \
  911. * | not appended to the HTT message \
  912. * | 0x1 - Copy-Engine Classification Results \
  913. * | appended to the HTT message. \
  914. * | See the above specification of the \
  915. * | CE classification results location. \
  916. * ------------+------------------------------------------------- \
  917. * mgmt | 0x0 - 802.11 MAC header absent \
  918. * | 0x1 - 802.11 MAC header present \
  919. * ------------+------------------------------------------------- \
  920. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  921. * | 0x1 - 802.11 MAC header present \
  922. * | bit 1: 0x0 - allow aggregation \
  923. * | 0x1 - don't allow aggregation \
  924. * | bit 2: 0x0 - perform encryption \
  925. * | 0x1 - don't perform encryption \
  926. * | bit 3: 0x0 - perform tx classification / queuing \
  927. * | 0x1 - don't perform tx classification; \
  928. * | insert the frame into the "misc" \
  929. * | tx queue \
  930. * | bit 4: 0x0 - Copy-Engine Classification Results \
  931. * | not appended to the HTT message \
  932. * | 0x1 - Copy-Engine Classification Results \
  933. * | appended to the HTT message. \
  934. * | See the above specification of the \
  935. * | CE classification results location. \
  936. */ \
  937. pkt_subtype: 5, \
  938. \
  939. /* pkt_type - \
  940. * General specification of the tx frame contents. \
  941. * The htt_pkt_type enum should be used to specify and check the \
  942. * value of this field. \
  943. */ \
  944. pkt_type: 3, \
  945. \
  946. /* vdev_id - \
  947. * ID for the vdev that is sending this tx frame. \
  948. * For certain non-standard packet types, e.g. pkt_type == raw \
  949. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  950. * This field is used primarily for determining where to queue \
  951. * broadcast and multicast frames. \
  952. */ \
  953. vdev_id: 6, \
  954. /* ext_tid - \
  955. * The extended traffic ID. \
  956. * If the TID is unknown, the extended TID is set to \
  957. * HTT_TX_EXT_TID_INVALID. \
  958. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  959. * value of the QoS TID. \
  960. * If the tx frame is non-QoS data, then the extended TID is set to \
  961. * HTT_TX_EXT_TID_NON_QOS. \
  962. * If the tx frame is multicast or broadcast, then the extended TID \
  963. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  964. */ \
  965. ext_tid: 5, \
  966. \
  967. /* postponed - \
  968. * This flag indicates whether the tx frame has been downloaded to \
  969. * the target before but discarded by the target, and now is being \
  970. * downloaded again; or if this is a new frame that is being \
  971. * downloaded for the first time. \
  972. * This flag allows the target to determine the correct order for \
  973. * transmitting new vs. old frames. \
  974. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  975. * This flag only applies to HL systems, since in LL systems, \
  976. * the tx flow control is handled entirely within the target. \
  977. */ \
  978. postponed: 1, \
  979. \
  980. /* extension - \
  981. * This flag indicates whether a HTT tx MSDU extension descriptor \
  982. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  983. * \
  984. * 0x0 - no extension MSDU descriptor is present \
  985. * 0x1 - an extension MSDU descriptor immediately follows the \
  986. * regular MSDU descriptor \
  987. */ \
  988. extension: 1, \
  989. \
  990. /* cksum_offload - \
  991. * This flag indicates whether checksum offload is enabled or not \
  992. * for this frame. Target FW use this flag to turn on HW checksumming \
  993. * 0x0 - No checksum offload \
  994. * 0x1 - L3 header checksum only \
  995. * 0x2 - L4 checksum only \
  996. * 0x3 - L3 header checksum + L4 checksum \
  997. */ \
  998. cksum_offload: 2, \
  999. \
  1000. /* tx_comp_req - \
  1001. * This flag indicates whether Tx Completion \
  1002. * from fw is required or not. \
  1003. * This flag is only relevant if tx completion is not \
  1004. * universally enabled. \
  1005. * For all LL systems, tx completion is mandatory, \
  1006. * so this flag will be irrelevant. \
  1007. * For HL systems tx completion is optional, but HL systems in which \
  1008. * the bus throughput exceeds the WLAN throughput will \
  1009. * probably want to always use tx completion, and thus \
  1010. * would not check this flag. \
  1011. * This flag is required when tx completions are not used universally, \
  1012. * but are still required for certain tx frames for which \
  1013. * an OTA delivery acknowledgment is needed by the host. \
  1014. * In practice, this would be for HL systems in which the \
  1015. * bus throughput is less than the WLAN throughput. \
  1016. * \
  1017. * 0x0 - Tx Completion Indication from Fw not required \
  1018. * 0x1 - Tx Completion Indication from Fw is required \
  1019. */ \
  1020. tx_compl_req: 1; \
  1021. \
  1022. \
  1023. /* DWORD 1: MSDU length and ID */ \
  1024. A_UINT32 \
  1025. len: 16, /* MSDU length, in bytes */ \
  1026. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1027. * and this id is used to calculate fragmentation \
  1028. * descriptor pointer inside the target based on \
  1029. * the base address, configured inside the target. \
  1030. */ \
  1031. \
  1032. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1033. /* frags_desc_ptr - \
  1034. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1035. * where the tx frame's fragments reside in memory. \
  1036. * This field only applies to LL systems, since in HL systems the \
  1037. * (degenerate single-fragment) fragmentation descriptor is created \
  1038. * within the target. \
  1039. */ \
  1040. _paddr__frags_desc_ptr_; \
  1041. \
  1042. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1043. /* \
  1044. * Peer ID : Target can use this value to know which peer-id packet \
  1045. * destined to. \
  1046. * It's intended to be specified by host in case of NAWDS. \
  1047. */ \
  1048. A_UINT16 peerid; \
  1049. \
  1050. /* \
  1051. * Channel frequency: This identifies the desired channel \
  1052. * frequency (in mhz) for tx frames. This is used by FW to help \
  1053. * determine when it is safe to transmit or drop frames for \
  1054. * off-channel operation. \
  1055. * The default value of zero indicates to FW that the corresponding \
  1056. * VDEV's home channel (if there is one) is the desired channel \
  1057. * frequency. \
  1058. */ \
  1059. A_UINT16 chanfreq; \
  1060. \
  1061. /* Reason reserved is commented is increasing the htt structure size \
  1062. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1063. * A_UINT32 reserved_dword3_bits0_31; \
  1064. */ \
  1065. } POSTPACK
  1066. /* define a htt_tx_msdu_desc32_t type */
  1067. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1068. /* define a htt_tx_msdu_desc64_t type */
  1069. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1070. /*
  1071. * Make htt_tx_msdu_desc_t be an alias for either
  1072. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1073. */
  1074. #if HTT_PADDR64
  1075. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1076. #else
  1077. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1078. #endif
  1079. /* decriptor information for Management frame*/
  1080. /*
  1081. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1082. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1083. */
  1084. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1085. extern A_UINT32 mgmt_hdr_len;
  1086. PREPACK struct htt_mgmt_tx_desc_t {
  1087. A_UINT32 msg_type;
  1088. #if HTT_PADDR64
  1089. A_UINT64 frag_paddr; /* DMAble address of the data */
  1090. #else
  1091. A_UINT32 frag_paddr; /* DMAble address of the data */
  1092. #endif
  1093. A_UINT32 desc_id; /* returned to host during completion
  1094. * to free the meory*/
  1095. A_UINT32 len; /* Fragment length */
  1096. A_UINT32 vdev_id; /* virtual device ID*/
  1097. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1098. } POSTPACK;
  1099. PREPACK struct htt_mgmt_tx_compl_ind {
  1100. A_UINT32 desc_id;
  1101. A_UINT32 status;
  1102. } POSTPACK;
  1103. /*
  1104. * This SDU header size comes from the summation of the following:
  1105. * 1. Max of:
  1106. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1107. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1108. * b. 802.11 header, for raw frames: 36 bytes
  1109. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1110. * QoS header, HT header)
  1111. * c. 802.3 header, for ethernet frames: 14 bytes
  1112. * (destination address, source address, ethertype / length)
  1113. * 2. Max of:
  1114. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1115. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1116. * 3. 802.1Q VLAN header: 4 bytes
  1117. * 4. LLC/SNAP header: 8 bytes
  1118. */
  1119. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1120. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1121. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1122. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1123. A_COMPILE_TIME_ASSERT(
  1124. htt_encap_hdr_size_max_check_nwifi,
  1125. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1126. A_COMPILE_TIME_ASSERT(
  1127. htt_encap_hdr_size_max_check_enet,
  1128. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1129. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1130. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1131. #define HTT_TX_HDR_SIZE_802_1Q 4
  1132. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1133. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1134. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1135. HTT_TX_HDR_SIZE_802_1Q + \
  1136. HTT_TX_HDR_SIZE_LLC_SNAP)
  1137. #define HTT_HL_TX_FRM_HDR_LEN \
  1138. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1139. #define HTT_LL_TX_FRM_HDR_LEN \
  1140. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1141. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1142. /* dword 0 */
  1143. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1144. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1145. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1146. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1147. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1148. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1149. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1150. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1151. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1152. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1153. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1154. #define HTT_TX_DESC_PKT_TYPE_S 13
  1155. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1156. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1157. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1158. #define HTT_TX_DESC_VDEV_ID_S 16
  1159. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1160. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1161. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1162. #define HTT_TX_DESC_EXT_TID_S 22
  1163. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1164. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1165. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1166. #define HTT_TX_DESC_POSTPONED_S 27
  1167. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1168. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1169. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1170. #define HTT_TX_DESC_EXTENSION_S 28
  1171. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1172. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1173. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1174. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1175. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1176. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1177. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1178. #define HTT_TX_DESC_TX_COMP_S 31
  1179. /* dword 1 */
  1180. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1181. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1182. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1183. #define HTT_TX_DESC_FRM_LEN_S 0
  1184. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1185. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1186. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1187. #define HTT_TX_DESC_FRM_ID_S 16
  1188. /* dword 2 */
  1189. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1190. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1191. /* for systems using 64-bit format for bus addresses */
  1192. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1193. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1194. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1195. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1196. /* for systems using 32-bit format for bus addresses */
  1197. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1198. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1199. /* dword 3 */
  1200. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1201. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1202. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1203. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1204. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1205. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1206. #if HTT_PADDR64
  1207. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1208. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1209. #else
  1210. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1211. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1212. #endif
  1213. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1214. #define HTT_TX_DESC_PEER_ID_S 0
  1215. /*
  1216. * TEMPORARY:
  1217. * The original definitions for the PEER_ID fields contained typos
  1218. * (with _DESC_PADDR appended to this PEER_ID field name).
  1219. * Retain deprecated original names for PEER_ID fields until all code that
  1220. * refers to them has been updated.
  1221. */
  1222. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1223. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1224. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1225. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1226. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1227. HTT_TX_DESC_PEER_ID_M
  1228. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1229. HTT_TX_DESC_PEER_ID_S
  1230. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1231. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1232. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1233. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1234. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1235. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1236. #if HTT_PADDR64
  1237. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1238. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1239. #else
  1240. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1241. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1242. #endif
  1243. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1244. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1245. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1246. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1247. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1248. do { \
  1249. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1250. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1251. } while (0)
  1252. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1253. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1254. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1255. do { \
  1256. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1257. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1258. } while (0)
  1259. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1260. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1261. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1262. do { \
  1263. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1264. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1265. } while (0)
  1266. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1267. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1268. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1269. do { \
  1270. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1271. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1272. } while (0)
  1273. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1274. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1275. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1276. do { \
  1277. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1278. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1279. } while (0)
  1280. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1281. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1282. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1283. do { \
  1284. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1285. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1286. } while (0)
  1287. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1288. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1289. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1290. do { \
  1291. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1292. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1293. } while (0)
  1294. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1295. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1296. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1297. do { \
  1298. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1299. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1300. } while (0)
  1301. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1302. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1303. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1304. do { \
  1305. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1306. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1307. } while (0)
  1308. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1309. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1310. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1311. do { \
  1312. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1313. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1314. } while (0)
  1315. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1316. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1317. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1318. do { \
  1319. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1320. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1321. } while (0)
  1322. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1323. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1324. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1325. do { \
  1326. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1327. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1328. } while (0)
  1329. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1330. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1331. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1332. do { \
  1333. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1334. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1335. } while (0)
  1336. /* enums used in the HTT tx MSDU extension descriptor */
  1337. enum {
  1338. htt_tx_guard_interval_regular = 0,
  1339. htt_tx_guard_interval_short = 1,
  1340. };
  1341. enum {
  1342. htt_tx_preamble_type_ofdm = 0,
  1343. htt_tx_preamble_type_cck = 1,
  1344. htt_tx_preamble_type_ht = 2,
  1345. htt_tx_preamble_type_vht = 3,
  1346. };
  1347. enum {
  1348. htt_tx_bandwidth_5MHz = 0,
  1349. htt_tx_bandwidth_10MHz = 1,
  1350. htt_tx_bandwidth_20MHz = 2,
  1351. htt_tx_bandwidth_40MHz = 3,
  1352. htt_tx_bandwidth_80MHz = 4,
  1353. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1354. };
  1355. /**
  1356. * @brief HTT tx MSDU extension descriptor
  1357. * @details
  1358. * If the target supports HTT tx MSDU extension descriptors, the host has
  1359. * the option of appending the following struct following the regular
  1360. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1361. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1362. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1363. * tx specs for each frame.
  1364. */
  1365. PREPACK struct htt_tx_msdu_desc_ext_t {
  1366. /* DWORD 0: flags */
  1367. A_UINT32
  1368. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1369. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1370. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1371. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1372. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1373. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1374. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1375. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1376. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1377. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1378. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1379. /* DWORD 1: tx power, tx rate, tx BW */
  1380. A_UINT32
  1381. /* pwr -
  1382. * Specify what power the tx frame needs to be transmitted at.
  1383. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1384. * The value needs to be appropriately sign-extended when extracting
  1385. * the value from the message and storing it in a variable that is
  1386. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1387. * automatically handles this sign-extension.)
  1388. * If the transmission uses multiple tx chains, this power spec is
  1389. * the total transmit power, assuming incoherent combination of
  1390. * per-chain power to produce the total power.
  1391. */
  1392. pwr: 8,
  1393. /* mcs_mask -
  1394. * Specify the allowable values for MCS index (modulation and coding)
  1395. * to use for transmitting the frame.
  1396. *
  1397. * For HT / VHT preamble types, this mask directly corresponds to
  1398. * the HT or VHT MCS indices that are allowed. For each bit N set
  1399. * within the mask, MCS index N is allowed for transmitting the frame.
  1400. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1401. * rates versus OFDM rates, so the host has the option of specifying
  1402. * that the target must transmit the frame with CCK or OFDM rates
  1403. * (not HT or VHT), but leaving the decision to the target whether
  1404. * to use CCK or OFDM.
  1405. *
  1406. * For CCK and OFDM, the bits within this mask are interpreted as
  1407. * follows:
  1408. * bit 0 -> CCK 1 Mbps rate is allowed
  1409. * bit 1 -> CCK 2 Mbps rate is allowed
  1410. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1411. * bit 3 -> CCK 11 Mbps rate is allowed
  1412. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1413. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1414. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1415. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1416. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1417. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1418. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1419. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1420. *
  1421. * The MCS index specification needs to be compatible with the
  1422. * bandwidth mask specification. For example, a MCS index == 9
  1423. * specification is inconsistent with a preamble type == VHT,
  1424. * Nss == 1, and channel bandwidth == 20 MHz.
  1425. *
  1426. * Furthermore, the host has only a limited ability to specify to
  1427. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1428. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1429. */
  1430. mcs_mask: 12,
  1431. /* nss_mask -
  1432. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1433. * Each bit in this mask corresponds to a Nss value:
  1434. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1435. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1436. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1437. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1438. * The values in the Nss mask must be suitable for the recipient, e.g.
  1439. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1440. * recipient which only supports 2x2 MIMO.
  1441. */
  1442. nss_mask: 4,
  1443. /* guard_interval -
  1444. * Specify a htt_tx_guard_interval enum value to indicate whether
  1445. * the transmission should use a regular guard interval or a
  1446. * short guard interval.
  1447. */
  1448. guard_interval: 1,
  1449. /* preamble_type_mask -
  1450. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1451. * may choose from for transmitting this frame.
  1452. * The bits in this mask correspond to the values in the
  1453. * htt_tx_preamble_type enum. For example, to allow the target
  1454. * to transmit the frame as either CCK or OFDM, this field would
  1455. * be set to
  1456. * (1 << htt_tx_preamble_type_ofdm) |
  1457. * (1 << htt_tx_preamble_type_cck)
  1458. */
  1459. preamble_type_mask: 4,
  1460. reserved1_31_29: 3; /* unused, set to 0x0 */
  1461. /* DWORD 2: tx chain mask, tx retries */
  1462. A_UINT32
  1463. /* chain_mask - specify which chains to transmit from */
  1464. chain_mask: 4,
  1465. /* retry_limit -
  1466. * Specify the maximum number of transmissions, including the
  1467. * initial transmission, to attempt before giving up if no ack
  1468. * is received.
  1469. * If the tx rate is specified, then all retries shall use the
  1470. * same rate as the initial transmission.
  1471. * If no tx rate is specified, the target can choose whether to
  1472. * retain the original rate during the retransmissions, or to
  1473. * fall back to a more robust rate.
  1474. */
  1475. retry_limit: 4,
  1476. /* bandwidth_mask -
  1477. * Specify what channel widths may be used for the transmission.
  1478. * A value of zero indicates "don't care" - the target may choose
  1479. * the transmission bandwidth.
  1480. * The bits within this mask correspond to the htt_tx_bandwidth
  1481. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1482. * The bandwidth_mask must be consistent with the preamble_type_mask
  1483. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1484. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1485. */
  1486. bandwidth_mask: 6,
  1487. reserved2_31_14: 18; /* unused, set to 0x0 */
  1488. /* DWORD 3: tx expiry time (TSF) LSBs */
  1489. A_UINT32 expire_tsf_lo;
  1490. /* DWORD 4: tx expiry time (TSF) MSBs */
  1491. A_UINT32 expire_tsf_hi;
  1492. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1493. } POSTPACK;
  1494. /* DWORD 0 */
  1495. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1496. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1497. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1498. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1499. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1500. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1501. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1502. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1503. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1504. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1505. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1506. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1507. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1508. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1509. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1510. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1511. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1512. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1514. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1515. /* DWORD 1 */
  1516. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1517. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1518. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1519. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1520. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1521. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1522. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1523. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1524. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1525. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1526. /* DWORD 2 */
  1527. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1528. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1529. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1530. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1531. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1532. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1533. /* DWORD 0 */
  1534. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1535. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1536. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1537. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1538. do { \
  1539. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1540. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1541. } while (0)
  1542. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1543. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1544. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1545. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1546. do { \
  1547. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1548. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1549. } while (0)
  1550. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1551. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1552. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1553. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1554. do { \
  1555. HTT_CHECK_SET_VAL( \
  1556. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1557. ((_var) |= ((_val) \
  1558. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1559. } while (0)
  1560. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1561. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1562. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1563. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1564. do { \
  1565. HTT_CHECK_SET_VAL( \
  1566. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1567. ((_var) |= ((_val) \
  1568. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1569. } while (0)
  1570. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1571. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1572. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1573. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1574. do { \
  1575. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1576. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1577. } while (0)
  1578. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1579. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1580. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1581. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1582. do { \
  1583. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1584. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1585. } while (0)
  1586. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1587. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1588. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1589. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1590. do { \
  1591. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1592. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1593. } while (0)
  1594. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1595. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1596. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1597. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1598. do { \
  1599. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1600. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1601. } while (0)
  1602. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1603. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1604. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1605. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1606. do { \
  1607. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1608. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1609. } while (0)
  1610. /* DWORD 1 */
  1611. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1612. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1613. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1614. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1615. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1616. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1617. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1618. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1619. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1620. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1621. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1622. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1623. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1624. do { \
  1625. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1626. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1627. } while (0)
  1628. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1629. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1630. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1631. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1632. do { \
  1633. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1634. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1635. } while (0)
  1636. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1637. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1638. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1639. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1640. do { \
  1641. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1642. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1643. } while (0)
  1644. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1645. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1646. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1647. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1648. do { \
  1649. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1650. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1651. } while (0)
  1652. /* DWORD 2 */
  1653. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1654. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1655. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1656. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1657. do { \
  1658. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1659. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1660. } while (0)
  1661. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1662. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1663. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1664. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1665. do { \
  1666. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1667. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1668. } while (0)
  1669. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1670. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1671. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1672. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1673. do { \
  1674. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1675. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1676. } while (0)
  1677. typedef enum {
  1678. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1679. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1680. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1681. } htt_11ax_ltf_subtype_t;
  1682. typedef enum {
  1683. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1684. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1685. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1686. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1687. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1688. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1689. } htt_tx_ext2_preamble_type_t;
  1690. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1691. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1692. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1693. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1694. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1695. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1696. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1697. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1698. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1699. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1700. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1701. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1702. /**
  1703. * @brief HTT tx MSDU extension descriptor v2
  1704. * @details
  1705. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1706. * is received as tcl_exit_base->host_meta_info in firmware.
  1707. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1708. * are already part of tcl_exit_base.
  1709. */
  1710. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1711. /* DWORD 0: flags */
  1712. A_UINT32
  1713. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1714. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1715. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1716. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1717. valid_retries : 1, /* if set, tx retries spec is valid */
  1718. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1719. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1720. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1721. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1722. valid_key_flags : 1, /* if set, key flags is valid */
  1723. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1724. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1725. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1726. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1727. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1728. 1 = ENCRYPT,
  1729. 2 ~ 3 - Reserved */
  1730. /* retry_limit -
  1731. * Specify the maximum number of transmissions, including the
  1732. * initial transmission, to attempt before giving up if no ack
  1733. * is received.
  1734. * If the tx rate is specified, then all retries shall use the
  1735. * same rate as the initial transmission.
  1736. * If no tx rate is specified, the target can choose whether to
  1737. * retain the original rate during the retransmissions, or to
  1738. * fall back to a more robust rate.
  1739. */
  1740. retry_limit : 4,
  1741. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1742. * Valid only for 11ax preamble types HE_SU
  1743. * and HE_EXT_SU
  1744. */
  1745. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1746. * Valid only for 11ax preamble types HE_SU
  1747. * and HE_EXT_SU
  1748. */
  1749. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1750. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1751. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1752. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1753. */
  1754. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1755. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1756. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1757. * Use cases:
  1758. * Any time firmware uses TQM-BYPASS for Data
  1759. * TID, firmware expect host to set this bit.
  1760. */
  1761. /* DWORD 1: tx power, tx rate */
  1762. A_UINT32
  1763. power : 8, /* unit of the power field is 0.5 dbm
  1764. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1765. * signed value ranging from -64dbm to 63.5 dbm
  1766. */
  1767. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1768. * Setting more than one MCS isn't currently
  1769. * supported by the target (but is supported
  1770. * in the interface in case in the future
  1771. * the target supports specifications of
  1772. * a limited set of MCS values.
  1773. */
  1774. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1775. * Setting more than one Nss isn't currently
  1776. * supported by the target (but is supported
  1777. * in the interface in case in the future
  1778. * the target supports specifications of
  1779. * a limited set of Nss values.
  1780. */
  1781. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1782. update_peer_cache : 1; /* When set these custom values will be
  1783. * used for all packets, until the next
  1784. * update via this ext header.
  1785. * This is to make sure not all packets
  1786. * need to include this header.
  1787. */
  1788. /* DWORD 2: tx chain mask, tx retries */
  1789. A_UINT32
  1790. /* chain_mask - specify which chains to transmit from */
  1791. chain_mask : 8,
  1792. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1793. * TODO: Update Enum values for key_flags
  1794. */
  1795. /*
  1796. * Channel frequency: This identifies the desired channel
  1797. * frequency (in MHz) for tx frames. This is used by FW to help
  1798. * determine when it is safe to transmit or drop frames for
  1799. * off-channel operation.
  1800. * The default value of zero indicates to FW that the corresponding
  1801. * VDEV's home channel (if there is one) is the desired channel
  1802. * frequency.
  1803. */
  1804. chanfreq : 16;
  1805. /* DWORD 3: tx expiry time (TSF) LSBs */
  1806. A_UINT32 expire_tsf_lo;
  1807. /* DWORD 4: tx expiry time (TSF) MSBs */
  1808. A_UINT32 expire_tsf_hi;
  1809. /* DWORD 5: flags to control routing / processing of the MSDU */
  1810. A_UINT32
  1811. /* learning_frame
  1812. * When this flag is set, this frame will be dropped by FW
  1813. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1814. */
  1815. learning_frame : 1,
  1816. /* send_as_standalone
  1817. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1818. * i.e. with no A-MSDU or A-MPDU aggregation.
  1819. * The scope is extended to other use-cases.
  1820. */
  1821. send_as_standalone : 1,
  1822. /* is_host_opaque_valid
  1823. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1824. * with valid information.
  1825. */
  1826. is_host_opaque_valid : 1,
  1827. traffic_end_indication: 1,
  1828. rsvd0 : 28;
  1829. /* DWORD 6 : Host opaque cookie for special frames */
  1830. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1831. rsvd1 : 16;
  1832. /*
  1833. * This structure can be expanded further up to 40 bytes
  1834. * by adding further DWORDs as needed.
  1835. */
  1836. } POSTPACK;
  1837. /* DWORD 0 */
  1838. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1839. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1840. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1841. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1842. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1843. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1844. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1845. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1846. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1847. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1848. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1849. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1850. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1851. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1852. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1853. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1854. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1855. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1857. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1862. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1863. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1864. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1865. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1866. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1867. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1868. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1869. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1870. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1871. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1872. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1873. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1874. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1875. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1876. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1877. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1878. /* DWORD 1 */
  1879. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1880. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1881. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1882. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1883. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1884. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1885. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1886. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1887. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1888. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1889. /* DWORD 2 */
  1890. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1891. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1892. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1893. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1894. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1895. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1896. /* DWORD 5 */
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1898. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1899. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1900. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1901. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1902. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1903. /* DWORD 6 */
  1904. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1905. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1906. /* DWORD 0 */
  1907. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1908. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1909. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1910. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1911. do { \
  1912. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1913. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1914. } while (0)
  1915. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1916. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1917. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1918. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1919. do { \
  1920. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1921. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1922. } while (0)
  1923. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1924. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1925. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1926. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1927. do { \
  1928. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1929. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1930. } while (0)
  1931. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1932. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1933. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1934. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1935. do { \
  1936. HTT_CHECK_SET_VAL( \
  1937. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1938. ((_var) |= ((_val) \
  1939. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1940. } while (0)
  1941. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1942. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1943. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1944. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1945. do { \
  1946. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1947. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1948. } while (0)
  1949. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1950. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1951. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1952. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1953. do { \
  1954. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1955. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1956. } while (0)
  1957. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1958. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1959. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1960. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1961. do { \
  1962. HTT_CHECK_SET_VAL( \
  1963. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1964. ((_var) |= ((_val) \
  1965. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1966. } while (0)
  1967. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1968. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1969. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1970. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1971. do { \
  1972. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1973. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1974. } while (0)
  1975. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1976. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1977. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1978. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1979. do { \
  1980. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1981. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1982. } while (0)
  1983. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1984. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1985. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1986. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1987. do { \
  1988. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1989. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1990. } while (0)
  1991. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1992. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1993. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1994. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1995. do { \
  1996. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1997. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1998. } while (0)
  1999. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  2000. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  2001. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2002. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2003. do { \
  2004. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2005. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2006. } while (0)
  2007. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2008. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2009. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2010. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2011. do { \
  2012. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2013. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2014. } while (0)
  2015. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2016. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2017. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2018. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2019. do { \
  2020. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2021. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2022. } while (0)
  2023. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2024. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2025. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2026. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2027. do { \
  2028. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2029. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2030. } while (0)
  2031. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2032. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2033. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2034. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2035. do { \
  2036. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2037. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2038. } while (0)
  2039. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2040. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2041. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2042. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2043. do { \
  2044. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2045. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2046. } while (0)
  2047. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2048. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2049. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2050. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2051. do { \
  2052. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2053. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2054. } while (0)
  2055. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2056. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2057. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2058. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2059. do { \
  2060. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2061. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2062. } while (0)
  2063. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2064. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2065. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2066. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2067. do { \
  2068. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2069. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2070. } while (0)
  2071. /* DWORD 1 */
  2072. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2073. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2074. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2075. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2076. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2077. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2078. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2079. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2080. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2081. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2082. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2083. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2084. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2085. do { \
  2086. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2087. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2088. } while (0)
  2089. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2090. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2091. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2092. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2093. do { \
  2094. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2095. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2096. } while (0)
  2097. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2098. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2099. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2100. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2101. do { \
  2102. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2103. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2104. } while (0)
  2105. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2106. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2107. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2108. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2109. do { \
  2110. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2111. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2112. } while (0)
  2113. /* DWORD 2 */
  2114. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2115. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2116. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2117. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2118. do { \
  2119. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2120. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2121. } while (0)
  2122. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2123. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2124. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2125. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2126. do { \
  2127. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2128. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2129. } while (0)
  2130. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2131. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2132. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2133. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2134. do { \
  2135. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2136. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2137. } while (0)
  2138. /* DWORD 5 */
  2139. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2140. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2141. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2142. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2143. do { \
  2144. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2145. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2146. } while (0)
  2147. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2148. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2149. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2150. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2151. do { \
  2152. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2153. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2154. } while (0)
  2155. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2156. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2157. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2158. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2159. do { \
  2160. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2161. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2162. } while (0)
  2163. /* DWORD 6 */
  2164. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2165. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2166. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2167. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2168. do { \
  2169. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2170. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2171. } while (0)
  2172. typedef enum {
  2173. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2174. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2175. } htt_tcl_metadata_type;
  2176. /**
  2177. * @brief HTT TCL command number format
  2178. * @details
  2179. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2180. * available to firmware as tcl_exit_base->tcl_status_number.
  2181. * For regular / multicast packets host will send vdev and mac id and for
  2182. * NAWDS packets, host will send peer id.
  2183. * A_UINT32 is used to avoid endianness conversion problems.
  2184. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2185. */
  2186. typedef struct {
  2187. A_UINT32
  2188. type: 1, /* vdev_id based or peer_id based */
  2189. rsvd: 31;
  2190. } htt_tx_tcl_vdev_or_peer_t;
  2191. typedef struct {
  2192. A_UINT32
  2193. type: 1, /* vdev_id based or peer_id based */
  2194. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2195. vdev_id: 8,
  2196. pdev_id: 2,
  2197. host_inspected:1,
  2198. rsvd: 19;
  2199. } htt_tx_tcl_vdev_metadata;
  2200. typedef struct {
  2201. A_UINT32
  2202. type: 1, /* vdev_id based or peer_id based */
  2203. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2204. peer_id: 14,
  2205. rsvd: 16;
  2206. } htt_tx_tcl_peer_metadata;
  2207. PREPACK struct htt_tx_tcl_metadata {
  2208. union {
  2209. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2210. htt_tx_tcl_vdev_metadata vdev_meta;
  2211. htt_tx_tcl_peer_metadata peer_meta;
  2212. };
  2213. } POSTPACK;
  2214. /* DWORD 0 */
  2215. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2216. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2217. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2218. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2219. /* VDEV metadata */
  2220. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2221. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2222. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2223. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2224. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2225. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2226. /* PEER metadata */
  2227. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2228. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2229. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2230. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2231. HTT_TX_TCL_METADATA_TYPE_S)
  2232. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2233. do { \
  2234. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2235. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2236. } while (0)
  2237. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2238. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2239. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2240. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2241. do { \
  2242. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2243. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2244. } while (0)
  2245. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2246. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2247. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2248. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2249. do { \
  2250. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2251. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2252. } while (0)
  2253. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2254. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2255. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2256. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2257. do { \
  2258. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2259. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2260. } while (0)
  2261. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2262. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2263. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2264. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2265. do { \
  2266. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2267. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2268. } while (0)
  2269. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2270. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2271. HTT_TX_TCL_METADATA_PEER_ID_S)
  2272. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2273. do { \
  2274. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2275. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2276. } while (0)
  2277. /*------------------------------------------------------------------
  2278. * V2 Version of TCL Data Command
  2279. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2280. * MLO global_seq all flavours of TCL Data Cmd.
  2281. *-----------------------------------------------------------------*/
  2282. typedef enum {
  2283. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2284. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2285. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2286. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2287. } htt_tcl_metadata_type_v2;
  2288. /**
  2289. * @brief HTT TCL command number format
  2290. * @details
  2291. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2292. * available to firmware as tcl_exit_base->tcl_status_number.
  2293. * A_UINT32 is used to avoid endianness conversion problems.
  2294. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2295. */
  2296. typedef struct {
  2297. A_UINT32
  2298. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2299. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2300. vdev_id: 8,
  2301. pdev_id: 2,
  2302. host_inspected:1,
  2303. rsvd: 2,
  2304. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2305. } htt_tx_tcl_vdev_metadata_v2;
  2306. typedef struct {
  2307. A_UINT32
  2308. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2309. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2310. peer_id: 13,
  2311. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2312. } htt_tx_tcl_peer_metadata_v2;
  2313. typedef struct {
  2314. A_UINT32
  2315. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2316. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2317. svc_class_id: 8,
  2318. rsvd: 5,
  2319. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2320. } htt_tx_tcl_svc_class_id_metadata;
  2321. typedef struct {
  2322. A_UINT32
  2323. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2324. host_inspected: 1,
  2325. global_seq_no: 12,
  2326. rsvd: 1,
  2327. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2328. } htt_tx_tcl_global_seq_metadata;
  2329. PREPACK struct htt_tx_tcl_metadata_v2 {
  2330. union {
  2331. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2332. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2333. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2334. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2335. };
  2336. } POSTPACK;
  2337. /* DWORD 0 */
  2338. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2339. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2340. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2341. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2342. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2343. /* VDEV V2 metadata */
  2344. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2345. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2346. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2347. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2348. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2349. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2350. /* PEER V2 metadata */
  2351. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2352. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2353. /* SVC_CLASS_ID metadata */
  2354. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2355. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2356. /* Global Seq no metadata */
  2357. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2358. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2359. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2360. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2361. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2362. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2363. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2364. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2365. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2366. do { \
  2367. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2368. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2369. } while (0)
  2370. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2371. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2372. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2373. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2374. do { \
  2375. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2376. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2377. } while (0)
  2378. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2379. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2380. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2381. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2382. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2383. do { \
  2384. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2385. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2386. } while (0)
  2387. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2388. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2389. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2390. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2391. do { \
  2392. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2393. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2394. } while (0)
  2395. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2396. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2397. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2398. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2399. do { \
  2400. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2401. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2402. } while (0)
  2403. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2404. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2405. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2406. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2407. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2408. do { \
  2409. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2410. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2411. } while (0)
  2412. /*----- Get and Set V2 type field in Service Class fields ----*/
  2413. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2414. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2415. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2416. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2417. do { \
  2418. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2419. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2420. } while (0)
  2421. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2422. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2423. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2424. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2425. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2426. do { \
  2427. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2428. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2429. } while (0)
  2430. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2431. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2432. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2433. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2434. do { \
  2435. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2436. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2437. } while (0)
  2438. /*------------------------------------------------------------------
  2439. * End V2 Version of TCL Data Command
  2440. *-----------------------------------------------------------------*/
  2441. typedef enum {
  2442. HTT_TX_FW2WBM_TX_STATUS_OK,
  2443. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2444. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2445. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2446. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2447. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2448. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2449. HTT_TX_FW2WBM_TX_STATUS_MAX
  2450. } htt_tx_fw2wbm_tx_status_t;
  2451. typedef enum {
  2452. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2453. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2454. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2455. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2456. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2457. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2458. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2459. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2460. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2461. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2462. } htt_tx_fw2wbm_reinject_reason_t;
  2463. /**
  2464. * @brief HTT TX WBM Completion from firmware to host
  2465. * @details
  2466. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2467. * DWORD 3 and 4 for software based completions (Exception frames and
  2468. * TQM bypass frames)
  2469. * For software based completions, wbm_release_ring->release_source_module will
  2470. * be set to release_source_fw
  2471. */
  2472. PREPACK struct htt_tx_wbm_completion {
  2473. A_UINT32
  2474. sch_cmd_id: 24,
  2475. exception_frame: 1, /* If set, this packet was queued via exception path */
  2476. rsvd0_31_25: 7;
  2477. A_UINT32
  2478. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2479. * reception of an ACK or BA, this field indicates
  2480. * the RSSI of the received ACK or BA frame.
  2481. * When the frame is removed as result of a direct
  2482. * remove command from the SW, this field is set
  2483. * to 0x0 (which is never a valid value when real
  2484. * RSSI is available).
  2485. * Units: dB w.r.t noise floor
  2486. */
  2487. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2488. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2489. rsvd1_31_16: 16;
  2490. } POSTPACK;
  2491. /* DWORD 0 */
  2492. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2493. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2494. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2495. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2496. /* DWORD 1 */
  2497. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2498. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2499. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2500. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2501. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2502. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2503. /* DWORD 0 */
  2504. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2505. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2506. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2507. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2508. do { \
  2509. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2510. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2511. } while (0)
  2512. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2513. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2514. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2515. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2516. do { \
  2517. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2518. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2519. } while (0)
  2520. /* DWORD 1 */
  2521. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2522. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2523. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2524. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2525. do { \
  2526. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2527. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2528. } while (0)
  2529. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2530. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2531. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2532. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2533. do { \
  2534. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2535. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2536. } while (0)
  2537. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2538. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2539. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2540. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2541. do { \
  2542. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2543. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2544. } while (0)
  2545. /**
  2546. * @brief HTT TX WBM Completion from firmware to host
  2547. * @details
  2548. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2549. * (WBM) offload HW.
  2550. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2551. * For software based completions, release_source_module will
  2552. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2553. * struct wbm_release_ring and then switch to this after looking at
  2554. * release_source_module.
  2555. */
  2556. PREPACK struct htt_tx_wbm_completion_v2 {
  2557. A_UINT32
  2558. used_by_hw0; /* Refer to struct wbm_release_ring */
  2559. A_UINT32
  2560. used_by_hw1; /* Refer to struct wbm_release_ring */
  2561. A_UINT32
  2562. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2563. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2564. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2565. exception_frame: 1,
  2566. rsvd0: 12, /* For future use */
  2567. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2568. rsvd1: 1; /* For future use */
  2569. A_UINT32
  2570. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2571. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2572. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2573. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2574. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2575. */
  2576. A_UINT32
  2577. data1: 32;
  2578. A_UINT32
  2579. data2: 32;
  2580. A_UINT32
  2581. used_by_hw3; /* Refer to struct wbm_release_ring */
  2582. } POSTPACK;
  2583. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2584. /* DWORD 3 */
  2585. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2586. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2587. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2588. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2589. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2590. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2591. /* DWORD 3 */
  2592. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2593. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2594. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2595. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2596. do { \
  2597. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2598. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2599. } while (0)
  2600. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2601. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2602. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2603. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2604. do { \
  2605. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2606. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2607. } while (0)
  2608. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2609. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2610. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2611. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2612. do { \
  2613. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2614. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2615. } while (0)
  2616. /**
  2617. * @brief HTT TX WBM Completion from firmware to host (V3)
  2618. * @details
  2619. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2620. * (WBM) offload HW.
  2621. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2622. * For software based completions, release_source_module will
  2623. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2624. * struct wbm_release_ring and then switch to this after looking at
  2625. * release_source_module.
  2626. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2627. * by new generations of targets.
  2628. */
  2629. PREPACK struct htt_tx_wbm_completion_v3 {
  2630. A_UINT32
  2631. used_by_hw0; /* Refer to struct wbm_release_ring */
  2632. A_UINT32
  2633. used_by_hw1; /* Refer to struct wbm_release_ring */
  2634. A_UINT32
  2635. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2636. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2637. used_by_hw3: 15;
  2638. A_UINT32
  2639. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2640. exception_frame: 1,
  2641. rsvd0: 27; /* For future use */
  2642. A_UINT32
  2643. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2644. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2645. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2646. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2647. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2648. */
  2649. A_UINT32
  2650. data1: 32;
  2651. A_UINT32
  2652. data2: 32;
  2653. A_UINT32
  2654. rsvd1: 20,
  2655. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2656. } POSTPACK;
  2657. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2658. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2659. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2660. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2661. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2662. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2663. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2664. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2665. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2666. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2667. do { \
  2668. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2669. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2670. } while (0)
  2671. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2672. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2673. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2674. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2675. do { \
  2676. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2677. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2678. } while (0)
  2679. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2680. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2681. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2682. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2683. do { \
  2684. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2685. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2686. } while (0)
  2687. typedef enum {
  2688. TX_FRAME_TYPE_UNDEFINED = 0,
  2689. TX_FRAME_TYPE_EAPOL = 1,
  2690. } htt_tx_wbm_status_frame_type;
  2691. /**
  2692. * @brief HTT TX WBM transmit status from firmware to host
  2693. * @details
  2694. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2695. * (WBM) offload HW.
  2696. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2697. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2698. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2699. */
  2700. PREPACK struct htt_tx_wbm_transmit_status {
  2701. A_UINT32
  2702. sch_cmd_id: 24,
  2703. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2704. * reception of an ACK or BA, this field indicates
  2705. * the RSSI of the received ACK or BA frame.
  2706. * When the frame is removed as result of a direct
  2707. * remove command from the SW, this field is set
  2708. * to 0x0 (which is never a valid value when real
  2709. * RSSI is available).
  2710. * Units: dB w.r.t noise floor
  2711. */
  2712. A_UINT32
  2713. sw_peer_id: 16,
  2714. tid_num: 5,
  2715. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2716. * and tid_num fields contain valid data.
  2717. * If this "valid" flag is not set, the
  2718. * sw_peer_id and tid_num fields must be ignored.
  2719. */
  2720. mcast: 1,
  2721. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2722. * contains valid data.
  2723. */
  2724. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2725. reserved: 4;
  2726. A_UINT32
  2727. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2728. * packets in the wbm completion path
  2729. */
  2730. } POSTPACK;
  2731. /* DWORD 4 */
  2732. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2733. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2734. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2735. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2736. /* DWORD 5 */
  2737. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2738. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2739. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2740. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2741. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2742. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2743. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2744. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2745. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2746. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2747. /* DWORD 4 */
  2748. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2749. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2750. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2751. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2752. do { \
  2753. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2754. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2755. } while (0)
  2756. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2757. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2758. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2759. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2760. do { \
  2761. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2762. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2763. } while (0)
  2764. /* DWORD 5 */
  2765. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2766. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2767. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2768. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2769. do { \
  2770. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2771. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2772. } while (0)
  2773. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2774. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2775. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2776. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2777. do { \
  2778. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2779. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2780. } while (0)
  2781. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2782. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2783. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2784. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2785. do { \
  2786. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2787. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2788. } while (0)
  2789. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2790. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2791. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2792. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2793. do { \
  2794. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2795. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2796. } while (0)
  2797. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2798. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2799. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2800. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2801. do { \
  2802. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2803. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2804. } while (0)
  2805. /**
  2806. * @brief HTT TX WBM reinject status from firmware to host
  2807. * @details
  2808. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2809. * (WBM) offload HW.
  2810. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2811. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2812. */
  2813. PREPACK struct htt_tx_wbm_reinject_status {
  2814. A_UINT32
  2815. reserved0: 32;
  2816. A_UINT32
  2817. reserved1: 32;
  2818. A_UINT32
  2819. reserved2: 32;
  2820. } POSTPACK;
  2821. /**
  2822. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2823. * @details
  2824. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2825. * (WBM) offload HW.
  2826. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2827. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2828. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2829. * STA side.
  2830. */
  2831. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2832. A_UINT32
  2833. mec_sa_addr_31_0;
  2834. A_UINT32
  2835. mec_sa_addr_47_32: 16,
  2836. sa_ast_index: 16;
  2837. A_UINT32
  2838. vdev_id: 8,
  2839. reserved0: 24;
  2840. } POSTPACK;
  2841. /* DWORD 4 - mec_sa_addr_31_0 */
  2842. /* DWORD 5 */
  2843. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2844. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2845. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2846. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2847. /* DWORD 6 */
  2848. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2849. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2850. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2851. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2852. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2853. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2854. do { \
  2855. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2856. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2857. } while (0)
  2858. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2859. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2860. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2861. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2862. do { \
  2863. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2864. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2865. } while (0)
  2866. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2867. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2868. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2869. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2870. do { \
  2871. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2872. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2873. } while (0)
  2874. typedef enum {
  2875. TX_FLOW_PRIORITY_BE,
  2876. TX_FLOW_PRIORITY_HIGH,
  2877. TX_FLOW_PRIORITY_LOW,
  2878. } htt_tx_flow_priority_t;
  2879. typedef enum {
  2880. TX_FLOW_LATENCY_SENSITIVE,
  2881. TX_FLOW_LATENCY_INSENSITIVE,
  2882. } htt_tx_flow_latency_t;
  2883. typedef enum {
  2884. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2885. TX_FLOW_INTERACTIVE_TRAFFIC,
  2886. TX_FLOW_PERIODIC_TRAFFIC,
  2887. TX_FLOW_BURSTY_TRAFFIC,
  2888. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2889. } htt_tx_flow_traffic_pattern_t;
  2890. /**
  2891. * @brief HTT TX Flow search metadata format
  2892. * @details
  2893. * Host will set this metadata in flow table's flow search entry along with
  2894. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2895. * firmware and TQM ring if the flow search entry wins.
  2896. * This metadata is available to firmware in that first MSDU's
  2897. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2898. * to one of the available flows for specific tid and returns the tqm flow
  2899. * pointer as part of htt_tx_map_flow_info message.
  2900. */
  2901. PREPACK struct htt_tx_flow_metadata {
  2902. A_UINT32
  2903. rsvd0_1_0: 2,
  2904. tid: 4,
  2905. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2906. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2907. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2908. * Else choose final tid based on latency, priority.
  2909. */
  2910. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2911. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2912. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2913. } POSTPACK;
  2914. /* DWORD 0 */
  2915. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2916. #define HTT_TX_FLOW_METADATA_TID_S 2
  2917. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2918. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2919. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2920. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2921. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2922. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2923. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2924. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2925. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2926. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2927. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2928. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2929. /* DWORD 0 */
  2930. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2931. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2932. HTT_TX_FLOW_METADATA_TID_S)
  2933. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2934. do { \
  2935. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2936. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2937. } while (0)
  2938. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2939. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2940. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2941. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2942. do { \
  2943. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2944. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2945. } while (0)
  2946. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2947. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2948. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2949. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2950. do { \
  2951. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2952. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2953. } while (0)
  2954. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2955. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2956. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2957. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2958. do { \
  2959. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2960. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2961. } while (0)
  2962. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2963. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2964. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2965. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2966. do { \
  2967. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2968. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2969. } while (0)
  2970. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2971. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2972. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2973. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2974. do { \
  2975. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2976. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2977. } while (0)
  2978. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2979. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2980. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2981. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2982. do { \
  2983. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2984. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2985. } while (0)
  2986. /**
  2987. * @brief host -> target ADD WDS Entry
  2988. *
  2989. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2990. *
  2991. * @brief host -> target DELETE WDS Entry
  2992. *
  2993. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2994. *
  2995. * @details
  2996. * HTT wds entry from source port learning
  2997. * Host will learn wds entries from rx and send this message to firmware
  2998. * to enable firmware to configure/delete AST entries for wds clients.
  2999. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  3000. * and when SA's entry is deleted, firmware removes this AST entry
  3001. *
  3002. * The message would appear as follows:
  3003. *
  3004. * |31 30|29 |17 16|15 8|7 0|
  3005. * |----------------+----------------+----------------+----------------|
  3006. * | rsvd0 |PDVID| vdev_id | msg_type |
  3007. * |-------------------------------------------------------------------|
  3008. * | sa_addr_31_0 |
  3009. * |-------------------------------------------------------------------|
  3010. * | | ta_peer_id | sa_addr_47_32 |
  3011. * |-------------------------------------------------------------------|
  3012. * Where PDVID = pdev_id
  3013. *
  3014. * The message is interpreted as follows:
  3015. *
  3016. * dword0 - b'0:7 - msg_type: This will be set to
  3017. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3018. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3019. *
  3020. * dword0 - b'8:15 - vdev_id
  3021. *
  3022. * dword0 - b'16:17 - pdev_id
  3023. *
  3024. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3025. *
  3026. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3027. *
  3028. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3029. *
  3030. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3031. */
  3032. PREPACK struct htt_wds_entry {
  3033. A_UINT32
  3034. msg_type: 8,
  3035. vdev_id: 8,
  3036. pdev_id: 2,
  3037. rsvd0: 14;
  3038. A_UINT32 sa_addr_31_0;
  3039. A_UINT32
  3040. sa_addr_47_32: 16,
  3041. ta_peer_id: 14,
  3042. rsvd2: 2;
  3043. } POSTPACK;
  3044. /* DWORD 0 */
  3045. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3046. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3047. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3048. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3049. /* DWORD 2 */
  3050. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3051. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3052. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3053. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3054. /* DWORD 0 */
  3055. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3056. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3057. HTT_WDS_ENTRY_VDEV_ID_S)
  3058. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3059. do { \
  3060. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3061. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3062. } while (0)
  3063. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3064. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3065. HTT_WDS_ENTRY_PDEV_ID_S)
  3066. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3067. do { \
  3068. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3069. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3070. } while (0)
  3071. /* DWORD 2 */
  3072. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3073. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3074. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3075. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3076. do { \
  3077. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3078. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3079. } while (0)
  3080. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3081. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3082. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3083. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3084. do { \
  3085. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3086. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3087. } while (0)
  3088. /**
  3089. * @brief MAC DMA rx ring setup specification
  3090. *
  3091. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3092. *
  3093. * @details
  3094. * To allow for dynamic rx ring reconfiguration and to avoid race
  3095. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3096. * it uses. Instead, it sends this message to the target, indicating how
  3097. * the rx ring used by the host should be set up and maintained.
  3098. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3099. * specifications.
  3100. *
  3101. * |31 16|15 8|7 0|
  3102. * |---------------------------------------------------------------|
  3103. * header: | reserved | num rings | msg type |
  3104. * |---------------------------------------------------------------|
  3105. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3106. #if HTT_PADDR64
  3107. * | FW_IDX shadow register physical address (bits 63:32) |
  3108. #endif
  3109. * |---------------------------------------------------------------|
  3110. * | rx ring base physical address (bits 31:0) |
  3111. #if HTT_PADDR64
  3112. * | rx ring base physical address (bits 63:32) |
  3113. #endif
  3114. * |---------------------------------------------------------------|
  3115. * | rx ring buffer size | rx ring length |
  3116. * |---------------------------------------------------------------|
  3117. * | FW_IDX initial value | enabled flags |
  3118. * |---------------------------------------------------------------|
  3119. * | MSDU payload offset | 802.11 header offset |
  3120. * |---------------------------------------------------------------|
  3121. * | PPDU end offset | PPDU start offset |
  3122. * |---------------------------------------------------------------|
  3123. * | MPDU end offset | MPDU start offset |
  3124. * |---------------------------------------------------------------|
  3125. * | MSDU end offset | MSDU start offset |
  3126. * |---------------------------------------------------------------|
  3127. * | frag info offset | rx attention offset |
  3128. * |---------------------------------------------------------------|
  3129. * payload 2, if present, has the same format as payload 1
  3130. * Header fields:
  3131. * - MSG_TYPE
  3132. * Bits 7:0
  3133. * Purpose: identifies this as an rx ring configuration message
  3134. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3135. * - NUM_RINGS
  3136. * Bits 15:8
  3137. * Purpose: indicates whether the host is setting up one rx ring or two
  3138. * Value: 1 or 2
  3139. * Payload:
  3140. * for systems using 64-bit format for bus addresses:
  3141. * - IDX_SHADOW_REG_PADDR_LO
  3142. * Bits 31:0
  3143. * Value: lower 4 bytes of physical address of the host's
  3144. * FW_IDX shadow register
  3145. * - IDX_SHADOW_REG_PADDR_HI
  3146. * Bits 31:0
  3147. * Value: upper 4 bytes of physical address of the host's
  3148. * FW_IDX shadow register
  3149. * - RING_BASE_PADDR_LO
  3150. * Bits 31:0
  3151. * Value: lower 4 bytes of physical address of the host's rx ring
  3152. * - RING_BASE_PADDR_HI
  3153. * Bits 31:0
  3154. * Value: uppper 4 bytes of physical address of the host's rx ring
  3155. * for systems using 32-bit format for bus addresses:
  3156. * - IDX_SHADOW_REG_PADDR
  3157. * Bits 31:0
  3158. * Value: physical address of the host's FW_IDX shadow register
  3159. * - RING_BASE_PADDR
  3160. * Bits 31:0
  3161. * Value: physical address of the host's rx ring
  3162. * - RING_LEN
  3163. * Bits 15:0
  3164. * Value: number of elements in the rx ring
  3165. * - RING_BUF_SZ
  3166. * Bits 31:16
  3167. * Value: size of the buffers referenced by the rx ring, in byte units
  3168. * - ENABLED_FLAGS
  3169. * Bits 15:0
  3170. * Value: 1-bit flags to show whether different rx fields are enabled
  3171. * bit 0: 802.11 header enabled (1) or disabled (0)
  3172. * bit 1: MSDU payload enabled (1) or disabled (0)
  3173. * bit 2: PPDU start enabled (1) or disabled (0)
  3174. * bit 3: PPDU end enabled (1) or disabled (0)
  3175. * bit 4: MPDU start enabled (1) or disabled (0)
  3176. * bit 5: MPDU end enabled (1) or disabled (0)
  3177. * bit 6: MSDU start enabled (1) or disabled (0)
  3178. * bit 7: MSDU end enabled (1) or disabled (0)
  3179. * bit 8: rx attention enabled (1) or disabled (0)
  3180. * bit 9: frag info enabled (1) or disabled (0)
  3181. * bit 10: unicast rx enabled (1) or disabled (0)
  3182. * bit 11: multicast rx enabled (1) or disabled (0)
  3183. * bit 12: ctrl rx enabled (1) or disabled (0)
  3184. * bit 13: mgmt rx enabled (1) or disabled (0)
  3185. * bit 14: null rx enabled (1) or disabled (0)
  3186. * bit 15: phy data rx enabled (1) or disabled (0)
  3187. * - IDX_INIT_VAL
  3188. * Bits 31:16
  3189. * Purpose: Specify the initial value for the FW_IDX.
  3190. * Value: the number of buffers initially present in the host's rx ring
  3191. * - OFFSET_802_11_HDR
  3192. * Bits 15:0
  3193. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3194. * - OFFSET_MSDU_PAYLOAD
  3195. * Bits 31:16
  3196. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3197. * - OFFSET_PPDU_START
  3198. * Bits 15:0
  3199. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3200. * - OFFSET_PPDU_END
  3201. * Bits 31:16
  3202. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3203. * - OFFSET_MPDU_START
  3204. * Bits 15:0
  3205. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3206. * - OFFSET_MPDU_END
  3207. * Bits 31:16
  3208. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3209. * - OFFSET_MSDU_START
  3210. * Bits 15:0
  3211. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3212. * - OFFSET_MSDU_END
  3213. * Bits 31:16
  3214. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3215. * - OFFSET_RX_ATTN
  3216. * Bits 15:0
  3217. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3218. * - OFFSET_FRAG_INFO
  3219. * Bits 31:16
  3220. * Value: offset in QUAD-bytes of frag info table
  3221. */
  3222. /* header fields */
  3223. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3224. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3225. /* payload fields */
  3226. /* for systems using a 64-bit format for bus addresses */
  3227. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3228. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3229. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3230. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3231. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3232. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3233. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3234. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3235. /* for systems using a 32-bit format for bus addresses */
  3236. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3237. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3238. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3239. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3240. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3241. #define HTT_RX_RING_CFG_LEN_S 0
  3242. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3243. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3244. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3245. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3246. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3247. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3248. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3249. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3250. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3251. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3252. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3253. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3254. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3255. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3256. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3257. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3258. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3259. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3260. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3261. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3262. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3263. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3264. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3265. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3266. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3267. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3268. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3269. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3270. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3271. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3272. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3273. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3274. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3275. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3276. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3277. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3278. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3279. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3280. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3281. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3282. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3283. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3284. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3285. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3286. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3287. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3288. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3289. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3290. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3291. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3292. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3293. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3294. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3295. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3296. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3297. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3298. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3299. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3300. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3301. #if HTT_PADDR64
  3302. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3303. #else
  3304. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3305. #endif
  3306. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3307. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3308. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3309. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3310. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3311. do { \
  3312. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3313. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3314. } while (0)
  3315. /* degenerate case for 32-bit fields */
  3316. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3317. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3318. ((_var) = (_val))
  3319. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3320. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3321. ((_var) = (_val))
  3322. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3323. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3324. ((_var) = (_val))
  3325. /* degenerate case for 32-bit fields */
  3326. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3327. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3328. ((_var) = (_val))
  3329. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3330. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3331. ((_var) = (_val))
  3332. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3333. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3334. ((_var) = (_val))
  3335. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3336. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3337. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3338. do { \
  3339. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3340. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3341. } while (0)
  3342. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3343. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3344. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3345. do { \
  3346. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3347. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3348. } while (0)
  3349. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3350. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3351. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3352. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3353. do { \
  3354. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3355. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3356. } while (0)
  3357. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3358. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3359. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3360. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3361. do { \
  3362. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3363. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3364. } while (0)
  3365. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3366. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3367. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3368. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3369. do { \
  3370. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3371. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3372. } while (0)
  3373. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3374. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3375. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3376. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3377. do { \
  3378. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3379. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3380. } while (0)
  3381. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3382. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3383. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3384. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3385. do { \
  3386. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3387. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3388. } while (0)
  3389. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3390. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3391. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3392. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3393. do { \
  3394. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3395. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3396. } while (0)
  3397. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3398. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3399. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3400. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3401. do { \
  3402. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3403. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3404. } while (0)
  3405. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3406. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3407. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3408. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3409. do { \
  3410. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3411. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3412. } while (0)
  3413. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3414. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3415. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3416. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3417. do { \
  3418. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3419. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3420. } while (0)
  3421. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3422. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3423. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3424. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3425. do { \
  3426. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3427. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3428. } while (0)
  3429. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3430. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3431. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3432. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3433. do { \
  3434. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3435. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3436. } while (0)
  3437. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3438. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3439. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3440. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3441. do { \
  3442. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3443. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3444. } while (0)
  3445. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3446. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3447. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3448. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3449. do { \
  3450. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3451. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3452. } while (0)
  3453. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3454. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3455. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3456. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3457. do { \
  3458. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3459. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3460. } while (0)
  3461. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3462. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3463. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3464. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3465. do { \
  3466. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3467. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3468. } while (0)
  3469. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3470. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3471. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3472. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3473. do { \
  3474. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3475. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3476. } while (0)
  3477. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3478. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3479. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3480. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3481. do { \
  3482. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3483. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3484. } while (0)
  3485. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3486. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3487. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3488. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3489. do { \
  3490. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3491. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3492. } while (0)
  3493. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3494. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3495. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3496. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3497. do { \
  3498. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3499. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3500. } while (0)
  3501. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3502. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3503. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3504. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3505. do { \
  3506. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3507. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3508. } while (0)
  3509. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3510. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3511. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3512. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3513. do { \
  3514. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3515. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3516. } while (0)
  3517. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3518. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3519. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3520. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3521. do { \
  3522. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3523. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3524. } while (0)
  3525. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3526. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3527. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3528. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3529. do { \
  3530. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3531. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3532. } while (0)
  3533. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3534. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3535. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3536. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3537. do { \
  3538. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3539. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3540. } while (0)
  3541. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3542. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3543. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3544. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3545. do { \
  3546. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3547. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3548. } while (0)
  3549. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3550. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3551. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3552. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3553. do { \
  3554. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3555. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3556. } while (0)
  3557. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3558. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3559. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3560. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3561. do { \
  3562. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3563. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3564. } while (0)
  3565. /**
  3566. * @brief host -> target FW statistics retrieve
  3567. *
  3568. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3569. *
  3570. * @details
  3571. * The following field definitions describe the format of the HTT host
  3572. * to target FW stats retrieve message. The message specifies the type of
  3573. * stats host wants to retrieve.
  3574. *
  3575. * |31 24|23 16|15 8|7 0|
  3576. * |-----------------------------------------------------------|
  3577. * | stats types request bitmask | msg type |
  3578. * |-----------------------------------------------------------|
  3579. * | stats types reset bitmask | reserved |
  3580. * |-----------------------------------------------------------|
  3581. * | stats type | config value |
  3582. * |-----------------------------------------------------------|
  3583. * | cookie LSBs |
  3584. * |-----------------------------------------------------------|
  3585. * | cookie MSBs |
  3586. * |-----------------------------------------------------------|
  3587. * Header fields:
  3588. * - MSG_TYPE
  3589. * Bits 7:0
  3590. * Purpose: identifies this is a stats upload request message
  3591. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3592. * - UPLOAD_TYPES
  3593. * Bits 31:8
  3594. * Purpose: identifies which types of FW statistics to upload
  3595. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3596. * - RESET_TYPES
  3597. * Bits 31:8
  3598. * Purpose: identifies which types of FW statistics to reset
  3599. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3600. * - CFG_VAL
  3601. * Bits 23:0
  3602. * Purpose: give an opaque configuration value to the specified stats type
  3603. * Value: stats-type specific configuration value
  3604. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3605. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3606. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3607. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3608. * - CFG_STAT_TYPE
  3609. * Bits 31:24
  3610. * Purpose: specify which stats type (if any) the config value applies to
  3611. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3612. * a valid configuration specification
  3613. * - COOKIE_LSBS
  3614. * Bits 31:0
  3615. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3616. * message with its preceding host->target stats request message.
  3617. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3618. * - COOKIE_MSBS
  3619. * Bits 31:0
  3620. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3621. * message with its preceding host->target stats request message.
  3622. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3623. */
  3624. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3625. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3626. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3627. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3628. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3629. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3630. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3631. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3632. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3633. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3634. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3635. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3636. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3637. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3638. do { \
  3639. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3640. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3641. } while (0)
  3642. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3643. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3644. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3645. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3646. do { \
  3647. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3648. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3649. } while (0)
  3650. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3651. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3652. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3653. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3654. do { \
  3655. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3656. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3657. } while (0)
  3658. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3659. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3660. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3661. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3662. do { \
  3663. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3664. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3665. } while (0)
  3666. /**
  3667. * @brief host -> target HTT out-of-band sync request
  3668. *
  3669. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3670. *
  3671. * @details
  3672. * The HTT SYNC tells the target to suspend processing of subsequent
  3673. * HTT host-to-target messages until some other target agent locally
  3674. * informs the target HTT FW that the current sync counter is equal to
  3675. * or greater than (in a modulo sense) the sync counter specified in
  3676. * the SYNC message.
  3677. * This allows other host-target components to synchronize their operation
  3678. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3679. * security key has been downloaded to and activated by the target.
  3680. * In the absence of any explicit synchronization counter value
  3681. * specification, the target HTT FW will use zero as the default current
  3682. * sync value.
  3683. *
  3684. * |31 24|23 16|15 8|7 0|
  3685. * |-----------------------------------------------------------|
  3686. * | reserved | sync count | msg type |
  3687. * |-----------------------------------------------------------|
  3688. * Header fields:
  3689. * - MSG_TYPE
  3690. * Bits 7:0
  3691. * Purpose: identifies this as a sync message
  3692. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3693. * - SYNC_COUNT
  3694. * Bits 15:8
  3695. * Purpose: specifies what sync value the HTT FW will wait for from
  3696. * an out-of-band specification to resume its operation
  3697. * Value: in-band sync counter value to compare against the out-of-band
  3698. * counter spec.
  3699. * The HTT target FW will suspend its host->target message processing
  3700. * as long as
  3701. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3702. */
  3703. #define HTT_H2T_SYNC_MSG_SZ 4
  3704. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3705. #define HTT_H2T_SYNC_COUNT_S 8
  3706. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3707. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3708. HTT_H2T_SYNC_COUNT_S)
  3709. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3710. do { \
  3711. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3712. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3713. } while (0)
  3714. /**
  3715. * @brief host -> target HTT aggregation configuration
  3716. *
  3717. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3718. */
  3719. #define HTT_AGGR_CFG_MSG_SZ 4
  3720. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3721. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3722. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3723. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3724. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3725. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3726. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3727. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3728. do { \
  3729. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3730. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3731. } while (0)
  3732. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3733. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3734. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3735. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3736. do { \
  3737. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3738. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3739. } while (0)
  3740. /**
  3741. * @brief host -> target HTT configure max amsdu info per vdev
  3742. *
  3743. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3744. *
  3745. * @details
  3746. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3747. *
  3748. * |31 21|20 16|15 8|7 0|
  3749. * |-----------------------------------------------------------|
  3750. * | reserved | vdev id | max amsdu | msg type |
  3751. * |-----------------------------------------------------------|
  3752. * Header fields:
  3753. * - MSG_TYPE
  3754. * Bits 7:0
  3755. * Purpose: identifies this as a aggr cfg ex message
  3756. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3757. * - MAX_NUM_AMSDU_SUBFRM
  3758. * Bits 15:8
  3759. * Purpose: max MSDUs per A-MSDU
  3760. * - VDEV_ID
  3761. * Bits 20:16
  3762. * Purpose: ID of the vdev to which this limit is applied
  3763. */
  3764. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3765. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3766. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3767. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3768. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3769. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3770. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3771. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3772. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3773. do { \
  3774. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3775. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3776. } while (0)
  3777. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3778. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3779. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3780. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3781. do { \
  3782. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3783. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3784. } while (0)
  3785. /**
  3786. * @brief HTT WDI_IPA Config Message
  3787. *
  3788. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3789. *
  3790. * @details
  3791. * The HTT WDI_IPA config message is created/sent by host at driver
  3792. * init time. It contains information about data structures used on
  3793. * WDI_IPA TX and RX path.
  3794. * TX CE ring is used for pushing packet metadata from IPA uC
  3795. * to WLAN FW
  3796. * TX Completion ring is used for generating TX completions from
  3797. * WLAN FW to IPA uC
  3798. * RX Indication ring is used for indicating RX packets from FW
  3799. * to IPA uC
  3800. * RX Ring2 is used as either completion ring or as second
  3801. * indication ring. when Ring2 is used as completion ring, IPA uC
  3802. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3803. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3804. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3805. * indicated in RX Indication ring. Please see WDI_IPA specification
  3806. * for more details.
  3807. * |31 24|23 16|15 8|7 0|
  3808. * |----------------+----------------+----------------+----------------|
  3809. * | tx pkt pool size | Rsvd | msg_type |
  3810. * |-------------------------------------------------------------------|
  3811. * | tx comp ring base (bits 31:0) |
  3812. #if HTT_PADDR64
  3813. * | tx comp ring base (bits 63:32) |
  3814. #endif
  3815. * |-------------------------------------------------------------------|
  3816. * | tx comp ring size |
  3817. * |-------------------------------------------------------------------|
  3818. * | tx comp WR_IDX physical address (bits 31:0) |
  3819. #if HTT_PADDR64
  3820. * | tx comp WR_IDX physical address (bits 63:32) |
  3821. #endif
  3822. * |-------------------------------------------------------------------|
  3823. * | tx CE WR_IDX physical address (bits 31:0) |
  3824. #if HTT_PADDR64
  3825. * | tx CE WR_IDX physical address (bits 63:32) |
  3826. #endif
  3827. * |-------------------------------------------------------------------|
  3828. * | rx indication ring base (bits 31:0) |
  3829. #if HTT_PADDR64
  3830. * | rx indication ring base (bits 63:32) |
  3831. #endif
  3832. * |-------------------------------------------------------------------|
  3833. * | rx indication ring size |
  3834. * |-------------------------------------------------------------------|
  3835. * | rx ind RD_IDX physical address (bits 31:0) |
  3836. #if HTT_PADDR64
  3837. * | rx ind RD_IDX physical address (bits 63:32) |
  3838. #endif
  3839. * |-------------------------------------------------------------------|
  3840. * | rx ind WR_IDX physical address (bits 31:0) |
  3841. #if HTT_PADDR64
  3842. * | rx ind WR_IDX physical address (bits 63:32) |
  3843. #endif
  3844. * |-------------------------------------------------------------------|
  3845. * |-------------------------------------------------------------------|
  3846. * | rx ring2 base (bits 31:0) |
  3847. #if HTT_PADDR64
  3848. * | rx ring2 base (bits 63:32) |
  3849. #endif
  3850. * |-------------------------------------------------------------------|
  3851. * | rx ring2 size |
  3852. * |-------------------------------------------------------------------|
  3853. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3854. #if HTT_PADDR64
  3855. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3856. #endif
  3857. * |-------------------------------------------------------------------|
  3858. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3859. #if HTT_PADDR64
  3860. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3861. #endif
  3862. * |-------------------------------------------------------------------|
  3863. *
  3864. * Header fields:
  3865. * Header fields:
  3866. * - MSG_TYPE
  3867. * Bits 7:0
  3868. * Purpose: Identifies this as WDI_IPA config message
  3869. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3870. * - TX_PKT_POOL_SIZE
  3871. * Bits 15:0
  3872. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3873. * WDI_IPA TX path
  3874. * For systems using 32-bit format for bus addresses:
  3875. * - TX_COMP_RING_BASE_ADDR
  3876. * Bits 31:0
  3877. * Purpose: TX Completion Ring base address in DDR
  3878. * - TX_COMP_RING_SIZE
  3879. * Bits 31:0
  3880. * Purpose: TX Completion Ring size (must be power of 2)
  3881. * - TX_COMP_WR_IDX_ADDR
  3882. * Bits 31:0
  3883. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3884. * updates the Write Index for WDI_IPA TX completion ring
  3885. * - TX_CE_WR_IDX_ADDR
  3886. * Bits 31:0
  3887. * Purpose: DDR address where IPA uC
  3888. * updates the WR Index for TX CE ring
  3889. * (needed for fusion platforms)
  3890. * - RX_IND_RING_BASE_ADDR
  3891. * Bits 31:0
  3892. * Purpose: RX Indication Ring base address in DDR
  3893. * - RX_IND_RING_SIZE
  3894. * Bits 31:0
  3895. * Purpose: RX Indication Ring size
  3896. * - RX_IND_RD_IDX_ADDR
  3897. * Bits 31:0
  3898. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3899. * RX indication ring
  3900. * - RX_IND_WR_IDX_ADDR
  3901. * Bits 31:0
  3902. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3903. * updates the Write Index for WDI_IPA RX indication ring
  3904. * - RX_RING2_BASE_ADDR
  3905. * Bits 31:0
  3906. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3907. * - RX_RING2_SIZE
  3908. * Bits 31:0
  3909. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3910. * - RX_RING2_RD_IDX_ADDR
  3911. * Bits 31:0
  3912. * Purpose: If Second RX ring is Indication ring, DDR address where
  3913. * IPA uC updates the Read Index for Ring2.
  3914. * If Second RX ring is completion ring, this is NOT used
  3915. * - RX_RING2_WR_IDX_ADDR
  3916. * Bits 31:0
  3917. * Purpose: If Second RX ring is Indication ring, DDR address where
  3918. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3919. * If second RX ring is completion ring, DDR address where
  3920. * IPA uC updates the Write Index for Ring 2.
  3921. * For systems using 64-bit format for bus addresses:
  3922. * - TX_COMP_RING_BASE_ADDR_LO
  3923. * Bits 31:0
  3924. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3925. * - TX_COMP_RING_BASE_ADDR_HI
  3926. * Bits 31:0
  3927. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3928. * - TX_COMP_RING_SIZE
  3929. * Bits 31:0
  3930. * Purpose: TX Completion Ring size (must be power of 2)
  3931. * - TX_COMP_WR_IDX_ADDR_LO
  3932. * Bits 31:0
  3933. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3934. * Lower 4 bytes of DDR address where WIFI FW
  3935. * updates the Write Index for WDI_IPA TX completion ring
  3936. * - TX_COMP_WR_IDX_ADDR_HI
  3937. * Bits 31:0
  3938. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3939. * Higher 4 bytes of DDR address where WIFI FW
  3940. * updates the Write Index for WDI_IPA TX completion ring
  3941. * - TX_CE_WR_IDX_ADDR_LO
  3942. * Bits 31:0
  3943. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3944. * updates the WR Index for TX CE ring
  3945. * (needed for fusion platforms)
  3946. * - TX_CE_WR_IDX_ADDR_HI
  3947. * Bits 31:0
  3948. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3949. * updates the WR Index for TX CE ring
  3950. * (needed for fusion platforms)
  3951. * - RX_IND_RING_BASE_ADDR_LO
  3952. * Bits 31:0
  3953. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3954. * - RX_IND_RING_BASE_ADDR_HI
  3955. * Bits 31:0
  3956. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3957. * - RX_IND_RING_SIZE
  3958. * Bits 31:0
  3959. * Purpose: RX Indication Ring size
  3960. * - RX_IND_RD_IDX_ADDR_LO
  3961. * Bits 31:0
  3962. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3963. * for WDI_IPA RX indication ring
  3964. * - RX_IND_RD_IDX_ADDR_HI
  3965. * Bits 31:0
  3966. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3967. * for WDI_IPA RX indication ring
  3968. * - RX_IND_WR_IDX_ADDR_LO
  3969. * Bits 31:0
  3970. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3971. * Lower 4 bytes of DDR address where WIFI FW
  3972. * updates the Write Index for WDI_IPA RX indication ring
  3973. * - RX_IND_WR_IDX_ADDR_HI
  3974. * Bits 31:0
  3975. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3976. * Higher 4 bytes of DDR address where WIFI FW
  3977. * updates the Write Index for WDI_IPA RX indication ring
  3978. * - RX_RING2_BASE_ADDR_LO
  3979. * Bits 31:0
  3980. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3981. * - RX_RING2_BASE_ADDR_HI
  3982. * Bits 31:0
  3983. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3984. * - RX_RING2_SIZE
  3985. * Bits 31:0
  3986. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3987. * - RX_RING2_RD_IDX_ADDR_LO
  3988. * Bits 31:0
  3989. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3990. * DDR address where IPA uC updates the Read Index for Ring2.
  3991. * If Second RX ring is completion ring, this is NOT used
  3992. * - RX_RING2_RD_IDX_ADDR_HI
  3993. * Bits 31:0
  3994. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3995. * DDR address where IPA uC updates the Read Index for Ring2.
  3996. * If Second RX ring is completion ring, this is NOT used
  3997. * - RX_RING2_WR_IDX_ADDR_LO
  3998. * Bits 31:0
  3999. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  4000. * DDR address where WIFI FW updates the Write Index
  4001. * for WDI_IPA RX ring2
  4002. * If second RX ring is completion ring, lower 4 bytes of
  4003. * DDR address where IPA uC updates the Write Index for Ring 2.
  4004. * - RX_RING2_WR_IDX_ADDR_HI
  4005. * Bits 31:0
  4006. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4007. * DDR address where WIFI FW updates the Write Index
  4008. * for WDI_IPA RX ring2
  4009. * If second RX ring is completion ring, higher 4 bytes of
  4010. * DDR address where IPA uC updates the Write Index for Ring 2.
  4011. */
  4012. #if HTT_PADDR64
  4013. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4014. #else
  4015. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4016. #endif
  4017. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4018. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4019. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4020. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4021. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4022. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4023. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4024. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4025. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4026. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4027. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4028. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4029. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4030. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4031. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4032. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4033. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4034. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4035. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4036. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4037. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4038. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4039. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4040. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4041. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4042. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4043. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4044. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4045. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4046. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4047. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4048. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4049. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4051. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4053. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4054. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4055. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4056. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4057. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4059. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4061. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4062. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4063. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4064. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4065. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4066. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4067. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4068. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4069. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4070. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4071. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4072. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4073. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4074. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4075. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4076. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4077. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4078. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4079. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4080. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4081. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4082. do { \
  4083. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4084. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4085. } while (0)
  4086. /* for systems using 32-bit format for bus addr */
  4087. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4088. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4089. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4090. do { \
  4091. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4092. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4093. } while (0)
  4094. /* for systems using 64-bit format for bus addr */
  4095. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4096. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4097. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4098. do { \
  4099. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4100. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4101. } while (0)
  4102. /* for systems using 64-bit format for bus addr */
  4103. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4104. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4105. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4106. do { \
  4107. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4108. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4109. } while (0)
  4110. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4111. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4112. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4113. do { \
  4114. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4115. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4116. } while (0)
  4117. /* for systems using 32-bit format for bus addr */
  4118. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4119. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4120. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4121. do { \
  4122. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4123. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4124. } while (0)
  4125. /* for systems using 64-bit format for bus addr */
  4126. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4127. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4128. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4129. do { \
  4130. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4131. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4132. } while (0)
  4133. /* for systems using 64-bit format for bus addr */
  4134. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4135. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4136. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4137. do { \
  4138. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4139. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4140. } while (0)
  4141. /* for systems using 32-bit format for bus addr */
  4142. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4143. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4144. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4145. do { \
  4146. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4147. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4148. } while (0)
  4149. /* for systems using 64-bit format for bus addr */
  4150. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4151. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4152. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4153. do { \
  4154. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4155. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4156. } while (0)
  4157. /* for systems using 64-bit format for bus addr */
  4158. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4159. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4160. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4161. do { \
  4162. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4163. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4164. } while (0)
  4165. /* for systems using 32-bit format for bus addr */
  4166. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4167. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4168. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4169. do { \
  4170. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4171. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4172. } while (0)
  4173. /* for systems using 64-bit format for bus addr */
  4174. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4175. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4176. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4177. do { \
  4178. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4179. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4180. } while (0)
  4181. /* for systems using 64-bit format for bus addr */
  4182. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4183. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4184. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4185. do { \
  4186. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4187. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4188. } while (0)
  4189. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4190. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4191. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4192. do { \
  4193. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4194. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4195. } while (0)
  4196. /* for systems using 32-bit format for bus addr */
  4197. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4198. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4199. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4200. do { \
  4201. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4202. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4203. } while (0)
  4204. /* for systems using 64-bit format for bus addr */
  4205. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4206. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4207. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4208. do { \
  4209. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4210. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4211. } while (0)
  4212. /* for systems using 64-bit format for bus addr */
  4213. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4214. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4215. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4216. do { \
  4217. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4218. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4219. } while (0)
  4220. /* for systems using 32-bit format for bus addr */
  4221. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4222. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4223. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4224. do { \
  4225. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4226. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4227. } while (0)
  4228. /* for systems using 64-bit format for bus addr */
  4229. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4230. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4231. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4232. do { \
  4233. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4234. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4235. } while (0)
  4236. /* for systems using 64-bit format for bus addr */
  4237. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4238. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4239. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4240. do { \
  4241. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4242. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4243. } while (0)
  4244. /* for systems using 32-bit format for bus addr */
  4245. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4246. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4247. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4248. do { \
  4249. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4250. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4251. } while (0)
  4252. /* for systems using 64-bit format for bus addr */
  4253. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4254. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4255. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4256. do { \
  4257. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4258. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4259. } while (0)
  4260. /* for systems using 64-bit format for bus addr */
  4261. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4262. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4263. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4264. do { \
  4265. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4266. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4267. } while (0)
  4268. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4269. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4270. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4271. do { \
  4272. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4273. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4274. } while (0)
  4275. /* for systems using 32-bit format for bus addr */
  4276. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4277. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4278. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4279. do { \
  4280. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4281. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4282. } while (0)
  4283. /* for systems using 64-bit format for bus addr */
  4284. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4285. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4286. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4287. do { \
  4288. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4289. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4290. } while (0)
  4291. /* for systems using 64-bit format for bus addr */
  4292. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4293. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4294. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4295. do { \
  4296. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4297. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4298. } while (0)
  4299. /* for systems using 32-bit format for bus addr */
  4300. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4301. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4302. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4303. do { \
  4304. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4305. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4306. } while (0)
  4307. /* for systems using 64-bit format for bus addr */
  4308. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4309. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4310. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4311. do { \
  4312. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4313. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4314. } while (0)
  4315. /* for systems using 64-bit format for bus addr */
  4316. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4317. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4318. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4319. do { \
  4320. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4321. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4322. } while (0)
  4323. /*
  4324. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4325. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4326. * addresses are stored in a XXX-bit field.
  4327. * This macro is used to define both htt_wdi_ipa_config32_t and
  4328. * htt_wdi_ipa_config64_t structs.
  4329. */
  4330. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4331. _paddr__tx_comp_ring_base_addr_, \
  4332. _paddr__tx_comp_wr_idx_addr_, \
  4333. _paddr__tx_ce_wr_idx_addr_, \
  4334. _paddr__rx_ind_ring_base_addr_, \
  4335. _paddr__rx_ind_rd_idx_addr_, \
  4336. _paddr__rx_ind_wr_idx_addr_, \
  4337. _paddr__rx_ring2_base_addr_,\
  4338. _paddr__rx_ring2_rd_idx_addr_,\
  4339. _paddr__rx_ring2_wr_idx_addr_) \
  4340. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4341. { \
  4342. /* DWORD 0: flags and meta-data */ \
  4343. A_UINT32 \
  4344. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4345. reserved: 8, \
  4346. tx_pkt_pool_size: 16;\
  4347. /* DWORD 1 */\
  4348. _paddr__tx_comp_ring_base_addr_;\
  4349. /* DWORD 2 (or 3)*/\
  4350. A_UINT32 tx_comp_ring_size;\
  4351. /* DWORD 3 (or 4)*/\
  4352. _paddr__tx_comp_wr_idx_addr_;\
  4353. /* DWORD 4 (or 6)*/\
  4354. _paddr__tx_ce_wr_idx_addr_;\
  4355. /* DWORD 5 (or 8)*/\
  4356. _paddr__rx_ind_ring_base_addr_;\
  4357. /* DWORD 6 (or 10)*/\
  4358. A_UINT32 rx_ind_ring_size;\
  4359. /* DWORD 7 (or 11)*/\
  4360. _paddr__rx_ind_rd_idx_addr_;\
  4361. /* DWORD 8 (or 13)*/\
  4362. _paddr__rx_ind_wr_idx_addr_;\
  4363. /* DWORD 9 (or 15)*/\
  4364. _paddr__rx_ring2_base_addr_;\
  4365. /* DWORD 10 (or 17) */\
  4366. A_UINT32 rx_ring2_size;\
  4367. /* DWORD 11 (or 18) */\
  4368. _paddr__rx_ring2_rd_idx_addr_;\
  4369. /* DWORD 12 (or 20) */\
  4370. _paddr__rx_ring2_wr_idx_addr_;\
  4371. } POSTPACK
  4372. /* define a htt_wdi_ipa_config32_t type */
  4373. 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));
  4374. /* define a htt_wdi_ipa_config64_t type */
  4375. 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));
  4376. #if HTT_PADDR64
  4377. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4378. #else
  4379. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4380. #endif
  4381. enum htt_wdi_ipa_op_code {
  4382. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4383. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4384. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4385. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4386. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4387. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4388. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4389. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4390. /* keep this last */
  4391. HTT_WDI_IPA_OPCODE_MAX
  4392. };
  4393. /**
  4394. * @brief HTT WDI_IPA Operation Request Message
  4395. *
  4396. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4397. *
  4398. * @details
  4399. * HTT WDI_IPA Operation Request message is sent by host
  4400. * to either suspend or resume WDI_IPA TX or RX path.
  4401. * |31 24|23 16|15 8|7 0|
  4402. * |----------------+----------------+----------------+----------------|
  4403. * | op_code | Rsvd | msg_type |
  4404. * |-------------------------------------------------------------------|
  4405. *
  4406. * Header fields:
  4407. * - MSG_TYPE
  4408. * Bits 7:0
  4409. * Purpose: Identifies this as WDI_IPA Operation Request message
  4410. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4411. * - OP_CODE
  4412. * Bits 31:16
  4413. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4414. * value: = enum htt_wdi_ipa_op_code
  4415. */
  4416. PREPACK struct htt_wdi_ipa_op_request_t
  4417. {
  4418. /* DWORD 0: flags and meta-data */
  4419. A_UINT32
  4420. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4421. reserved: 8,
  4422. op_code: 16;
  4423. } POSTPACK;
  4424. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4425. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4426. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4427. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4428. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4429. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4430. do { \
  4431. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4432. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4433. } while (0)
  4434. /*
  4435. * @brief host -> target HTT_MSI_SETUP message
  4436. *
  4437. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4438. *
  4439. * @details
  4440. * After target is booted up, host can send MSI setup message so that
  4441. * target sets up HW registers based on setup message.
  4442. *
  4443. * The message would appear as follows:
  4444. * |31 24|23 16|15|14 8|7 0|
  4445. * |---------------+-----------------+-----------------+-----------------|
  4446. * | reserved | msi_type | pdev_id | msg_type |
  4447. * |---------------------------------------------------------------------|
  4448. * | msi_addr_lo |
  4449. * |---------------------------------------------------------------------|
  4450. * | msi_addr_hi |
  4451. * |---------------------------------------------------------------------|
  4452. * | msi_data |
  4453. * |---------------------------------------------------------------------|
  4454. *
  4455. * The message is interpreted as follows:
  4456. * dword0 - b'0:7 - msg_type: This will be set to
  4457. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4458. * b'8:15 - pdev_id:
  4459. * 0 (for rings at SOC/UMAC level),
  4460. * 1/2/3 mac id (for rings at LMAC level)
  4461. * b'16:23 - msi_type: identify which msi registers need to be setup
  4462. * more details can be got from enum htt_msi_setup_type
  4463. * b'24:31 - reserved
  4464. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4465. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4466. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4467. */
  4468. PREPACK struct htt_msi_setup_t {
  4469. A_UINT32 msg_type: 8,
  4470. pdev_id: 8,
  4471. msi_type: 8,
  4472. reserved: 8;
  4473. A_UINT32 msi_addr_lo;
  4474. A_UINT32 msi_addr_hi;
  4475. A_UINT32 msi_data;
  4476. } POSTPACK;
  4477. enum htt_msi_setup_type {
  4478. HTT_PPDU_END_MSI_SETUP_TYPE,
  4479. /* Insert new types here*/
  4480. };
  4481. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4482. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4483. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4484. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4485. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4486. HTT_MSI_SETUP_PDEV_ID_S)
  4487. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4488. do { \
  4489. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4490. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4491. } while (0)
  4492. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4493. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4494. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4495. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4496. HTT_MSI_SETUP_MSI_TYPE_S)
  4497. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4498. do { \
  4499. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4500. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4501. } while (0)
  4502. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4503. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4504. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4505. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4506. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4507. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4508. do { \
  4509. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4510. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4511. } while (0)
  4512. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4513. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4514. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4515. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4516. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4517. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4518. do { \
  4519. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4520. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4521. } while (0)
  4522. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4523. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4524. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4525. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4526. HTT_MSI_SETUP_MSI_DATA_S)
  4527. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4528. do { \
  4529. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4530. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4531. } while (0)
  4532. /*
  4533. * @brief host -> target HTT_SRING_SETUP message
  4534. *
  4535. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4536. *
  4537. * @details
  4538. * After target is booted up, Host can send SRING setup message for
  4539. * each host facing LMAC SRING. Target setups up HW registers based
  4540. * on setup message and confirms back to Host if response_required is set.
  4541. * Host should wait for confirmation message before sending new SRING
  4542. * setup message
  4543. *
  4544. * The message would appear as follows:
  4545. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4546. * |--------------- +-----------------+-----------------+-----------------|
  4547. * | ring_type | ring_id | pdev_id | msg_type |
  4548. * |----------------------------------------------------------------------|
  4549. * | ring_base_addr_lo |
  4550. * |----------------------------------------------------------------------|
  4551. * | ring_base_addr_hi |
  4552. * |----------------------------------------------------------------------|
  4553. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4554. * |----------------------------------------------------------------------|
  4555. * | ring_head_offset32_remote_addr_lo |
  4556. * |----------------------------------------------------------------------|
  4557. * | ring_head_offset32_remote_addr_hi |
  4558. * |----------------------------------------------------------------------|
  4559. * | ring_tail_offset32_remote_addr_lo |
  4560. * |----------------------------------------------------------------------|
  4561. * | ring_tail_offset32_remote_addr_hi |
  4562. * |----------------------------------------------------------------------|
  4563. * | ring_msi_addr_lo |
  4564. * |----------------------------------------------------------------------|
  4565. * | ring_msi_addr_hi |
  4566. * |----------------------------------------------------------------------|
  4567. * | ring_msi_data |
  4568. * |----------------------------------------------------------------------|
  4569. * | intr_timer_th |IM| intr_batch_counter_th |
  4570. * |----------------------------------------------------------------------|
  4571. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4572. * |----------------------------------------------------------------------|
  4573. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4574. * |----------------------------------------------------------------------|
  4575. * Where
  4576. * IM = sw_intr_mode
  4577. * RR = response_required
  4578. * PTCF = prefetch_timer_cfg
  4579. * IP = IPA drop flag
  4580. *
  4581. * The message is interpreted as follows:
  4582. * dword0 - b'0:7 - msg_type: This will be set to
  4583. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4584. * b'8:15 - pdev_id:
  4585. * 0 (for rings at SOC/UMAC level),
  4586. * 1/2/3 mac id (for rings at LMAC level)
  4587. * b'16:23 - ring_id: identify which ring is to setup,
  4588. * more details can be got from enum htt_srng_ring_id
  4589. * b'24:31 - ring_type: identify type of host rings,
  4590. * more details can be got from enum htt_srng_ring_type
  4591. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4592. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4593. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4594. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4595. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4596. * SW_TO_HW_RING.
  4597. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4598. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4599. * Lower 32 bits of memory address of the remote variable
  4600. * storing the 4-byte word offset that identifies the head
  4601. * element within the ring.
  4602. * (The head offset variable has type A_UINT32.)
  4603. * Valid for HW_TO_SW and SW_TO_SW rings.
  4604. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4605. * Upper 32 bits of memory address of the remote variable
  4606. * storing the 4-byte word offset that identifies the head
  4607. * element within the ring.
  4608. * (The head offset variable has type A_UINT32.)
  4609. * Valid for HW_TO_SW and SW_TO_SW rings.
  4610. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4611. * Lower 32 bits of memory address of the remote variable
  4612. * storing the 4-byte word offset that identifies the tail
  4613. * element within the ring.
  4614. * (The tail offset variable has type A_UINT32.)
  4615. * Valid for HW_TO_SW and SW_TO_SW rings.
  4616. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4617. * Upper 32 bits of memory address of the remote variable
  4618. * storing the 4-byte word offset that identifies the tail
  4619. * element within the ring.
  4620. * (The tail offset variable has type A_UINT32.)
  4621. * Valid for HW_TO_SW and SW_TO_SW rings.
  4622. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4623. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4624. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4625. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4626. * dword10 - b'0:31 - ring_msi_data: MSI data
  4627. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4628. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4629. * dword11 - b'0:14 - intr_batch_counter_th:
  4630. * batch counter threshold is in units of 4-byte words.
  4631. * HW internally maintains and increments batch count.
  4632. * (see SRING spec for detail description).
  4633. * When batch count reaches threshold value, an interrupt
  4634. * is generated by HW.
  4635. * b'15 - sw_intr_mode:
  4636. * This configuration shall be static.
  4637. * Only programmed at power up.
  4638. * 0: generate pulse style sw interrupts
  4639. * 1: generate level style sw interrupts
  4640. * b'16:31 - intr_timer_th:
  4641. * The timer init value when timer is idle or is
  4642. * initialized to start downcounting.
  4643. * In 8us units (to cover a range of 0 to 524 ms)
  4644. * dword12 - b'0:15 - intr_low_threshold:
  4645. * Used only by Consumer ring to generate ring_sw_int_p.
  4646. * Ring entries low threshold water mark, that is used
  4647. * in combination with the interrupt timer as well as
  4648. * the the clearing of the level interrupt.
  4649. * b'16:18 - prefetch_timer_cfg:
  4650. * Used only by Consumer ring to set timer mode to
  4651. * support Application prefetch handling.
  4652. * The external tail offset/pointer will be updated
  4653. * at following intervals:
  4654. * 3'b000: (Prefetch feature disabled; used only for debug)
  4655. * 3'b001: 1 usec
  4656. * 3'b010: 4 usec
  4657. * 3'b011: 8 usec (default)
  4658. * 3'b100: 16 usec
  4659. * Others: Reserverd
  4660. * b'19 - response_required:
  4661. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4662. * b'20 - ipa_drop_flag:
  4663. Indicates that host will config ipa drop threshold percentage
  4664. * b'21:31 - reserved: reserved for future use
  4665. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4666. * b'8:15 - ipa drop high threshold percentage:
  4667. * b'16:31 - Reserved
  4668. */
  4669. PREPACK struct htt_sring_setup_t {
  4670. A_UINT32 msg_type: 8,
  4671. pdev_id: 8,
  4672. ring_id: 8,
  4673. ring_type: 8;
  4674. A_UINT32 ring_base_addr_lo;
  4675. A_UINT32 ring_base_addr_hi;
  4676. A_UINT32 ring_size: 16,
  4677. ring_entry_size: 8,
  4678. ring_misc_cfg_flag: 8;
  4679. A_UINT32 ring_head_offset32_remote_addr_lo;
  4680. A_UINT32 ring_head_offset32_remote_addr_hi;
  4681. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4682. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4683. A_UINT32 ring_msi_addr_lo;
  4684. A_UINT32 ring_msi_addr_hi;
  4685. A_UINT32 ring_msi_data;
  4686. A_UINT32 intr_batch_counter_th: 15,
  4687. sw_intr_mode: 1,
  4688. intr_timer_th: 16;
  4689. A_UINT32 intr_low_threshold: 16,
  4690. prefetch_timer_cfg: 3,
  4691. response_required: 1,
  4692. ipa_drop_flag: 1,
  4693. reserved1: 11;
  4694. A_UINT32 ipa_drop_low_threshold: 8,
  4695. ipa_drop_high_threshold: 8,
  4696. reserved: 16;
  4697. } POSTPACK;
  4698. enum htt_srng_ring_type {
  4699. HTT_HW_TO_SW_RING = 0,
  4700. HTT_SW_TO_HW_RING,
  4701. HTT_SW_TO_SW_RING,
  4702. /* Insert new ring types above this line */
  4703. };
  4704. enum htt_srng_ring_id {
  4705. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4706. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4707. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4708. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4709. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4710. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4711. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4712. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4713. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4714. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4715. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4716. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4717. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4718. /* Add Other SRING which can't be directly configured by host software above this line */
  4719. };
  4720. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4721. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4722. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4723. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4724. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4725. HTT_SRING_SETUP_PDEV_ID_S)
  4726. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4727. do { \
  4728. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4729. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4730. } while (0)
  4731. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4732. #define HTT_SRING_SETUP_RING_ID_S 16
  4733. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4734. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4735. HTT_SRING_SETUP_RING_ID_S)
  4736. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4737. do { \
  4738. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4739. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4740. } while (0)
  4741. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4742. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4743. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4744. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4745. HTT_SRING_SETUP_RING_TYPE_S)
  4746. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4747. do { \
  4748. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4749. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4750. } while (0)
  4751. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4752. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4753. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4754. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4755. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4756. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4757. do { \
  4758. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4759. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4760. } while (0)
  4761. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4762. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4763. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4764. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4765. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4766. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4767. do { \
  4768. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4769. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4770. } while (0)
  4771. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4772. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4773. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4774. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4775. HTT_SRING_SETUP_RING_SIZE_S)
  4776. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4777. do { \
  4778. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4779. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4780. } while (0)
  4781. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4782. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4783. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4784. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4785. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4786. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4787. do { \
  4788. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4789. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4790. } while (0)
  4791. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4792. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4793. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4794. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4795. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4796. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4797. do { \
  4798. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4799. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4800. } while (0)
  4801. /* This control bit is applicable to only Producer, which updates Ring ID field
  4802. * of each descriptor before pushing into the ring.
  4803. * 0: updates ring_id(default)
  4804. * 1: ring_id updating disabled */
  4805. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4806. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4807. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4808. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4809. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4810. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4811. do { \
  4812. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4813. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4814. } while (0)
  4815. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4816. * of each descriptor before pushing into the ring.
  4817. * 0: updates Loopcnt(default)
  4818. * 1: Loopcnt updating disabled */
  4819. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4820. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4821. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4822. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4823. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4824. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4825. do { \
  4826. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4827. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4828. } while (0)
  4829. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4830. * into security_id port of GXI/AXI. */
  4831. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4832. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4833. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4834. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4835. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4836. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4837. do { \
  4838. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4839. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4840. } while (0)
  4841. /* During MSI write operation, SRNG drives value of this register bit into
  4842. * swap bit of GXI/AXI. */
  4843. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4844. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4845. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4846. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4847. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4848. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4849. do { \
  4850. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4851. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4852. } while (0)
  4853. /* During Pointer write operation, SRNG drives value of this register bit into
  4854. * swap bit of GXI/AXI. */
  4855. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4856. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4857. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4858. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4859. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4860. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4861. do { \
  4862. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4863. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4864. } while (0)
  4865. /* During any data or TLV write operation, SRNG drives value of this register
  4866. * bit into swap bit of GXI/AXI. */
  4867. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4868. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4869. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4870. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4871. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4872. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4873. do { \
  4874. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4875. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4876. } while (0)
  4877. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4878. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4879. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4880. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4881. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4882. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4883. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4884. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4885. do { \
  4886. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4887. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4888. } while (0)
  4889. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4890. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4891. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4892. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4893. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4894. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4895. do { \
  4896. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4897. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4898. } while (0)
  4899. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4900. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4901. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4902. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4903. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4904. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4905. do { \
  4906. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4907. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4908. } while (0)
  4909. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4910. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4911. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4912. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4913. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4914. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4915. do { \
  4916. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4917. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4918. } while (0)
  4919. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4920. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4921. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4922. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4923. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4924. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4925. do { \
  4926. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4927. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4928. } while (0)
  4929. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4930. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4931. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4932. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4933. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4934. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4935. do { \
  4936. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4937. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4938. } while (0)
  4939. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4940. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4941. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4942. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4943. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4944. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4945. do { \
  4946. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4947. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4948. } while (0)
  4949. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4950. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4951. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4952. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4953. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4954. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4955. do { \
  4956. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4957. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4958. } while (0)
  4959. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4960. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4961. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4962. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4963. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4964. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4965. do { \
  4966. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4967. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4968. } while (0)
  4969. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4970. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4971. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4972. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4973. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4974. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4975. do { \
  4976. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4977. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4978. } while (0)
  4979. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4980. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4981. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4982. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4983. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4984. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4985. do { \
  4986. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4987. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4988. } while (0)
  4989. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4990. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4991. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4992. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4993. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4994. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4995. do { \
  4996. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4997. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4998. } while (0)
  4999. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  5000. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  5001. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5002. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5003. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5004. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5005. do { \
  5006. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5007. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5008. } while (0)
  5009. /**
  5010. * @brief host -> target RX ring selection config message
  5011. *
  5012. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5013. *
  5014. * @details
  5015. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5016. * configure RXDMA rings.
  5017. * The configuration is per ring based and includes both packet subtypes
  5018. * and PPDU/MPDU TLVs.
  5019. *
  5020. * The message would appear as follows:
  5021. *
  5022. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5023. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5024. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5025. * |-------------------------------------------------------------------|
  5026. * | rsvd2 | ring_buffer_size |
  5027. * |-------------------------------------------------------------------|
  5028. * | packet_type_enable_flags_0 |
  5029. * |-------------------------------------------------------------------|
  5030. * | packet_type_enable_flags_1 |
  5031. * |-------------------------------------------------------------------|
  5032. * | packet_type_enable_flags_2 |
  5033. * |-------------------------------------------------------------------|
  5034. * | packet_type_enable_flags_3 |
  5035. * |-------------------------------------------------------------------|
  5036. * | tlv_filter_in_flags |
  5037. * |-------------------------------------------------------------------|
  5038. * | rx_header_offset | rx_packet_offset |
  5039. * |-------------------------------------------------------------------|
  5040. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5041. * |-------------------------------------------------------------------|
  5042. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5043. * |-------------------------------------------------------------------|
  5044. * | rsvd3 | rx_attention_offset |
  5045. * |-------------------------------------------------------------------|
  5046. * | rsvd4 | mo| fp| rx_drop_threshold |
  5047. * | |ndp|ndp| |
  5048. * |-------------------------------------------------------------------|
  5049. * Where:
  5050. * PS = pkt_swap
  5051. * SS = status_swap
  5052. * OV = rx_offsets_valid
  5053. * DT = drop_thresh_valid
  5054. * The message is interpreted as follows:
  5055. * dword0 - b'0:7 - msg_type: This will be set to
  5056. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5057. * b'8:15 - pdev_id:
  5058. * 0 (for rings at SOC/UMAC level),
  5059. * 1/2/3 mac id (for rings at LMAC level)
  5060. * b'16:23 - ring_id : Identify the ring to configure.
  5061. * More details can be got from enum htt_srng_ring_id
  5062. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5063. * BUF_RING_CFG_0 defs within HW .h files,
  5064. * e.g. wmac_top_reg_seq_hwioreg.h
  5065. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5066. * BUF_RING_CFG_0 defs within HW .h files,
  5067. * e.g. wmac_top_reg_seq_hwioreg.h
  5068. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5069. * configuration fields are valid
  5070. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5071. * rx_drop_threshold field is valid
  5072. * b'28 - rx_mon_global_en: Enable/Disable global register
  5073. 8 configuration in Rx monitor module.
  5074. * b'29:31 - rsvd1: reserved for future use
  5075. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5076. * in byte units.
  5077. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5078. * b'16:18 - config_length_mgmt (MGMT):
  5079. * Represents the length of mpdu bytes for mgmt pkt.
  5080. * valid values:
  5081. * 001 - 64bytes
  5082. * 010 - 128bytes
  5083. * 100 - 256bytes
  5084. * 111 - Full mpdu bytes
  5085. * b'19:21 - config_length_ctrl (CTRL):
  5086. * Represents the length of mpdu bytes for ctrl pkt.
  5087. * valid values:
  5088. * 001 - 64bytes
  5089. * 010 - 128bytes
  5090. * 100 - 256bytes
  5091. * 111 - Full mpdu bytes
  5092. * b'22:24 - config_length_data (DATA):
  5093. * Represents the length of mpdu bytes for data pkt.
  5094. * valid values:
  5095. * 001 - 64bytes
  5096. * 010 - 128bytes
  5097. * 100 - 256bytes
  5098. * 111 - Full mpdu bytes
  5099. * b'25:26 - rx_hdr_len:
  5100. * Specifies the number of bytes of recvd packet to copy
  5101. * into the rx_hdr tlv.
  5102. * supported values for now by host:
  5103. * 01 - 64bytes
  5104. * 10 - 128bytes
  5105. * 11 - 256bytes
  5106. * default - 128 bytes
  5107. * b'27:31 - rsvd2: Reserved for future use
  5108. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5109. * Enable MGMT packet from 0b0000 to 0b1001
  5110. * bits from low to high: FP, MD, MO - 3 bits
  5111. * FP: Filter_Pass
  5112. * MD: Monitor_Direct
  5113. * MO: Monitor_Other
  5114. * 10 mgmt subtypes * 3 bits -> 30 bits
  5115. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5116. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5117. * Enable MGMT packet from 0b1010 to 0b1111
  5118. * bits from low to high: FP, MD, MO - 3 bits
  5119. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5120. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5121. * Enable CTRL packet from 0b0000 to 0b1001
  5122. * bits from low to high: FP, MD, MO - 3 bits
  5123. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5124. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5125. * Enable CTRL packet from 0b1010 to 0b1111,
  5126. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5127. * bits from low to high: FP, MD, MO - 3 bits
  5128. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5129. * dword6 - b'0:31 - tlv_filter_in_flags:
  5130. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5131. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5132. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5133. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5134. * A value of 0 will be considered as ignore this config.
  5135. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5136. * e.g. wmac_top_reg_seq_hwioreg.h
  5137. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5138. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5139. * A value of 0 will be considered as ignore this config.
  5140. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5141. * e.g. wmac_top_reg_seq_hwioreg.h
  5142. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5143. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5144. * A value of 0 will be considered as ignore this config.
  5145. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5146. * e.g. wmac_top_reg_seq_hwioreg.h
  5147. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5148. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5149. * A value of 0 will be considered as ignore this config.
  5150. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5151. * e.g. wmac_top_reg_seq_hwioreg.h
  5152. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5153. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5154. * A value of 0 will be considered as ignore this config.
  5155. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5156. * e.g. wmac_top_reg_seq_hwioreg.h
  5157. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5158. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5159. * A value of 0 will be considered as ignore this config.
  5160. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5161. * e.g. wmac_top_reg_seq_hwioreg.h
  5162. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5163. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5164. * A value of 0 will be considered as ignore this config.
  5165. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5166. * e.g. wmac_top_reg_seq_hwioreg.h
  5167. * - b'16:31 - rsvd3 for future use
  5168. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5169. * to source rings. Consumer drops packets if the available
  5170. * words in the ring falls below the configured threshold
  5171. * value.
  5172. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5173. * by host. 1 -> subscribed
  5174. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5175. * by host. 1 -> subscribed
  5176. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5177. * subscribed by host. 1 -> subscribed
  5178. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5179. * selection for the FP PHY ERR status tlv.
  5180. * 0 - wbm2rxdma_buf_source_ring
  5181. * 1 - fw2rxdma_buf_source_ring
  5182. * 2 - sw2rxdma_buf_source_ring
  5183. * 3 - no_buffer_ring
  5184. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5185. * selection for the FP PHY ERR status tlv.
  5186. * 0 - rxdma_release_ring
  5187. * 1 - rxdma2fw_ring
  5188. * 2 - rxdma2sw_ring
  5189. * 3 - rxdma2reo_ring
  5190. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5191. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5192. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5193. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5194. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5195. * 0: MSDU level logging
  5196. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5197. * 0: MSDU level logging
  5198. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5199. * 0: MSDU level logging
  5200. * - b'23 - word_mask_compaction: enable/disable word mask for
  5201. * mpdu/msdu start/end tlvs
  5202. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5203. * manager override
  5204. * - b'25:28 - rbm_override_val: return buffer manager override value
  5205. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5206. * which have to be posted to host from phy.
  5207. * Corresponding to errors defined in
  5208. * phyrx_abort_request_reason enums 0 to 31.
  5209. * Refer to RXPCU register definition header files for the
  5210. * phyrx_abort_request_reason enum definition.
  5211. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5212. * errors which have to be posted to host from phy.
  5213. * Corresponding to errors defined in
  5214. * phyrx_abort_request_reason enums 32 to 63.
  5215. * Refer to RXPCU register definition header files for the
  5216. * phyrx_abort_request_reason enum definition.
  5217. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5218. * applicable if word mask enabled
  5219. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5220. * applicable if word mask enabled
  5221. * - b'19:31 - rsvd7
  5222. * dword15- b'0:16 - rx_msdu_end_word_mask
  5223. * - b'17:31 - rsvd5
  5224. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5225. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5226. * buffer
  5227. * 1: RX_PKT TLV logging at specified offset for the
  5228. * subsequent buffer
  5229. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5230. */
  5231. PREPACK struct htt_rx_ring_selection_cfg_t {
  5232. A_UINT32 msg_type: 8,
  5233. pdev_id: 8,
  5234. ring_id: 8,
  5235. status_swap: 1,
  5236. pkt_swap: 1,
  5237. rx_offsets_valid: 1,
  5238. drop_thresh_valid: 1,
  5239. rx_mon_global_en: 1,
  5240. rsvd1: 3;
  5241. A_UINT32 ring_buffer_size: 16,
  5242. config_length_mgmt:3,
  5243. config_length_ctrl:3,
  5244. config_length_data:3,
  5245. rx_hdr_len: 2,
  5246. rsvd2: 5;
  5247. A_UINT32 packet_type_enable_flags_0;
  5248. A_UINT32 packet_type_enable_flags_1;
  5249. A_UINT32 packet_type_enable_flags_2;
  5250. A_UINT32 packet_type_enable_flags_3;
  5251. A_UINT32 tlv_filter_in_flags;
  5252. A_UINT32 rx_packet_offset: 16,
  5253. rx_header_offset: 16;
  5254. A_UINT32 rx_mpdu_end_offset: 16,
  5255. rx_mpdu_start_offset: 16;
  5256. A_UINT32 rx_msdu_end_offset: 16,
  5257. rx_msdu_start_offset: 16;
  5258. A_UINT32 rx_attn_offset: 16,
  5259. rsvd3: 16;
  5260. A_UINT32 rx_drop_threshold: 10,
  5261. fp_ndp: 1,
  5262. mo_ndp: 1,
  5263. fp_phy_err: 1,
  5264. fp_phy_err_buf_src: 2,
  5265. fp_phy_err_buf_dest: 2,
  5266. pkt_type_enable_msdu_or_mpdu_logging:3,
  5267. dma_mpdu_mgmt: 1,
  5268. dma_mpdu_ctrl: 1,
  5269. dma_mpdu_data: 1,
  5270. word_mask_compaction_enable:1,
  5271. rbm_override_enable: 1,
  5272. rbm_override_val: 4,
  5273. rsvd4: 3;
  5274. A_UINT32 phy_err_mask;
  5275. A_UINT32 phy_err_mask_cont;
  5276. A_UINT32 rx_mpdu_start_word_mask:16,
  5277. rx_mpdu_end_word_mask: 3,
  5278. rsvd7: 13;
  5279. A_UINT32 rx_msdu_end_word_mask: 17,
  5280. rsvd5: 15;
  5281. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5282. rx_pkt_tlv_offset: 15,
  5283. rsvd6: 16;
  5284. } POSTPACK;
  5285. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5286. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5287. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5288. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5289. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5290. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5291. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5292. do { \
  5293. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5294. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5295. } while (0)
  5296. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5297. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5298. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5299. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5300. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5301. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5302. do { \
  5303. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5304. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5305. } while (0)
  5306. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5307. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5308. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5309. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5310. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5311. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5312. do { \
  5313. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5314. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5315. } while (0)
  5316. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5317. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5318. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5319. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5320. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5321. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5322. do { \
  5323. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5324. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5325. } while (0)
  5326. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5327. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5328. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5329. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5330. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5331. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5332. do { \
  5333. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5334. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5335. } while (0)
  5336. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5337. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5338. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5339. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5340. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5341. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5342. do { \
  5343. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5344. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5345. } while (0)
  5346. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5347. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5348. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5349. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5350. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5351. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5352. do { \
  5353. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5354. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5355. } while (0)
  5356. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5357. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5358. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5359. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5360. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5361. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5362. do { \
  5363. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5364. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5365. } while (0)
  5366. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5367. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5368. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5369. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5370. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5371. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5372. do { \
  5373. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5374. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5375. } while (0)
  5376. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5377. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5378. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5379. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5380. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5381. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5382. do { \
  5383. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5384. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5385. } while (0)
  5386. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5387. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5388. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5389. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5390. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5391. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5392. do { \
  5393. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5394. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5395. } while (0)
  5396. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5397. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5398. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5399. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5400. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5401. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5402. do { \
  5403. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5404. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5405. } while(0)
  5406. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5407. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5408. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5409. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5410. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5411. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5412. do { \
  5413. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5414. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5415. } while (0)
  5416. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5417. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5418. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5419. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5420. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5421. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5422. do { \
  5423. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5424. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5425. } while (0)
  5426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5427. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5428. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5429. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5430. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5431. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5432. do { \
  5433. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5434. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5435. } while (0)
  5436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5437. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5438. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5439. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5440. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5441. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5442. do { \
  5443. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5444. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5445. } while (0)
  5446. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5447. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5448. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5449. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5450. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5451. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5452. do { \
  5453. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5454. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5455. } while (0)
  5456. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5457. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5458. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5459. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5460. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5461. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5462. do { \
  5463. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5464. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5465. } while (0)
  5466. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5467. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5468. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5469. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5470. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5471. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5472. do { \
  5473. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5474. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5475. } while (0)
  5476. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5477. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5478. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5479. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5480. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5481. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5482. do { \
  5483. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5484. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5485. } while (0)
  5486. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5487. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5488. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5489. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5490. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5491. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5492. do { \
  5493. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5494. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5495. } while (0)
  5496. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5497. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5498. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5499. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5500. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5501. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5502. do { \
  5503. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5504. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5505. } while (0)
  5506. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5507. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5508. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5509. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5510. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5511. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5512. do { \
  5513. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5514. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5515. } while (0)
  5516. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5517. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5518. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5519. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5520. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5521. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5522. do { \
  5523. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5524. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5525. } while (0)
  5526. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5527. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5528. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5529. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5530. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5531. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5532. do { \
  5533. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5534. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5535. } while (0)
  5536. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5537. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5538. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5539. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5540. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5541. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5542. do { \
  5543. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5544. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5545. } while (0)
  5546. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5547. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5548. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5549. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5550. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5551. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5552. do { \
  5553. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5554. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5555. } while (0)
  5556. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5557. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5558. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5559. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5560. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5561. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5562. do { \
  5563. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5564. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5565. } while (0)
  5566. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5567. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5568. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5569. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5570. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5571. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5572. do { \
  5573. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5574. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5575. } while (0)
  5576. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5577. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5578. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5579. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5580. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5581. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5582. do { \
  5583. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5584. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5585. } while (0)
  5586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5587. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5588. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5589. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5590. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5591. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5592. do { \
  5593. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5594. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5595. } while (0)
  5596. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5597. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5598. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5599. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5600. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5601. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5602. do { \
  5603. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5604. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5605. } while (0)
  5606. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5607. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5608. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5609. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5610. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5611. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5612. do { \
  5613. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5614. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5615. } while (0)
  5616. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5617. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5618. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5619. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5620. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5621. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5622. do { \
  5623. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5624. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5625. } while (0)
  5626. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5627. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5628. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5629. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5630. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5631. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5632. do { \
  5633. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5634. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5635. } while (0)
  5636. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5637. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5638. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5639. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5640. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5641. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5642. do { \
  5643. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5644. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5645. } while (0)
  5646. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5647. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5648. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5649. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5650. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5651. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5652. do { \
  5653. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5654. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5655. } while (0)
  5656. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5657. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5658. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5659. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5660. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5661. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5662. do { \
  5663. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5664. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5665. } while (0)
  5666. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5667. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5668. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5669. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5670. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5671. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5672. do { \
  5673. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5674. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5675. } while (0)
  5676. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5677. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5678. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5679. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5680. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5681. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5682. do { \
  5683. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5684. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5685. } while (0)
  5686. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5687. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5688. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5689. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5690. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5691. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5692. do { \
  5693. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5694. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5695. } while (0)
  5696. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5697. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5698. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5699. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5700. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5701. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5702. do { \
  5703. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5704. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5705. } while (0)
  5706. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5707. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5708. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5709. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5710. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5711. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5712. do { \
  5713. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5714. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5715. } while (0)
  5716. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5717. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5718. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5719. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5720. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5721. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5722. do { \
  5723. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5724. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5725. } while (0)
  5726. /*
  5727. * Subtype based MGMT frames enable bits.
  5728. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5729. */
  5730. /* association request */
  5731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5733. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5735. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5737. /* association response */
  5738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5742. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5744. /* Reassociation request */
  5745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5749. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5751. /* Reassociation response */
  5752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5756. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5758. /* Probe request */
  5759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5763. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5765. /* Probe response */
  5766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5770. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5772. /* Timing Advertisement */
  5773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5777. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5779. /* Reserved */
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5784. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5786. /* Beacon */
  5787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5791. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5793. /* ATIM */
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5798. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5800. /* Disassociation */
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5805. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5807. /* Authentication */
  5808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5812. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5814. /* Deauthentication */
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5819. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5821. /* Action */
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5826. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5828. /* Action No Ack */
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5833. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5835. /* Reserved */
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5840. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5841. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5842. /*
  5843. * Subtype based CTRL frames enable bits.
  5844. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5845. */
  5846. /* Reserved */
  5847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5851. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5853. /* Reserved */
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5858. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5860. /* Reserved */
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5865. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5867. /* Reserved */
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5872. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5874. /* Reserved */
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5879. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5881. /* Reserved */
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5886. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5888. /* Reserved */
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5893. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5895. /* Control Wrapper */
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5900. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5902. /* Block Ack Request */
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5907. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5909. /* Block Ack*/
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5914. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5916. /* PS-POLL */
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5921. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5923. /* RTS */
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5928. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5930. /* CTS */
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5935. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5937. /* ACK */
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5942. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5944. /* CF-END */
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5949. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5951. /* CF-END + CF-ACK */
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5956. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5958. /* Multicast data */
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5963. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5965. /* Unicast data */
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5970. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5972. /* NULL data */
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5978. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5979. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5980. do { \
  5981. HTT_CHECK_SET_VAL(httsym, value); \
  5982. (word) |= (value) << httsym##_S; \
  5983. } while (0)
  5984. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5985. (((word) & httsym##_M) >> httsym##_S)
  5986. #define htt_rx_ring_pkt_enable_subtype_set( \
  5987. word, flag, mode, type, subtype, val) \
  5988. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5989. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5990. #define htt_rx_ring_pkt_enable_subtype_get( \
  5991. word, flag, mode, type, subtype) \
  5992. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5993. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5994. /* Definition to filter in TLVs */
  5995. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5996. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5997. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5998. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5999. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  6000. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  6001. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6002. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6003. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6004. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6005. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6006. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6007. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6008. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6009. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6010. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6011. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6012. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6013. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6014. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6021. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6022. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6023. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6024. do { \
  6025. HTT_CHECK_SET_VAL(httsym, enable); \
  6026. (word) |= (enable) << httsym##_S; \
  6027. } while (0)
  6028. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6029. (((word) & httsym##_M) >> httsym##_S)
  6030. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6031. HTT_RX_RING_TLV_ENABLE_SET( \
  6032. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6033. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6034. HTT_RX_RING_TLV_ENABLE_GET( \
  6035. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6036. /**
  6037. * @brief host -> target TX monitor config message
  6038. *
  6039. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6040. *
  6041. * @details
  6042. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6043. * configure RXDMA rings.
  6044. * The configuration is per ring based and includes both packet types
  6045. * and PPDU/MPDU TLVs.
  6046. *
  6047. * The message would appear as follows:
  6048. *
  6049. * |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|
  6050. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6051. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6052. * |-----------+--------+--------+-----+------------------------------------|
  6053. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6054. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6055. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6056. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6057. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6058. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6059. * |------------------------------------------------------------------------|
  6060. * | tlv_filter_mask_in0 |
  6061. * |------------------------------------------------------------------------|
  6062. * | tlv_filter_mask_in1 |
  6063. * |------------------------------------------------------------------------|
  6064. * | tlv_filter_mask_in2 |
  6065. * |------------------------------------------------------------------------|
  6066. * | tlv_filter_mask_in3 |
  6067. * |-----------------+-----------------+---------------------+--------------|
  6068. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6069. * |------------------------------------------------------------------------|
  6070. * | pcu_ppdu_setup_word_mask |
  6071. * |--------------------+--+--+--+-----+---------------------+--------------|
  6072. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6073. * |------------------------------------------------------------------------|
  6074. *
  6075. * Where:
  6076. * PS = pkt_swap
  6077. * SS = status_swap
  6078. * The message is interpreted as follows:
  6079. * dword0 - b'0:7 - msg_type: This will be set to
  6080. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6081. * b'8:15 - pdev_id:
  6082. * 0 (for rings at SOC level),
  6083. * 1/2/3 mac id (for rings at LMAC level)
  6084. * b'16:23 - ring_id : Identify the ring to configure.
  6085. * More details can be got from enum htt_srng_ring_id
  6086. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6087. * BUF_RING_CFG_0 defs within HW .h files,
  6088. * e.g. wmac_top_reg_seq_hwioreg.h
  6089. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6090. * BUF_RING_CFG_0 defs within HW .h files,
  6091. * e.g. wmac_top_reg_seq_hwioreg.h
  6092. * b'26 - tx_mon_global_en: Enable/Disable global register
  6093. * configuration in Tx monitor module.
  6094. * b'27:31 - rsvd1: reserved for future use
  6095. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6096. * in byte units.
  6097. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6098. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6099. * 64, 128, 256.
  6100. * If all 3 bits are set config length is > 256.
  6101. * if val is '0', then ignore this field.
  6102. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6103. * 64, 128, 256.
  6104. * If all 3 bits are set config length is > 256.
  6105. * if val is '0', then ignore this field.
  6106. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6107. * 64, 128, 256.
  6108. * If all 3 bits are set config length is > 256.
  6109. * If val is '0', then ignore this field.
  6110. * - b'25:31 - rsvd2: Reserved for future use
  6111. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6112. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6113. * If packet_type_enable_flags is '1' for MGMT type,
  6114. * monitor will ignore this bit and allow this TLV.
  6115. * If packet_type_enable_flags is '0' for MGMT type,
  6116. * monitor will use this bit to enable/disable logging
  6117. * of this TLV.
  6118. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6119. * If packet_type_enable_flags is '1' for CTRL type,
  6120. * monitor will ignore this bit and allow this TLV.
  6121. * If packet_type_enable_flags is '0' for CTRL type,
  6122. * monitor will use this bit to enable/disable logging
  6123. * of this TLV.
  6124. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6125. * If packet_type_enable_flags is '1' for DATA type,
  6126. * monitor will ignore this bit and allow this TLV.
  6127. * If packet_type_enable_flags is '0' for DATA type,
  6128. * monitor will use this bit to enable/disable logging
  6129. * of this TLV.
  6130. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6131. * If packet_type_enable_flags is '1' for MGMT type,
  6132. * monitor will ignore this bit and allow this TLV.
  6133. * If packet_type_enable_flags is '0' for MGMT type,
  6134. * monitor will use this bit to enable/disable logging
  6135. * of this TLV.
  6136. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6137. * If packet_type_enable_flags is '1' for CTRL type,
  6138. * monitor will ignore this bit and allow this TLV.
  6139. * If packet_type_enable_flags is '0' for CTRL type,
  6140. * monitor will use this bit to enable/disable logging
  6141. * of this TLV.
  6142. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6143. * If packet_type_enable_flags is '1' for DATA type,
  6144. * monitor will ignore this bit and allow this TLV.
  6145. * If packet_type_enable_flags is '0' for DATA type,
  6146. * monitor will use this bit to enable/disable logging
  6147. * of this TLV.
  6148. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6149. * If packet_type_enable_flags is '1' for MGMT type,
  6150. * monitor will ignore this bit and allow this TLV.
  6151. * If packet_type_enable_flags is '0' for MGMT type,
  6152. * monitor will use this bit to enable/disable logging
  6153. * of this TLV.
  6154. * If filter_in_TX_MPDU_START = 1 it is recommended
  6155. * to set this bit.
  6156. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6157. * If packet_type_enable_flags is '1' for CTRL type,
  6158. * monitor will ignore this bit and allow this TLV.
  6159. * If packet_type_enable_flags is '0' for CTRL type,
  6160. * monitor will use this bit to enable/disable logging
  6161. * of this TLV.
  6162. * If filter_in_TX_MPDU_START = 1 it is recommended
  6163. * to set this bit.
  6164. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6165. * If packet_type_enable_flags is '1' for DATA type,
  6166. * monitor will ignore this bit and allow this TLV.
  6167. * If packet_type_enable_flags is '0' for DATA type,
  6168. * monitor will use this bit to enable/disable logging
  6169. * of this TLV.
  6170. * If filter_in_TX_MPDU_START = 1 it is recommended
  6171. * to set this bit.
  6172. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6173. * If packet_type_enable_flags is '1' for MGMT type,
  6174. * monitor will ignore this bit and allow this TLV.
  6175. * If packet_type_enable_flags is '0' for MGMT type,
  6176. * monitor will use this bit to enable/disable logging
  6177. * of this TLV.
  6178. * If filter_in_TX_MSDU_START = 1 it is recommended
  6179. * to set this bit.
  6180. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6181. * If packet_type_enable_flags is '1' for CTRL type,
  6182. * monitor will ignore this bit and allow this TLV.
  6183. * If packet_type_enable_flags is '0' for CTRL type,
  6184. * monitor will use this bit to enable/disable logging
  6185. * of this TLV.
  6186. * If filter_in_TX_MSDU_START = 1 it is recommended
  6187. * to set this bit.
  6188. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6189. * If packet_type_enable_flags is '1' for DATA type,
  6190. * monitor will ignore this bit and allow this TLV.
  6191. * If packet_type_enable_flags is '0' for DATA type,
  6192. * monitor will use this bit to enable/disable logging
  6193. * of this TLV.
  6194. * If filter_in_TX_MSDU_START = 1 it is recommended
  6195. * to set this bit.
  6196. * b'15:31 - rsvd3: Reserved for future use
  6197. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6198. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6199. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6200. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6201. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6202. * - b'8:15 - tx_peer_entry_word_mask:
  6203. * - b'16:23 - tx_queue_ext_word_mask:
  6204. * - b'24:31 - tx_msdu_start_word_mask:
  6205. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6206. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6207. * - b'8:15 - rxpcu_user_setup_word_mask:
  6208. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6209. * MGMT, CTRL, DATA
  6210. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6211. * 0 -> MSDU level logging is enabled
  6212. * (valid only if bit is set in
  6213. * pkt_type_enable_msdu_or_mpdu_logging)
  6214. * 1 -> MPDU level logging is enabled
  6215. * (valid only if bit is set in
  6216. * pkt_type_enable_msdu_or_mpdu_logging)
  6217. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6218. * 0 -> MSDU level logging is enabled
  6219. * (valid only if bit is set in
  6220. * pkt_type_enable_msdu_or_mpdu_logging)
  6221. * 1 -> MPDU level logging is enabled
  6222. * (valid only if bit is set in
  6223. * pkt_type_enable_msdu_or_mpdu_logging)
  6224. * - b'21 - dma_mpdu_data(D) : For DATA
  6225. * 0 -> MSDU level logging is enabled
  6226. * (valid only if bit is set in
  6227. * pkt_type_enable_msdu_or_mpdu_logging)
  6228. * 1 -> MPDU level logging is enabled
  6229. * (valid only if bit is set in
  6230. * pkt_type_enable_msdu_or_mpdu_logging)
  6231. * - b'22:31 - rsvd4 for future use
  6232. */
  6233. PREPACK struct htt_tx_monitor_cfg_t {
  6234. A_UINT32 msg_type: 8,
  6235. pdev_id: 8,
  6236. ring_id: 8,
  6237. status_swap: 1,
  6238. pkt_swap: 1,
  6239. tx_mon_global_en: 1,
  6240. rsvd1: 5;
  6241. A_UINT32 ring_buffer_size: 16,
  6242. config_length_mgmt: 3,
  6243. config_length_ctrl: 3,
  6244. config_length_data: 3,
  6245. rsvd2: 7;
  6246. A_UINT32 pkt_type_enable_flags: 3,
  6247. filter_in_tx_mpdu_start_mgmt: 1,
  6248. filter_in_tx_mpdu_start_ctrl: 1,
  6249. filter_in_tx_mpdu_start_data: 1,
  6250. filter_in_tx_msdu_start_mgmt: 1,
  6251. filter_in_tx_msdu_start_ctrl: 1,
  6252. filter_in_tx_msdu_start_data: 1,
  6253. filter_in_tx_mpdu_end_mgmt: 1,
  6254. filter_in_tx_mpdu_end_ctrl: 1,
  6255. filter_in_tx_mpdu_end_data: 1,
  6256. filter_in_tx_msdu_end_mgmt: 1,
  6257. filter_in_tx_msdu_end_ctrl: 1,
  6258. filter_in_tx_msdu_end_data: 1,
  6259. rsvd3: 17;
  6260. A_UINT32 tlv_filter_mask_in0;
  6261. A_UINT32 tlv_filter_mask_in1;
  6262. A_UINT32 tlv_filter_mask_in2;
  6263. A_UINT32 tlv_filter_mask_in3;
  6264. A_UINT32 tx_fes_setup_word_mask: 8,
  6265. tx_peer_entry_word_mask: 8,
  6266. tx_queue_ext_word_mask: 8,
  6267. tx_msdu_start_word_mask: 8;
  6268. A_UINT32 pcu_ppdu_setup_word_mask;
  6269. A_UINT32 tx_mpdu_start_word_mask: 8,
  6270. rxpcu_user_setup_word_mask: 8,
  6271. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6272. dma_mpdu_mgmt: 1,
  6273. dma_mpdu_ctrl: 1,
  6274. dma_mpdu_data: 1,
  6275. rsvd4: 10;
  6276. } POSTPACK;
  6277. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6278. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6279. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6280. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6281. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6282. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6283. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6284. do { \
  6285. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6286. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6287. } while (0)
  6288. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6289. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6290. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6291. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6292. HTT_TX_MONITOR_CFG_RING_ID_S)
  6293. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6294. do { \
  6295. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6296. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6297. } while (0)
  6298. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6299. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6300. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6301. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6302. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6303. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6304. do { \
  6305. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6306. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6307. } while (0)
  6308. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6309. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6310. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6311. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6312. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6313. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6314. do { \
  6315. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6316. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6317. } while (0)
  6318. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6319. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6320. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6321. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6322. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6323. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6324. do { \
  6325. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6326. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6327. } while (0)
  6328. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6329. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6330. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6331. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6332. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6333. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6334. do { \
  6335. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6336. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6337. } while (0)
  6338. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6339. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6340. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6341. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6342. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6343. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6344. do { \
  6345. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6346. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6347. } while (0)
  6348. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6349. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6350. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6351. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6352. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6353. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6354. do { \
  6355. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6356. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6357. } while (0)
  6358. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6359. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6360. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6361. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6362. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6363. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6364. do { \
  6365. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6366. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6367. } while (0)
  6368. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6369. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6370. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6371. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6372. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6373. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6374. do { \
  6375. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6376. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6377. } while (0)
  6378. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6379. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6380. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6381. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6382. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6383. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6384. do { \
  6385. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6386. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6387. } while (0)
  6388. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6389. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6390. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6391. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6392. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6393. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6394. do { \
  6395. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6396. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6397. } while (0)
  6398. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6399. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6400. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6401. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6402. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6403. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6404. do { \
  6405. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6406. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6407. } while (0)
  6408. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6409. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6410. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6411. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6412. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6413. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6414. do { \
  6415. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6416. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6417. } while (0)
  6418. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6419. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6420. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6421. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6422. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6423. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6424. do { \
  6425. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6426. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6427. } while (0)
  6428. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6429. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6430. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6431. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6432. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6433. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6434. do { \
  6435. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6436. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6437. } while (0)
  6438. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6439. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6440. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6441. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6442. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6443. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6444. do { \
  6445. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6446. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6447. } while (0)
  6448. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6449. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6450. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6451. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6452. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6453. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6454. do { \
  6455. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6456. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6457. } while (0)
  6458. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6459. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6460. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6461. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6462. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6463. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6464. do { \
  6465. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6466. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6467. } while (0)
  6468. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6469. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6470. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6471. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6472. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6473. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6474. do { \
  6475. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6476. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6477. } while (0)
  6478. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6479. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6480. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6481. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6482. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6483. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6484. do { \
  6485. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6486. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6487. } while (0)
  6488. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6489. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6490. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6491. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6492. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6493. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6494. do { \
  6495. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6496. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6497. } while (0)
  6498. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6499. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6500. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6501. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6502. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6503. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6504. do { \
  6505. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6506. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6507. } while (0)
  6508. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6509. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6510. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6511. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6512. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6513. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6514. do { \
  6515. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6516. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6517. } while (0)
  6518. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6519. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6520. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6521. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6522. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6523. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6524. do { \
  6525. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6526. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6527. } while (0)
  6528. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6529. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6530. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6531. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6532. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6533. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6534. do { \
  6535. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6536. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6537. } while (0)
  6538. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6539. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6540. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6541. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6542. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6543. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6544. do { \
  6545. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6546. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6547. } while (0)
  6548. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6549. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6550. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6551. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6552. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6553. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6554. do { \
  6555. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6556. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6557. } while (0)
  6558. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6559. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6560. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6561. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6562. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6563. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6564. do { \
  6565. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6566. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6567. } while (0)
  6568. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6569. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6570. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6571. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6572. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6573. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6574. do { \
  6575. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6576. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6577. } while (0)
  6578. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6579. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6580. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6581. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6582. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6583. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6584. do { \
  6585. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6586. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6587. } while (0)
  6588. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6589. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6590. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6591. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6592. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6593. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6594. do { \
  6595. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6596. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6597. } while (0)
  6598. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6599. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6600. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6601. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6602. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6603. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6604. do { \
  6605. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6606. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6607. } while (0)
  6608. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6609. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6610. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6611. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6612. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6613. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6614. do { \
  6615. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6616. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6617. } while (0)
  6618. /*
  6619. * pkt_type_enable_flags
  6620. */
  6621. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6622. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6623. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6624. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6625. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6626. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6627. /*
  6628. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6629. */
  6630. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6631. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6632. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6633. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6634. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6635. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6636. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6637. do { \
  6638. HTT_CHECK_SET_VAL(httsym, value); \
  6639. (word) |= (value) << httsym##_S; \
  6640. } while (0)
  6641. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6642. (((word) & httsym##_M) >> httsym##_S)
  6643. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6644. * type -> MGMT, CTRL, DATA*/
  6645. #define htt_tx_ring_pkt_type_set( \
  6646. word, mode, type, val) \
  6647. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6648. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6649. #define htt_tx_ring_pkt_type_get( \
  6650. word, mode, type) \
  6651. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6652. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6653. /* Definition to filter in TLVs */
  6654. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6655. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6656. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6657. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6658. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6659. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6660. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6661. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6662. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6716. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6717. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6718. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6719. do { \
  6720. HTT_CHECK_SET_VAL(httsym, enable); \
  6721. (word) |= (enable) << httsym##_S; \
  6722. } while (0)
  6723. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6724. (((word) & httsym##_M) >> httsym##_S)
  6725. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6726. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6727. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6728. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6729. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6730. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6793. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6794. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6795. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6796. do { \
  6797. HTT_CHECK_SET_VAL(httsym, enable); \
  6798. (word) |= (enable) << httsym##_S; \
  6799. } while (0)
  6800. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6801. (((word) & httsym##_M) >> httsym##_S)
  6802. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6803. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6804. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6805. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6806. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6807. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6870. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6871. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6872. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6873. do { \
  6874. HTT_CHECK_SET_VAL(httsym, enable); \
  6875. (word) |= (enable) << httsym##_S; \
  6876. } while (0)
  6877. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6878. (((word) & httsym##_M) >> httsym##_S)
  6879. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6880. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6881. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6882. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6883. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6884. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6927. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6928. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6929. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6930. do { \
  6931. HTT_CHECK_SET_VAL(httsym, enable); \
  6932. (word) |= (enable) << httsym##_S; \
  6933. } while (0)
  6934. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6935. (((word) & httsym##_M) >> httsym##_S)
  6936. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6937. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6938. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6939. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6940. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6941. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6942. /**
  6943. * @brief host --> target Receive Flow Steering configuration message definition
  6944. *
  6945. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6946. *
  6947. * host --> target Receive Flow Steering configuration message definition.
  6948. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6949. * The reason for this is we want RFS to be configured and ready before MAC
  6950. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6951. *
  6952. * |31 24|23 16|15 9|8|7 0|
  6953. * |----------------+----------------+----------------+----------------|
  6954. * | reserved |E| msg type |
  6955. * |-------------------------------------------------------------------|
  6956. * Where E = RFS enable flag
  6957. *
  6958. * The RFS_CONFIG message consists of a single 4-byte word.
  6959. *
  6960. * Header fields:
  6961. * - MSG_TYPE
  6962. * Bits 7:0
  6963. * Purpose: identifies this as a RFS config msg
  6964. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6965. * - RFS_CONFIG
  6966. * Bit 8
  6967. * Purpose: Tells target whether to enable (1) or disable (0)
  6968. * flow steering feature when sending rx indication messages to host
  6969. */
  6970. #define HTT_H2T_RFS_CONFIG_M 0x100
  6971. #define HTT_H2T_RFS_CONFIG_S 8
  6972. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6973. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6974. HTT_H2T_RFS_CONFIG_S)
  6975. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6976. do { \
  6977. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6978. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6979. } while (0)
  6980. #define HTT_RFS_CFG_REQ_BYTES 4
  6981. /**
  6982. * @brief host -> target FW extended statistics request
  6983. *
  6984. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6985. *
  6986. * @details
  6987. * The following field definitions describe the format of the HTT host
  6988. * to target FW extended stats retrieve message.
  6989. * The message specifies the type of stats the host wants to retrieve.
  6990. *
  6991. * |31 24|23 16|15 8|7 0|
  6992. * |-----------------------------------------------------------|
  6993. * | reserved | stats type | pdev_mask | msg type |
  6994. * |-----------------------------------------------------------|
  6995. * | config param [0] |
  6996. * |-----------------------------------------------------------|
  6997. * | config param [1] |
  6998. * |-----------------------------------------------------------|
  6999. * | config param [2] |
  7000. * |-----------------------------------------------------------|
  7001. * | config param [3] |
  7002. * |-----------------------------------------------------------|
  7003. * | reserved |
  7004. * |-----------------------------------------------------------|
  7005. * | cookie LSBs |
  7006. * |-----------------------------------------------------------|
  7007. * | cookie MSBs |
  7008. * |-----------------------------------------------------------|
  7009. * Header fields:
  7010. * - MSG_TYPE
  7011. * Bits 7:0
  7012. * Purpose: identifies this is a extended stats upload request message
  7013. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7014. * - PDEV_MASK
  7015. * Bits 8:15
  7016. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7017. * Value: This is a overloaded field, refer to usage and interpretation of
  7018. * PDEV in interface document.
  7019. * Bit 8 : Reserved for SOC stats
  7020. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7021. * Indicates MACID_MASK in DBS
  7022. * - STATS_TYPE
  7023. * Bits 23:16
  7024. * Purpose: identifies which FW statistics to upload
  7025. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7026. * - Reserved
  7027. * Bits 31:24
  7028. * - CONFIG_PARAM [0]
  7029. * Bits 31:0
  7030. * Purpose: give an opaque configuration value to the specified stats type
  7031. * Value: stats-type specific configuration value
  7032. * Refer to htt_stats.h for interpretation for each stats sub_type
  7033. * - CONFIG_PARAM [1]
  7034. * Bits 31:0
  7035. * Purpose: give an opaque configuration value to the specified stats type
  7036. * Value: stats-type specific configuration value
  7037. * Refer to htt_stats.h for interpretation for each stats sub_type
  7038. * - CONFIG_PARAM [2]
  7039. * Bits 31:0
  7040. * Purpose: give an opaque configuration value to the specified stats type
  7041. * Value: stats-type specific configuration value
  7042. * Refer to htt_stats.h for interpretation for each stats sub_type
  7043. * - CONFIG_PARAM [3]
  7044. * Bits 31:0
  7045. * Purpose: give an opaque configuration value to the specified stats type
  7046. * Value: stats-type specific configuration value
  7047. * Refer to htt_stats.h for interpretation for each stats sub_type
  7048. * - Reserved [31:0] for future use.
  7049. * - COOKIE_LSBS
  7050. * Bits 31:0
  7051. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7052. * message with its preceding host->target stats request message.
  7053. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7054. * - COOKIE_MSBS
  7055. * Bits 31:0
  7056. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7057. * message with its preceding host->target stats request message.
  7058. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7059. */
  7060. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7061. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7062. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7063. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7064. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7065. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7066. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7067. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7068. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7069. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7070. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7071. do { \
  7072. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7073. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7074. } while (0)
  7075. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7076. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7077. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7078. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7079. do { \
  7080. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7081. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7082. } while (0)
  7083. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7084. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7085. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7086. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7087. do { \
  7088. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7089. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7090. } while (0)
  7091. /**
  7092. * @brief host -> target FW streaming statistics request
  7093. *
  7094. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7095. *
  7096. * @details
  7097. * The following field definitions describe the format of the HTT host
  7098. * to target message that requests the target to start or stop producing
  7099. * ongoing stats of the specified type.
  7100. *
  7101. * |31|30 |23 16|15 8|7 0|
  7102. * |-----------------------------------------------------------|
  7103. * |EN| reserved | stats type | reserved | msg type |
  7104. * |-----------------------------------------------------------|
  7105. * | config param [0] |
  7106. * |-----------------------------------------------------------|
  7107. * | config param [1] |
  7108. * |-----------------------------------------------------------|
  7109. * | config param [2] |
  7110. * |-----------------------------------------------------------|
  7111. * | config param [3] |
  7112. * |-----------------------------------------------------------|
  7113. * Where:
  7114. * - EN is an enable/disable flag
  7115. * Header fields:
  7116. * - MSG_TYPE
  7117. * Bits 7:0
  7118. * Purpose: identifies this is a streaming stats upload request message
  7119. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7120. * - STATS_TYPE
  7121. * Bits 23:16
  7122. * Purpose: identifies which FW statistics to upload
  7123. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7124. * Only the htt_dbg_ext_stats_type values identified as streaming
  7125. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7126. * - ENABLE
  7127. * Bit 31
  7128. * Purpose: enable/disable the target's ongoing stats of the specified type
  7129. * Value:
  7130. * 0 - disable ongoing production of the specified stats type
  7131. * 1 - enable ongoing production of the specified stats type
  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. */
  7153. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7154. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7155. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7156. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7157. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7158. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7159. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7160. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7161. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7162. do { \
  7163. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7164. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7165. } while (0)
  7166. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7167. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7168. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7169. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7170. do { \
  7171. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7172. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7173. } while (0)
  7174. /**
  7175. * @brief host -> target FW PPDU_STATS request message
  7176. *
  7177. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7178. *
  7179. * @details
  7180. * The following field definitions describe the format of the HTT host
  7181. * to target FW for PPDU_STATS_CFG msg.
  7182. * The message allows the host to configure the PPDU_STATS_IND messages
  7183. * produced by the target.
  7184. *
  7185. * |31 24|23 16|15 8|7 0|
  7186. * |-----------------------------------------------------------|
  7187. * | REQ bit mask | pdev_mask | msg type |
  7188. * |-----------------------------------------------------------|
  7189. * Header fields:
  7190. * - MSG_TYPE
  7191. * Bits 7:0
  7192. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7193. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7194. * - PDEV_MASK
  7195. * Bits 8:15
  7196. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7197. * Value: This is a overloaded field, refer to usage and interpretation of
  7198. * PDEV in interface document.
  7199. * Bit 8 : Reserved for SOC stats
  7200. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7201. * Indicates MACID_MASK in DBS
  7202. * - REQ_TLV_BIT_MASK
  7203. * Bits 16:31
  7204. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7205. * needs to be included in the target's PPDU_STATS_IND messages.
  7206. * Value: refer htt_ppdu_stats_tlv_tag_t
  7207. *
  7208. */
  7209. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7210. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7211. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7212. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7213. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7214. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7215. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7216. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7217. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7218. do { \
  7219. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7220. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7221. } while (0)
  7222. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7223. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7224. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7225. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7226. do { \
  7227. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7228. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7229. } while (0)
  7230. /**
  7231. * @brief Host-->target HTT RX FSE setup message
  7232. *
  7233. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7234. *
  7235. * @details
  7236. * Through this message, the host will provide details of the flow tables
  7237. * in host DDR along with hash keys.
  7238. * This message can be sent per SOC or per PDEV, which is differentiated
  7239. * by pdev id values.
  7240. * The host will allocate flow search table and sends table size,
  7241. * physical DMA address of flow table, and hash keys to firmware to
  7242. * program into the RXOLE FSE HW block.
  7243. *
  7244. * The following field definitions describe the format of the RX FSE setup
  7245. * message sent from the host to target
  7246. *
  7247. * Header fields:
  7248. * dword0 - b'7:0 - msg_type: This will be set to
  7249. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7250. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7251. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7252. * pdev's LMAC ring.
  7253. * b'31:16 - reserved : Reserved for future use
  7254. * dword1 - b'19:0 - number of records: This field indicates the number of
  7255. * entries in the flow table. For example: 8k number of
  7256. * records is equivalent to
  7257. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7258. * b'27:20 - max search: This field specifies the skid length to FSE
  7259. * parser HW module whenever match is not found at the
  7260. * exact index pointed by hash.
  7261. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7262. * Refer htt_ip_da_sa_prefix below for more details.
  7263. * b'31:30 - reserved: Reserved for future use
  7264. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7265. * table allocated by host in DDR
  7266. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7267. * table allocated by host in DDR
  7268. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7269. * entry hashing
  7270. *
  7271. *
  7272. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7273. * |---------------------------------------------------------------|
  7274. * | reserved | pdev_id | MSG_TYPE |
  7275. * |---------------------------------------------------------------|
  7276. * |resvd|IPDSA| max_search | Number of records |
  7277. * |---------------------------------------------------------------|
  7278. * | base address lo |
  7279. * |---------------------------------------------------------------|
  7280. * | base address high |
  7281. * |---------------------------------------------------------------|
  7282. * | toeplitz key 31_0 |
  7283. * |---------------------------------------------------------------|
  7284. * | toeplitz key 63_32 |
  7285. * |---------------------------------------------------------------|
  7286. * | toeplitz key 95_64 |
  7287. * |---------------------------------------------------------------|
  7288. * | toeplitz key 127_96 |
  7289. * |---------------------------------------------------------------|
  7290. * | toeplitz key 159_128 |
  7291. * |---------------------------------------------------------------|
  7292. * | toeplitz key 191_160 |
  7293. * |---------------------------------------------------------------|
  7294. * | toeplitz key 223_192 |
  7295. * |---------------------------------------------------------------|
  7296. * | toeplitz key 255_224 |
  7297. * |---------------------------------------------------------------|
  7298. * | toeplitz key 287_256 |
  7299. * |---------------------------------------------------------------|
  7300. * | reserved | toeplitz key 314_288(26:0 bits) |
  7301. * |---------------------------------------------------------------|
  7302. * where:
  7303. * IPDSA = ip_da_sa
  7304. */
  7305. /**
  7306. * @brief: htt_ip_da_sa_prefix
  7307. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7308. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7309. * documentation per RFC3849
  7310. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7311. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7312. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7313. */
  7314. enum htt_ip_da_sa_prefix {
  7315. HTT_RX_IPV6_20010db8,
  7316. HTT_RX_IPV4_MAPPED_IPV6,
  7317. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7318. HTT_RX_IPV6_64FF9B,
  7319. };
  7320. /**
  7321. * @brief Host-->target HTT RX FISA configure and enable
  7322. *
  7323. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7324. *
  7325. * @details
  7326. * The host will send this command down to configure and enable the FISA
  7327. * operational params.
  7328. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7329. * register.
  7330. * Should configure both the MACs.
  7331. *
  7332. * dword0 - b'7:0 - msg_type:
  7333. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7334. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7335. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7336. * pdev's LMAC ring.
  7337. * b'31:16 - reserved : Reserved for future use
  7338. *
  7339. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7340. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7341. * packets. 1 flow search will be skipped
  7342. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7343. * tcp,udp packets
  7344. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7345. * calculation
  7346. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7347. * calculation
  7348. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7349. * calculation
  7350. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7351. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7352. * length
  7353. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7354. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7355. * length
  7356. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7357. * num jump
  7358. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7359. * num jump
  7360. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7361. * data type switch has happend for MPDU Sequence num jump
  7362. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7363. * for MPDU Sequence num jump
  7364. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7365. * for decrypt errors
  7366. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7367. * while aggregating a msdu
  7368. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7369. * The aggregation is done until (number of MSDUs aggregated
  7370. * < LIMIT + 1)
  7371. * b'31:18 - Reserved
  7372. *
  7373. * fisa_control_value - 32bit value FW can write to register
  7374. *
  7375. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7376. * Threshold value for FISA timeout (units are microseconds).
  7377. * When the global timestamp exceeds this threshold, FISA
  7378. * aggregation will be restarted.
  7379. * A value of 0 means timeout is disabled.
  7380. * Compare the threshold register with timestamp field in
  7381. * flow entry to generate timeout for the flow.
  7382. *
  7383. * |31 18 |17 16|15 8|7 0|
  7384. * |-------------------------------------------------------------|
  7385. * | reserved | pdev_mask | msg type |
  7386. * |-------------------------------------------------------------|
  7387. * | reserved | FISA_CTRL |
  7388. * |-------------------------------------------------------------|
  7389. * | FISA_TIMEOUT_THRESH |
  7390. * |-------------------------------------------------------------|
  7391. */
  7392. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7393. A_UINT32 msg_type:8,
  7394. pdev_id:8,
  7395. reserved0:16;
  7396. /**
  7397. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7398. * [17:0]
  7399. */
  7400. union {
  7401. /*
  7402. * fisa_control_bits structure is deprecated.
  7403. * Please use fisa_control_bits_v2 going forward.
  7404. */
  7405. struct {
  7406. A_UINT32 fisa_enable: 1,
  7407. ipsec_skip_search: 1,
  7408. nontcp_skip_search: 1,
  7409. add_ipv4_fixed_hdr_len: 1,
  7410. add_ipv6_fixed_hdr_len: 1,
  7411. add_tcp_fixed_hdr_len: 1,
  7412. add_udp_hdr_len: 1,
  7413. chksum_cum_ip_len_en: 1,
  7414. disable_tid_check: 1,
  7415. disable_ta_check: 1,
  7416. disable_qos_check: 1,
  7417. disable_raw_check: 1,
  7418. disable_decrypt_err_check: 1,
  7419. disable_msdu_drop_check: 1,
  7420. fisa_aggr_limit: 4,
  7421. reserved: 14;
  7422. } fisa_control_bits;
  7423. struct {
  7424. A_UINT32 fisa_enable: 1,
  7425. fisa_aggr_limit: 4,
  7426. reserved: 27;
  7427. } fisa_control_bits_v2;
  7428. A_UINT32 fisa_control_value;
  7429. } u_fisa_control;
  7430. /**
  7431. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7432. * timeout threshold for aggregation. Unit in usec.
  7433. * [31:0]
  7434. */
  7435. A_UINT32 fisa_timeout_threshold;
  7436. } POSTPACK;
  7437. /* DWord 0: pdev-ID */
  7438. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7439. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7440. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7441. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7442. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7443. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7444. do { \
  7445. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7446. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7447. } while (0)
  7448. /* Dword 1: fisa_control_value fisa config */
  7449. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7450. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7451. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7452. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7453. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7454. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7455. do { \
  7456. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7457. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7458. } while (0)
  7459. /* Dword 1: fisa_control_value ipsec_skip_search */
  7460. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7461. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7462. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7463. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7464. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7465. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7466. do { \
  7467. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7468. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7469. } while (0)
  7470. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7471. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7472. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7473. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7474. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7475. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7476. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7477. do { \
  7478. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7479. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7480. } while (0)
  7481. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7482. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7483. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7484. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7485. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7486. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7487. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7488. do { \
  7489. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7490. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7491. } while (0)
  7492. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7493. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7494. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7495. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7496. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7497. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7498. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7499. do { \
  7500. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7501. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7502. } while (0)
  7503. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7504. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7505. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7506. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7507. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7508. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7509. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7510. do { \
  7511. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7512. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7513. } while (0)
  7514. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7515. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7516. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7517. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7518. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7519. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7520. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7521. do { \
  7522. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7523. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7524. } while (0)
  7525. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7526. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7527. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7528. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7529. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7530. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7531. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7532. do { \
  7533. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7534. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7535. } while (0)
  7536. /* Dword 1: fisa_control_value disable_tid_check */
  7537. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7538. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7539. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7540. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7541. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7542. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7543. do { \
  7544. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7545. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7546. } while (0)
  7547. /* Dword 1: fisa_control_value disable_ta_check */
  7548. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7549. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7550. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7551. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7552. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7553. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7554. do { \
  7555. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7556. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7557. } while (0)
  7558. /* Dword 1: fisa_control_value disable_qos_check */
  7559. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7560. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7561. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7562. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7563. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7564. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7565. do { \
  7566. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7567. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7568. } while (0)
  7569. /* Dword 1: fisa_control_value disable_raw_check */
  7570. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7571. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7572. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7573. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7574. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7575. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7576. do { \
  7577. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7578. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7579. } while (0)
  7580. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7581. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7582. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7583. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7584. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7585. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7586. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7587. do { \
  7588. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7589. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7590. } while (0)
  7591. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7592. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7593. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7594. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7595. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7596. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7597. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7598. do { \
  7599. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7600. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7601. } while (0)
  7602. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7603. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7604. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7605. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7606. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7607. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7608. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7609. do { \
  7610. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7611. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7612. } while (0)
  7613. /* Dword 1: fisa_control_value fisa config */
  7614. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7615. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7616. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7617. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7618. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7619. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7620. do { \
  7621. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7622. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7623. } while (0)
  7624. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7625. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7626. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7627. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7628. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7629. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7630. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7631. do { \
  7632. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7633. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7634. } while (0)
  7635. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7636. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7637. pdev_id:8,
  7638. reserved0:16;
  7639. A_UINT32 num_records:20,
  7640. max_search:8,
  7641. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7642. reserved1:2;
  7643. A_UINT32 base_addr_lo;
  7644. A_UINT32 base_addr_hi;
  7645. A_UINT32 toeplitz31_0;
  7646. A_UINT32 toeplitz63_32;
  7647. A_UINT32 toeplitz95_64;
  7648. A_UINT32 toeplitz127_96;
  7649. A_UINT32 toeplitz159_128;
  7650. A_UINT32 toeplitz191_160;
  7651. A_UINT32 toeplitz223_192;
  7652. A_UINT32 toeplitz255_224;
  7653. A_UINT32 toeplitz287_256;
  7654. A_UINT32 toeplitz314_288:27,
  7655. reserved2:5;
  7656. } POSTPACK;
  7657. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7658. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7659. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7660. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7661. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7662. /* DWORD 0: Pdev ID */
  7663. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7664. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7665. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7666. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7667. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7668. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7669. do { \
  7670. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7671. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7672. } while (0)
  7673. /* DWORD 1:num of records */
  7674. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7675. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7676. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7677. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7678. HTT_RX_FSE_SETUP_NUM_REC_S)
  7679. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7680. do { \
  7681. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7682. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7683. } while (0)
  7684. /* DWORD 1:max_search */
  7685. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7686. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7687. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7688. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7689. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7690. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7691. do { \
  7692. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7693. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7694. } while (0)
  7695. /* DWORD 1:ip_da_sa prefix */
  7696. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7697. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7698. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7699. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7700. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7701. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7702. do { \
  7703. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7704. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7705. } while (0)
  7706. /* DWORD 2: Base Address LO */
  7707. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7708. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7709. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7710. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7711. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7712. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7713. do { \
  7714. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7715. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7716. } while (0)
  7717. /* DWORD 3: Base Address High */
  7718. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7719. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7720. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7721. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7722. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7723. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7724. do { \
  7725. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7726. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7727. } while (0)
  7728. /* DWORD 4-12: Hash Value */
  7729. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7730. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7731. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7732. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7733. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7734. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7735. do { \
  7736. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7737. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7738. } while (0)
  7739. /* DWORD 13: Hash Value 314:288 bits */
  7740. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7741. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7742. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7743. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7744. do { \
  7745. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7746. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7747. } while (0)
  7748. /**
  7749. * @brief Host-->target HTT RX FSE operation message
  7750. *
  7751. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7752. *
  7753. * @details
  7754. * The host will send this Flow Search Engine (FSE) operation message for
  7755. * every flow add/delete operation.
  7756. * The FSE operation includes FSE full cache invalidation or individual entry
  7757. * invalidation.
  7758. * This message can be sent per SOC or per PDEV which is differentiated
  7759. * by pdev id values.
  7760. *
  7761. * |31 16|15 8|7 1|0|
  7762. * |-------------------------------------------------------------|
  7763. * | reserved | pdev_id | MSG_TYPE |
  7764. * |-------------------------------------------------------------|
  7765. * | reserved | operation |I|
  7766. * |-------------------------------------------------------------|
  7767. * | ip_src_addr_31_0 |
  7768. * |-------------------------------------------------------------|
  7769. * | ip_src_addr_63_32 |
  7770. * |-------------------------------------------------------------|
  7771. * | ip_src_addr_95_64 |
  7772. * |-------------------------------------------------------------|
  7773. * | ip_src_addr_127_96 |
  7774. * |-------------------------------------------------------------|
  7775. * | ip_dst_addr_31_0 |
  7776. * |-------------------------------------------------------------|
  7777. * | ip_dst_addr_63_32 |
  7778. * |-------------------------------------------------------------|
  7779. * | ip_dst_addr_95_64 |
  7780. * |-------------------------------------------------------------|
  7781. * | ip_dst_addr_127_96 |
  7782. * |-------------------------------------------------------------|
  7783. * | l4_dst_port | l4_src_port |
  7784. * | (32-bit SPI incase of IPsec) |
  7785. * |-------------------------------------------------------------|
  7786. * | reserved | l4_proto |
  7787. * |-------------------------------------------------------------|
  7788. *
  7789. * where I is 1-bit ipsec_valid.
  7790. *
  7791. * The following field definitions describe the format of the RX FSE operation
  7792. * message sent from the host to target for every add/delete flow entry to flow
  7793. * table.
  7794. *
  7795. * Header fields:
  7796. * dword0 - b'7:0 - msg_type: This will be set to
  7797. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7798. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7799. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7800. * specified pdev's LMAC ring.
  7801. * b'31:16 - reserved : Reserved for future use
  7802. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7803. * (Internet Protocol Security).
  7804. * IPsec describes the framework for providing security at
  7805. * IP layer. IPsec is defined for both versions of IP:
  7806. * IPV4 and IPV6.
  7807. * Please refer to htt_rx_flow_proto enumeration below for
  7808. * more info.
  7809. * ipsec_valid = 1 for IPSEC packets
  7810. * ipsec_valid = 0 for IP Packets
  7811. * b'7:1 - operation: This indicates types of FSE operation.
  7812. * Refer to htt_rx_fse_operation enumeration:
  7813. * 0 - No Cache Invalidation required
  7814. * 1 - Cache invalidate only one entry given by IP
  7815. * src/dest address at DWORD[2:9]
  7816. * 2 - Complete FSE Cache Invalidation
  7817. * 3 - FSE Disable
  7818. * 4 - FSE Enable
  7819. * b'31:8 - reserved: Reserved for future use
  7820. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7821. * for per flow addition/deletion
  7822. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7823. * and the subsequent 3 A_UINT32 will be padding bytes.
  7824. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7825. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7826. * from 0 to 65535 but only 0 to 1023 are designated as
  7827. * well-known ports. Refer to [RFC1700] for more details.
  7828. * This field is valid only if
  7829. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7830. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7831. * range from 0 to 65535 but only 0 to 1023 are designated
  7832. * as well-known ports. Refer to [RFC1700] for more details.
  7833. * This field is valid only if
  7834. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7835. * - SPI (31:0): Security Parameters Index is an
  7836. * identification tag added to the header while using IPsec
  7837. * for tunneling the IP traffici.
  7838. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7839. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7840. * Assigned Internet Protocol Numbers.
  7841. * l4_proto numbers for standard protocol like UDP/TCP
  7842. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7843. * l4_proto = 17 for UDP etc.
  7844. * b'31:8 - reserved: Reserved for future use.
  7845. *
  7846. */
  7847. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7848. A_UINT32 msg_type:8,
  7849. pdev_id:8,
  7850. reserved0:16;
  7851. A_UINT32 ipsec_valid:1,
  7852. operation:7,
  7853. reserved1:24;
  7854. A_UINT32 ip_src_addr_31_0;
  7855. A_UINT32 ip_src_addr_63_32;
  7856. A_UINT32 ip_src_addr_95_64;
  7857. A_UINT32 ip_src_addr_127_96;
  7858. A_UINT32 ip_dest_addr_31_0;
  7859. A_UINT32 ip_dest_addr_63_32;
  7860. A_UINT32 ip_dest_addr_95_64;
  7861. A_UINT32 ip_dest_addr_127_96;
  7862. union {
  7863. A_UINT32 spi;
  7864. struct {
  7865. A_UINT32 l4_src_port:16,
  7866. l4_dest_port:16;
  7867. } ip;
  7868. } u;
  7869. A_UINT32 l4_proto:8,
  7870. reserved:24;
  7871. } POSTPACK;
  7872. /**
  7873. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7874. *
  7875. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7876. *
  7877. * @details
  7878. * The host will send this Full monitor mode register configuration message.
  7879. * This message can be sent per SOC or per PDEV which is differentiated
  7880. * by pdev id values.
  7881. *
  7882. * |31 16|15 11|10 8|7 3|2|1|0|
  7883. * |-------------------------------------------------------------|
  7884. * | reserved | pdev_id | MSG_TYPE |
  7885. * |-------------------------------------------------------------|
  7886. * | reserved |Release Ring |N|Z|E|
  7887. * |-------------------------------------------------------------|
  7888. *
  7889. * where E is 1-bit full monitor mode enable/disable.
  7890. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7891. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7892. *
  7893. * The following field definitions describe the format of the full monitor
  7894. * mode configuration message sent from the host to target for each pdev.
  7895. *
  7896. * Header fields:
  7897. * dword0 - b'7:0 - msg_type: This will be set to
  7898. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7899. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7900. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7901. * specified pdev's LMAC ring.
  7902. * b'31:16 - reserved : Reserved for future use.
  7903. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7904. * monitor mode rxdma register is to be enabled or disabled.
  7905. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7906. * additional descriptors at ppdu end for zero mpdus
  7907. * enabled or disabled.
  7908. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7909. * additional descriptors at ppdu end for non zero mpdus
  7910. * enabled or disabled.
  7911. * b'10:3 - release_ring: This indicates the destination ring
  7912. * selection for the descriptor at the end of PPDU
  7913. * 0 - REO ring select
  7914. * 1 - FW ring select
  7915. * 2 - SW ring select
  7916. * 3 - Release ring select
  7917. * Refer to htt_rx_full_mon_release_ring.
  7918. * b'31:11 - reserved for future use
  7919. */
  7920. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7921. A_UINT32 msg_type:8,
  7922. pdev_id:8,
  7923. reserved0:16;
  7924. A_UINT32 full_monitor_mode_enable:1,
  7925. addnl_descs_zero_mpdus_end:1,
  7926. addnl_descs_non_zero_mpdus_end:1,
  7927. release_ring:8,
  7928. reserved1:21;
  7929. } POSTPACK;
  7930. /**
  7931. * Enumeration for full monitor mode destination ring select
  7932. * 0 - REO destination ring select
  7933. * 1 - FW destination ring select
  7934. * 2 - SW destination ring select
  7935. * 3 - Release destination ring select
  7936. */
  7937. enum htt_rx_full_mon_release_ring {
  7938. HTT_RX_MON_RING_REO,
  7939. HTT_RX_MON_RING_FW,
  7940. HTT_RX_MON_RING_SW,
  7941. HTT_RX_MON_RING_RELEASE,
  7942. };
  7943. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7944. /* DWORD 0: Pdev ID */
  7945. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7946. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7947. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7948. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7949. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7950. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7951. do { \
  7952. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7953. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7954. } while (0)
  7955. /* DWORD 1:ENABLE */
  7956. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7957. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7958. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7959. do { \
  7960. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7961. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7962. } while (0)
  7963. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7964. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7965. /* DWORD 1:ZERO_MPDU */
  7966. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7967. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7968. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7969. do { \
  7970. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7971. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7972. } while (0)
  7973. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7974. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7975. /* DWORD 1:NON_ZERO_MPDU */
  7976. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7977. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7978. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7979. do { \
  7980. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7981. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7982. } while (0)
  7983. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7984. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7985. /* DWORD 1:RELEASE_RINGS */
  7986. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7987. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7988. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7989. do { \
  7990. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7991. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7992. } while (0)
  7993. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7994. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7995. /**
  7996. * Enumeration for IP Protocol or IPSEC Protocol
  7997. * IPsec describes the framework for providing security at IP layer.
  7998. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7999. */
  8000. enum htt_rx_flow_proto {
  8001. HTT_RX_FLOW_IP_PROTO,
  8002. HTT_RX_FLOW_IPSEC_PROTO,
  8003. };
  8004. /**
  8005. * Enumeration for FSE Cache Invalidation
  8006. * 0 - No Cache Invalidation required
  8007. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8008. * 2 - Complete FSE Cache Invalidation
  8009. * 3 - FSE Disable
  8010. * 4 - FSE Enable
  8011. */
  8012. enum htt_rx_fse_operation {
  8013. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8014. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8015. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8016. HTT_RX_FSE_DISABLE,
  8017. HTT_RX_FSE_ENABLE,
  8018. };
  8019. /* DWORD 0: Pdev ID */
  8020. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8021. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8022. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8023. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8024. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8025. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8026. do { \
  8027. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8028. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8029. } while (0)
  8030. /* DWORD 1:IP PROTO or IPSEC */
  8031. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8032. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8033. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8034. do { \
  8035. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8036. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8037. } while (0)
  8038. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8039. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8040. /* DWORD 1:FSE Operation */
  8041. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8042. #define HTT_RX_FSE_OPERATION_S 1
  8043. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8044. do { \
  8045. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8046. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8047. } while (0)
  8048. #define HTT_RX_FSE_OPERATION_GET(word) \
  8049. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8050. /* DWORD 2-9:IP Address */
  8051. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8052. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8053. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8054. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8055. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8056. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8057. do { \
  8058. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8059. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8060. } while (0)
  8061. /* DWORD 10:Source Port Number */
  8062. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8063. #define HTT_RX_FSE_SOURCEPORT_S 0
  8064. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8065. do { \
  8066. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8067. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8068. } while (0)
  8069. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8070. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8071. /* DWORD 11:Destination Port Number */
  8072. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8073. #define HTT_RX_FSE_DESTPORT_S 16
  8074. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8075. do { \
  8076. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8077. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8078. } while (0)
  8079. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8080. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8081. /* DWORD 10-11:SPI (In case of IPSEC) */
  8082. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8083. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8084. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8085. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8086. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8087. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8088. do { \
  8089. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8090. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8091. } while (0)
  8092. /* DWORD 12:L4 PROTO */
  8093. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8094. #define HTT_RX_FSE_L4_PROTO_S 0
  8095. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8096. do { \
  8097. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8098. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8099. } while (0)
  8100. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8101. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8102. /**
  8103. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8104. *
  8105. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8106. *
  8107. * |31 24|23 |15 8|7 2|1|0|
  8108. * |----------------+----------------+----------------+----------------|
  8109. * | reserved | pdev_id | msg_type |
  8110. * |---------------------------------+----------------+----------------|
  8111. * | reserved |E|F|
  8112. * |---------------------------------+----------------+----------------|
  8113. * Where E = Configure the target to provide the 3-tuple hash value in
  8114. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8115. * F = Configure the target to provide the 3-tuple hash value in
  8116. * flow_id_toeplitz field of rx_msdu_start tlv
  8117. *
  8118. * The following field definitions describe the format of the 3 tuple hash value
  8119. * message sent from the host to target as part of initialization sequence.
  8120. *
  8121. * Header fields:
  8122. * dword0 - b'7:0 - msg_type: This will be set to
  8123. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8124. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8125. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8126. * specified pdev's LMAC ring.
  8127. * b'31:16 - reserved : Reserved for future use
  8128. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8129. * b'1 - toeplitz_hash_2_or_4_field_enable
  8130. * b'31:2 - reserved : Reserved for future use
  8131. * ---------+------+----------------------------------------------------------
  8132. * bit1 | bit0 | Functionality
  8133. * ---------+------+----------------------------------------------------------
  8134. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8135. * | | in flow_id_toeplitz field
  8136. * ---------+------+----------------------------------------------------------
  8137. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8138. * | | in toeplitz_hash_2_or_4 field
  8139. * ---------+------+----------------------------------------------------------
  8140. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8141. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8142. * ---------+------+----------------------------------------------------------
  8143. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8144. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8145. * | | toeplitz_hash_2_or_4 field
  8146. *----------------------------------------------------------------------------
  8147. */
  8148. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8149. A_UINT32 msg_type :8,
  8150. pdev_id :8,
  8151. reserved0 :16;
  8152. A_UINT32 flow_id_toeplitz_field_enable :1,
  8153. toeplitz_hash_2_or_4_field_enable :1,
  8154. reserved1 :30;
  8155. } POSTPACK;
  8156. /* DWORD0 : pdev_id configuration Macros */
  8157. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8158. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8159. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8160. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8161. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8162. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8163. do { \
  8164. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8165. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8166. } while (0)
  8167. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8168. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8169. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8170. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8171. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8172. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8173. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8174. do { \
  8175. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8176. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8177. } while (0)
  8178. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8179. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8180. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8181. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8182. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8183. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8184. do { \
  8185. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8186. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8187. } while (0)
  8188. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8189. /**
  8190. * @brief host --> target Host PA Address Size
  8191. *
  8192. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8193. *
  8194. * @details
  8195. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8196. * provide the physical start address and size of each of the memory
  8197. * areas within host DDR that the target FW may need to access.
  8198. *
  8199. * For example, the host can use this message to allow the target FW
  8200. * to set up access to the host's pools of TQM link descriptors.
  8201. * The message would appear as follows:
  8202. *
  8203. * |31 24|23 16|15 8|7 0|
  8204. * |----------------+----------------+----------------+----------------|
  8205. * | reserved | num_entries | msg_type |
  8206. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8207. * | mem area 0 size |
  8208. * |----------------+----------------+----------------+----------------|
  8209. * | mem area 0 physical_address_lo |
  8210. * |----------------+----------------+----------------+----------------|
  8211. * | mem area 0 physical_address_hi |
  8212. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8213. * | mem area 1 size |
  8214. * |----------------+----------------+----------------+----------------|
  8215. * | mem area 1 physical_address_lo |
  8216. * |----------------+----------------+----------------+----------------|
  8217. * | mem area 1 physical_address_hi |
  8218. * |----------------+----------------+----------------+----------------|
  8219. * ...
  8220. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8221. * | mem area N size |
  8222. * |----------------+----------------+----------------+----------------|
  8223. * | mem area N physical_address_lo |
  8224. * |----------------+----------------+----------------+----------------|
  8225. * | mem area N physical_address_hi |
  8226. * |----------------+----------------+----------------+----------------|
  8227. *
  8228. * The message is interpreted as follows:
  8229. * dword0 - b'0:7 - msg_type: This will be set to
  8230. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8231. * b'8:15 - number_entries: Indicated the number of host memory
  8232. * areas specified within the remainder of the message
  8233. * b'16:31 - reserved.
  8234. * dword1 - b'0:31 - memory area 0 size in bytes
  8235. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8236. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8237. * and similar for memory area 1 through memory area N.
  8238. */
  8239. PREPACK struct htt_h2t_host_paddr_size {
  8240. A_UINT32 msg_type: 8,
  8241. num_entries: 8,
  8242. reserved: 16;
  8243. } POSTPACK;
  8244. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8245. A_UINT32 size;
  8246. A_UINT32 physical_address_lo;
  8247. A_UINT32 physical_address_hi;
  8248. } POSTPACK;
  8249. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8250. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8251. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8252. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8253. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8254. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8255. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8256. do { \
  8257. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8258. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8259. } while (0)
  8260. /**
  8261. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8262. *
  8263. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8264. *
  8265. * @details
  8266. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8267. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8268. *
  8269. * The message would appear as follows:
  8270. *
  8271. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8272. * |---------------------------------+---+---+----------+-+-----------|
  8273. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8274. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8275. *
  8276. *
  8277. * The message is interpreted as follows:
  8278. * dword0 - b'0:7 - msg_type: This will be set to
  8279. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8280. * b'8 - override bit to drive MSDUs to PPE ring
  8281. * b'9:13 - REO destination ring indication
  8282. * b'14 - Multi buffer msdu override enable bit
  8283. * b'15 - Intra BSS override
  8284. * b'16 - Decap raw override
  8285. * b'17 - Decap Native wifi override
  8286. * b'18 - IP frag override
  8287. * b'19:31 - reserved
  8288. */
  8289. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8290. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8291. override: 1,
  8292. reo_destination_indication: 5,
  8293. multi_buffer_msdu_override_en: 1,
  8294. intra_bss_override: 1,
  8295. decap_raw_override: 1,
  8296. decap_nwifi_override: 1,
  8297. ip_frag_override: 1,
  8298. reserved: 13;
  8299. } POSTPACK;
  8300. /* DWORD 0: Override */
  8301. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8302. #define HTT_PPE_CFG_OVERRIDE_S 8
  8303. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8304. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8305. HTT_PPE_CFG_OVERRIDE_S)
  8306. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8307. do { \
  8308. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8309. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8310. } while (0)
  8311. /* DWORD 0: REO Destination Indication*/
  8312. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8313. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8314. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8315. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8316. HTT_PPE_CFG_REO_DEST_IND_S)
  8317. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8318. do { \
  8319. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8320. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8321. } while (0)
  8322. /* DWORD 0: Multi buffer MSDU override */
  8323. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8324. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8325. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8326. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8327. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8328. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8329. do { \
  8330. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8331. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8332. } while (0)
  8333. /* DWORD 0: Intra BSS override */
  8334. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8335. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8336. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8337. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8338. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8339. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8340. do { \
  8341. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8342. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8343. } while (0)
  8344. /* DWORD 0: Decap RAW override */
  8345. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8346. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8347. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8348. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8349. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8350. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8351. do { \
  8352. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8353. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8354. } while (0)
  8355. /* DWORD 0: Decap NWIFI override */
  8356. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8357. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8358. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8359. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8360. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8361. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8362. do { \
  8363. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8364. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8365. } while (0)
  8366. /* DWORD 0: IP frag override */
  8367. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8368. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8369. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8370. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8371. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8372. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8373. do { \
  8374. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8375. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8376. } while (0)
  8377. /*
  8378. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8379. *
  8380. * @details
  8381. * The following field definitions describe the format of the HTT host
  8382. * to target FW VDEV TX RX stats retrieve message.
  8383. * The message specifies the type of stats the host wants to retrieve.
  8384. *
  8385. * |31 27|26 25|24 17|16|15 8|7 0|
  8386. * |-----------------------------------------------------------|
  8387. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8388. * |-----------------------------------------------------------|
  8389. * | vdev_id lower bitmask |
  8390. * |-----------------------------------------------------------|
  8391. * | vdev_id upper bitmask |
  8392. * |-----------------------------------------------------------|
  8393. * Header fields:
  8394. * Where:
  8395. * dword0 - b'7:0 - msg_type: This will be set to
  8396. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8397. * b'15:8 - pdev id
  8398. * b'16(E) - Enable/Disable the vdev HW stats
  8399. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8400. * b'25:26(R) - Reset stats bits
  8401. * 0: don't reset stats
  8402. * 1: reset stats once
  8403. * 2: reset stats at the start of each periodic interval
  8404. * b'27:31 - reserved for future use
  8405. * dword1 - b'0:31 - vdev_id lower bitmask
  8406. * dword2 - b'0:31 - vdev_id upper bitmask
  8407. */
  8408. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8409. A_UINT32 msg_type :8,
  8410. pdev_id :8,
  8411. enable :1,
  8412. periodic_interval :8,
  8413. reset_stats_bits :2,
  8414. reserved0 :5;
  8415. A_UINT32 vdev_id_lower_bitmask;
  8416. A_UINT32 vdev_id_upper_bitmask;
  8417. } POSTPACK;
  8418. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8419. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8420. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8421. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8422. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8423. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8424. do { \
  8425. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8426. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8427. } while (0)
  8428. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8429. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8430. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8431. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8432. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8433. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8434. do { \
  8435. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8436. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8437. } while (0)
  8438. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8439. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8440. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8441. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8442. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8443. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8444. do { \
  8445. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8446. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8447. } while (0)
  8448. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8449. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8450. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8451. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8452. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8453. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8454. do { \
  8455. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8456. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8457. } while (0)
  8458. /*
  8459. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8460. *
  8461. * @details
  8462. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8463. * the default MSDU queues for one of the TIDs within the specified peer
  8464. * to the specified service class.
  8465. * The TID is indirectly specified - each service class is associated
  8466. * with a TID. All default MSDU queues for this peer-TID will be
  8467. * linked to the service class in question.
  8468. *
  8469. * |31 16|15 8|7 0|
  8470. * |------------------------------+--------------+--------------|
  8471. * | peer ID | svc class ID | msg type |
  8472. * |------------------------------------------------------------|
  8473. * Header fields:
  8474. * dword0 - b'7:0 - msg_type: This will be set to
  8475. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8476. * b'15:8 - service class ID
  8477. * b'31:16 - peer ID
  8478. */
  8479. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8480. A_UINT32 msg_type :8,
  8481. svc_class_id :8,
  8482. peer_id :16;
  8483. } POSTPACK;
  8484. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8485. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8486. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8487. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8488. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8489. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8490. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8491. do { \
  8492. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8493. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8494. } while (0)
  8495. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8496. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8497. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8498. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8499. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8500. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8501. do { \
  8502. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8503. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8504. } while (0)
  8505. /*
  8506. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8507. *
  8508. * @details
  8509. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8510. * remove the linkage of the specified peer-TID's MSDU queues to
  8511. * service classes.
  8512. *
  8513. * |31 16|15 8|7 0|
  8514. * |------------------------------+--------------+--------------|
  8515. * | peer ID | svc class ID | msg type |
  8516. * |------------------------------------------------------------|
  8517. * Header fields:
  8518. * dword0 - b'7:0 - msg_type: This will be set to
  8519. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8520. * b'15:8 - service class ID
  8521. * b'31:16 - peer ID
  8522. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8523. * value for peer ID indicates that the target should
  8524. * apply the UNMAP_REQ to all peers.
  8525. */
  8526. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8527. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8528. A_UINT32 msg_type :8,
  8529. svc_class_id :8,
  8530. peer_id :16;
  8531. } POSTPACK;
  8532. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8533. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8534. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8535. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8536. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8537. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8538. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8539. do { \
  8540. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8541. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8542. } while (0)
  8543. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8544. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8545. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8546. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8547. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8548. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8549. do { \
  8550. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8551. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8552. } while (0)
  8553. /*
  8554. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8555. *
  8556. * @details
  8557. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8558. * request the target to report what service class the default MSDU queues
  8559. * of the specified TIDs within the peer are linked to.
  8560. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8561. * to report what service class (if any) the default MSDU queues for
  8562. * each of the specified TIDs are linked to.
  8563. *
  8564. * |31 16|15 8|7 1| 0|
  8565. * |------------------------------+--------------+--------------|
  8566. * | peer ID | TID mask | msg type |
  8567. * |------------------------------------------------------------|
  8568. * | reserved |ETO|
  8569. * |------------------------------------------------------------|
  8570. * Header fields:
  8571. * dword0 - b'7:0 - msg_type: This will be set to
  8572. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8573. * b'15:8 - TID mask
  8574. * b'31:16 - peer ID
  8575. * dword1 - b'0 - "Existing Tids Only" flag
  8576. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8577. * message generated by this REQ will only show the
  8578. * mapping for TIDs that actually exist in the target's
  8579. * peer object.
  8580. * Any TIDs that are covered by a MAP_REQ but which
  8581. * do not actually exist will be shown as being
  8582. * unmapped (i.e. svc class ID 0xff).
  8583. * If this flag is cleared, the MAP_REPORT_CONF message
  8584. * will consider not only the mapping of TIDs currently
  8585. * existing in the peer, but also the mapping that will
  8586. * be applied for any TID objects created within this
  8587. * peer in the future.
  8588. * b'31:1 - reserved for future use
  8589. */
  8590. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8591. A_UINT32 msg_type :8,
  8592. tid_mask :8,
  8593. peer_id :16;
  8594. A_UINT32 existing_tids_only:1,
  8595. reserved :31;
  8596. } POSTPACK;
  8597. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8598. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8599. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8600. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8601. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8602. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8603. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8604. do { \
  8605. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8606. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8607. } while (0)
  8608. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8609. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8610. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8611. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8612. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8613. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8614. do { \
  8615. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8616. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8617. } while (0)
  8618. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8619. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8620. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8621. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8622. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8623. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8624. do { \
  8625. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8626. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8627. } while (0)
  8628. /*=== target -> host messages ===============================================*/
  8629. enum htt_t2h_msg_type {
  8630. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8631. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8632. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8633. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8634. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8635. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8636. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8637. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8638. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8639. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8640. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8641. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8642. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8643. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8644. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8645. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8646. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8647. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8648. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8649. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8650. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8651. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8652. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8653. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8654. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8655. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8656. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8657. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8658. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8659. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8660. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8661. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8662. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8663. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8664. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8665. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8666. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8667. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8668. /* TX_OFFLOAD_DELIVER_IND:
  8669. * Forward the target's locally-generated packets to the host,
  8670. * to provide to the monitor mode interface.
  8671. */
  8672. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8673. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8674. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8675. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8676. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8677. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8678. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8679. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8680. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8681. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  8682. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  8683. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  8684. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  8685. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  8686. HTT_T2H_MSG_TYPE_TEST,
  8687. /* keep this last */
  8688. HTT_T2H_NUM_MSGS
  8689. };
  8690. /*
  8691. * HTT target to host message type -
  8692. * stored in bits 7:0 of the first word of the message
  8693. */
  8694. #define HTT_T2H_MSG_TYPE_M 0xff
  8695. #define HTT_T2H_MSG_TYPE_S 0
  8696. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8697. do { \
  8698. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8699. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8700. } while (0)
  8701. #define HTT_T2H_MSG_TYPE_GET(word) \
  8702. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8703. /**
  8704. * @brief target -> host version number confirmation message definition
  8705. *
  8706. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8707. *
  8708. * |31 24|23 16|15 8|7 0|
  8709. * |----------------+----------------+----------------+----------------|
  8710. * | reserved | major number | minor number | msg type |
  8711. * |-------------------------------------------------------------------|
  8712. * : option request TLV (optional) |
  8713. * :...................................................................:
  8714. *
  8715. * The VER_CONF message may consist of a single 4-byte word, or may be
  8716. * extended with TLVs that specify HTT options selected by the target.
  8717. * The following option TLVs may be appended to the VER_CONF message:
  8718. * - LL_BUS_ADDR_SIZE
  8719. * - HL_SUPPRESS_TX_COMPL_IND
  8720. * - MAX_TX_QUEUE_GROUPS
  8721. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8722. * may be appended to the VER_CONF message (but only one TLV of each type).
  8723. *
  8724. * Header fields:
  8725. * - MSG_TYPE
  8726. * Bits 7:0
  8727. * Purpose: identifies this as a version number confirmation message
  8728. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8729. * - VER_MINOR
  8730. * Bits 15:8
  8731. * Purpose: Specify the minor number of the HTT message library version
  8732. * in use by the target firmware.
  8733. * The minor number specifies the specific revision within a range
  8734. * of fundamentally compatible HTT message definition revisions.
  8735. * Compatible revisions involve adding new messages or perhaps
  8736. * adding new fields to existing messages, in a backwards-compatible
  8737. * manner.
  8738. * Incompatible revisions involve changing the message type values,
  8739. * or redefining existing messages.
  8740. * Value: minor number
  8741. * - VER_MAJOR
  8742. * Bits 15:8
  8743. * Purpose: Specify the major number of the HTT message library version
  8744. * in use by the target firmware.
  8745. * The major number specifies the family of minor revisions that are
  8746. * fundamentally compatible with each other, but not with prior or
  8747. * later families.
  8748. * Value: major number
  8749. */
  8750. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8751. #define HTT_VER_CONF_MINOR_S 8
  8752. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8753. #define HTT_VER_CONF_MAJOR_S 16
  8754. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8755. do { \
  8756. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8757. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8758. } while (0)
  8759. #define HTT_VER_CONF_MINOR_GET(word) \
  8760. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8761. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8762. do { \
  8763. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8764. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8765. } while (0)
  8766. #define HTT_VER_CONF_MAJOR_GET(word) \
  8767. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  8768. #define HTT_VER_CONF_BYTES 4
  8769. /**
  8770. * @brief - target -> host HTT Rx In order indication message
  8771. *
  8772. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  8773. *
  8774. * @details
  8775. *
  8776. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  8777. * |----------------+-------------------+---------------------+---------------|
  8778. * | peer ID | P| F| O| ext TID | msg type |
  8779. * |--------------------------------------------------------------------------|
  8780. * | MSDU count | Reserved | vdev id |
  8781. * |--------------------------------------------------------------------------|
  8782. * | MSDU 0 bus address (bits 31:0) |
  8783. #if HTT_PADDR64
  8784. * | MSDU 0 bus address (bits 63:32) |
  8785. #endif
  8786. * |--------------------------------------------------------------------------|
  8787. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  8788. * |--------------------------------------------------------------------------|
  8789. * | MSDU 1 bus address (bits 31:0) |
  8790. #if HTT_PADDR64
  8791. * | MSDU 1 bus address (bits 63:32) |
  8792. #endif
  8793. * |--------------------------------------------------------------------------|
  8794. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  8795. * |--------------------------------------------------------------------------|
  8796. */
  8797. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  8798. *
  8799. * @details
  8800. * bits
  8801. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  8802. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8803. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  8804. * | | frag | | | | fail |chksum fail|
  8805. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8806. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  8807. */
  8808. struct htt_rx_in_ord_paddr_ind_hdr_t
  8809. {
  8810. A_UINT32 /* word 0 */
  8811. msg_type: 8,
  8812. ext_tid: 5,
  8813. offload: 1,
  8814. frag: 1,
  8815. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  8816. peer_id: 16;
  8817. A_UINT32 /* word 1 */
  8818. vap_id: 8,
  8819. /* NOTE:
  8820. * This reserved_1 field is not truly reserved - certain targets use
  8821. * this field internally to store debug information, and do not zero
  8822. * out the contents of the field before uploading the message to the
  8823. * host. Thus, any host-target communication supported by this field
  8824. * is limited to using values that are never used by the debug
  8825. * information stored by certain targets in the reserved_1 field.
  8826. * In particular, the targets in question don't use the value 0x3
  8827. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  8828. * so this previously-unused value within these bits is available to
  8829. * use as the host / target PKT_CAPTURE_MODE flag.
  8830. */
  8831. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  8832. /* if pkt_capture_mode == 0x3, host should
  8833. * send rx frames to monitor mode interface
  8834. */
  8835. msdu_cnt: 16;
  8836. };
  8837. struct htt_rx_in_ord_paddr_ind_msdu32_t
  8838. {
  8839. A_UINT32 dma_addr;
  8840. A_UINT32
  8841. length: 16,
  8842. fw_desc: 8,
  8843. msdu_info:8;
  8844. };
  8845. struct htt_rx_in_ord_paddr_ind_msdu64_t
  8846. {
  8847. A_UINT32 dma_addr_lo;
  8848. A_UINT32 dma_addr_hi;
  8849. A_UINT32
  8850. length: 16,
  8851. fw_desc: 8,
  8852. msdu_info:8;
  8853. };
  8854. #if HTT_PADDR64
  8855. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  8856. #else
  8857. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  8858. #endif
  8859. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  8860. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  8861. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  8862. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  8863. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  8864. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  8865. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  8866. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  8867. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  8868. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  8869. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  8870. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  8871. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  8872. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  8873. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  8874. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  8875. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  8876. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  8877. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  8878. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  8879. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  8880. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  8881. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  8882. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  8883. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  8884. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  8885. /* for systems using 64-bit format for bus addresses */
  8886. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  8887. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  8888. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  8889. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  8890. /* for systems using 32-bit format for bus addresses */
  8891. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  8892. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  8893. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  8894. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  8895. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  8896. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  8897. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  8898. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  8899. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  8900. do { \
  8901. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  8902. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  8903. } while (0)
  8904. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  8905. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  8906. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  8907. do { \
  8908. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  8909. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  8910. } while (0)
  8911. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  8912. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  8913. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  8914. do { \
  8915. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  8916. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  8917. } while (0)
  8918. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  8919. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  8920. /*
  8921. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  8922. * deliver the rx frames to the monitor mode interface.
  8923. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  8924. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  8925. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  8926. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  8927. */
  8928. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  8929. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  8930. do { \
  8931. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  8932. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  8933. } while (0)
  8934. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  8935. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  8936. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  8937. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  8938. do { \
  8939. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  8940. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  8941. } while (0)
  8942. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  8943. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  8944. /* for systems using 64-bit format for bus addresses */
  8945. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  8946. do { \
  8947. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  8948. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  8949. } while (0)
  8950. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  8951. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  8952. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  8953. do { \
  8954. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  8955. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  8956. } while (0)
  8957. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  8958. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  8959. /* for systems using 32-bit format for bus addresses */
  8960. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  8961. do { \
  8962. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  8963. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  8964. } while (0)
  8965. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  8966. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  8967. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  8968. do { \
  8969. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  8970. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  8971. } while (0)
  8972. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  8973. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  8974. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  8975. do { \
  8976. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  8977. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  8978. } while (0)
  8979. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  8980. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  8981. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  8982. do { \
  8983. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  8984. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  8985. } while (0)
  8986. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  8987. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  8988. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  8989. do { \
  8990. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  8991. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  8992. } while (0)
  8993. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  8994. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  8995. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  8996. do { \
  8997. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  8998. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  8999. } while (0)
  9000. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  9001. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9002. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9003. do { \
  9004. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9005. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9006. } while (0)
  9007. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9008. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9009. /* definitions used within target -> host rx indication message */
  9010. PREPACK struct htt_rx_ind_hdr_prefix_t
  9011. {
  9012. A_UINT32 /* word 0 */
  9013. msg_type: 8,
  9014. ext_tid: 5,
  9015. release_valid: 1,
  9016. flush_valid: 1,
  9017. reserved0: 1,
  9018. peer_id: 16;
  9019. A_UINT32 /* word 1 */
  9020. flush_start_seq_num: 6,
  9021. flush_end_seq_num: 6,
  9022. release_start_seq_num: 6,
  9023. release_end_seq_num: 6,
  9024. num_mpdu_ranges: 8;
  9025. } POSTPACK;
  9026. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9027. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9028. #define HTT_TGT_RSSI_INVALID 0x80
  9029. PREPACK struct htt_rx_ppdu_desc_t
  9030. {
  9031. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9032. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9033. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9034. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9035. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9036. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9037. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9038. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9039. A_UINT32 /* word 0 */
  9040. rssi_cmb: 8,
  9041. timestamp_submicrosec: 8,
  9042. phy_err_code: 8,
  9043. phy_err: 1,
  9044. legacy_rate: 4,
  9045. legacy_rate_sel: 1,
  9046. end_valid: 1,
  9047. start_valid: 1;
  9048. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9049. union {
  9050. A_UINT32 /* word 1 */
  9051. rssi0_pri20: 8,
  9052. rssi0_ext20: 8,
  9053. rssi0_ext40: 8,
  9054. rssi0_ext80: 8;
  9055. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9056. } u0;
  9057. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9058. union {
  9059. A_UINT32 /* word 2 */
  9060. rssi1_pri20: 8,
  9061. rssi1_ext20: 8,
  9062. rssi1_ext40: 8,
  9063. rssi1_ext80: 8;
  9064. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9065. } u1;
  9066. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9067. union {
  9068. A_UINT32 /* word 3 */
  9069. rssi2_pri20: 8,
  9070. rssi2_ext20: 8,
  9071. rssi2_ext40: 8,
  9072. rssi2_ext80: 8;
  9073. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9074. } u2;
  9075. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9076. union {
  9077. A_UINT32 /* word 4 */
  9078. rssi3_pri20: 8,
  9079. rssi3_ext20: 8,
  9080. rssi3_ext40: 8,
  9081. rssi3_ext80: 8;
  9082. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9083. } u3;
  9084. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9085. A_UINT32 tsf32; /* word 5 */
  9086. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9087. A_UINT32 timestamp_microsec; /* word 6 */
  9088. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9089. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9090. A_UINT32 /* word 7 */
  9091. vht_sig_a1: 24,
  9092. preamble_type: 8;
  9093. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9094. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9095. A_UINT32 /* word 8 */
  9096. vht_sig_a2: 24,
  9097. /* sa_ant_matrix
  9098. * For cases where a single rx chain has options to be connected to
  9099. * different rx antennas, show which rx antennas were in use during
  9100. * receipt of a given PPDU.
  9101. * This sa_ant_matrix provides a bitmask of the antennas used while
  9102. * receiving this frame.
  9103. */
  9104. sa_ant_matrix: 8;
  9105. } POSTPACK;
  9106. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9107. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9108. PREPACK struct htt_rx_ind_hdr_suffix_t
  9109. {
  9110. A_UINT32 /* word 0 */
  9111. fw_rx_desc_bytes: 16,
  9112. reserved0: 16;
  9113. } POSTPACK;
  9114. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9115. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9116. PREPACK struct htt_rx_ind_hdr_t
  9117. {
  9118. struct htt_rx_ind_hdr_prefix_t prefix;
  9119. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9120. struct htt_rx_ind_hdr_suffix_t suffix;
  9121. } POSTPACK;
  9122. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9123. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9124. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9125. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9126. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9127. /*
  9128. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9129. * the offset into the HTT rx indication message at which the
  9130. * FW rx PPDU descriptor resides
  9131. */
  9132. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9133. /*
  9134. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9135. * the offset into the HTT rx indication message at which the
  9136. * header suffix (FW rx MSDU byte count) resides
  9137. */
  9138. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9139. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9140. /*
  9141. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9142. * the offset into the HTT rx indication message at which the per-MSDU
  9143. * information starts
  9144. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9145. * per-MSDU information portion of the message. The per-MSDU info itself
  9146. * starts at byte 12.
  9147. */
  9148. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9149. /**
  9150. * @brief target -> host rx indication message definition
  9151. *
  9152. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9153. *
  9154. * @details
  9155. * The following field definitions describe the format of the rx indication
  9156. * message sent from the target to the host.
  9157. * The message consists of three major sections:
  9158. * 1. a fixed-length header
  9159. * 2. a variable-length list of firmware rx MSDU descriptors
  9160. * 3. one or more 4-octet MPDU range information elements
  9161. * The fixed length header itself has two sub-sections
  9162. * 1. the message meta-information, including identification of the
  9163. * sender and type of the received data, and a 4-octet flush/release IE
  9164. * 2. the firmware rx PPDU descriptor
  9165. *
  9166. * The format of the message is depicted below.
  9167. * in this depiction, the following abbreviations are used for information
  9168. * elements within the message:
  9169. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9170. * elements associated with the PPDU start are valid.
  9171. * Specifically, the following fields are valid only if SV is set:
  9172. * RSSI (all variants), L, legacy rate, preamble type, service,
  9173. * VHT-SIG-A
  9174. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9175. * elements associated with the PPDU end are valid.
  9176. * Specifically, the following fields are valid only if EV is set:
  9177. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9178. * - L - Legacy rate selector - if legacy rates are used, this flag
  9179. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9180. * (L == 0) PHY.
  9181. * - P - PHY error flag - boolean indication of whether the rx frame had
  9182. * a PHY error
  9183. *
  9184. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9185. * |----------------+-------------------+---------------------+---------------|
  9186. * | peer ID | |RV|FV| ext TID | msg type |
  9187. * |--------------------------------------------------------------------------|
  9188. * | num | release | release | flush | flush |
  9189. * | MPDU | end | start | end | start |
  9190. * | ranges | seq num | seq num | seq num | seq num |
  9191. * |==========================================================================|
  9192. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9193. * |V|V| | rate | | | timestamp | RSSI |
  9194. * |--------------------------------------------------------------------------|
  9195. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9196. * |--------------------------------------------------------------------------|
  9197. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9198. * |--------------------------------------------------------------------------|
  9199. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9200. * |--------------------------------------------------------------------------|
  9201. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9202. * |--------------------------------------------------------------------------|
  9203. * | TSF LSBs |
  9204. * |--------------------------------------------------------------------------|
  9205. * | microsec timestamp |
  9206. * |--------------------------------------------------------------------------|
  9207. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9208. * |--------------------------------------------------------------------------|
  9209. * | service | HT-SIG / VHT-SIG-A2 |
  9210. * |==========================================================================|
  9211. * | reserved | FW rx desc bytes |
  9212. * |--------------------------------------------------------------------------|
  9213. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9214. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9215. * |--------------------------------------------------------------------------|
  9216. * : : :
  9217. * |--------------------------------------------------------------------------|
  9218. * | alignment | MSDU Rx |
  9219. * | padding | desc Bn |
  9220. * |--------------------------------------------------------------------------|
  9221. * | reserved | MPDU range status | MPDU count |
  9222. * |--------------------------------------------------------------------------|
  9223. * : reserved : MPDU range status : MPDU count :
  9224. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9225. *
  9226. * Header fields:
  9227. * - MSG_TYPE
  9228. * Bits 7:0
  9229. * Purpose: identifies this as an rx indication message
  9230. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9231. * - EXT_TID
  9232. * Bits 12:8
  9233. * Purpose: identify the traffic ID of the rx data, including
  9234. * special "extended" TID values for multicast, broadcast, and
  9235. * non-QoS data frames
  9236. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9237. * - FLUSH_VALID (FV)
  9238. * Bit 13
  9239. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9240. * is valid
  9241. * Value:
  9242. * 1 -> flush IE is valid and needs to be processed
  9243. * 0 -> flush IE is not valid and should be ignored
  9244. * - REL_VALID (RV)
  9245. * Bit 13
  9246. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9247. * is valid
  9248. * Value:
  9249. * 1 -> release IE is valid and needs to be processed
  9250. * 0 -> release IE is not valid and should be ignored
  9251. * - PEER_ID
  9252. * Bits 31:16
  9253. * Purpose: Identify, by ID, which peer sent the rx data
  9254. * Value: ID of the peer who sent the rx data
  9255. * - FLUSH_SEQ_NUM_START
  9256. * Bits 5:0
  9257. * Purpose: Indicate the start of a series of MPDUs to flush
  9258. * Not all MPDUs within this series are necessarily valid - the host
  9259. * must check each sequence number within this range to see if the
  9260. * corresponding MPDU is actually present.
  9261. * This field is only valid if the FV bit is set.
  9262. * Value:
  9263. * The sequence number for the first MPDUs to check to flush.
  9264. * The sequence number is masked by 0x3f.
  9265. * - FLUSH_SEQ_NUM_END
  9266. * Bits 11:6
  9267. * Purpose: Indicate the end of a series of MPDUs to flush
  9268. * Value:
  9269. * The sequence number one larger than the sequence number of the
  9270. * last MPDU to check to flush.
  9271. * The sequence number is masked by 0x3f.
  9272. * Not all MPDUs within this series are necessarily valid - the host
  9273. * must check each sequence number within this range to see if the
  9274. * corresponding MPDU is actually present.
  9275. * This field is only valid if the FV bit is set.
  9276. * - REL_SEQ_NUM_START
  9277. * Bits 17:12
  9278. * Purpose: Indicate the start of a series of MPDUs to release.
  9279. * All MPDUs within this series are present and valid - the host
  9280. * need not check each sequence number within this range to see if
  9281. * the corresponding MPDU is actually present.
  9282. * This field is only valid if the RV bit is set.
  9283. * Value:
  9284. * The sequence number for the first MPDUs to check to release.
  9285. * The sequence number is masked by 0x3f.
  9286. * - REL_SEQ_NUM_END
  9287. * Bits 23:18
  9288. * Purpose: Indicate the end of a series of MPDUs to release.
  9289. * Value:
  9290. * The sequence number one larger than the sequence number of the
  9291. * last MPDU to check to release.
  9292. * The sequence number is masked by 0x3f.
  9293. * All MPDUs within this series are present and valid - the host
  9294. * need not check each sequence number within this range to see if
  9295. * the corresponding MPDU is actually present.
  9296. * This field is only valid if the RV bit is set.
  9297. * - NUM_MPDU_RANGES
  9298. * Bits 31:24
  9299. * Purpose: Indicate how many ranges of MPDUs are present.
  9300. * Each MPDU range consists of a series of contiguous MPDUs within the
  9301. * rx frame sequence which all have the same MPDU status.
  9302. * Value: 1-63 (typically a small number, like 1-3)
  9303. *
  9304. * Rx PPDU descriptor fields:
  9305. * - RSSI_CMB
  9306. * Bits 7:0
  9307. * Purpose: Combined RSSI from all active rx chains, across the active
  9308. * bandwidth.
  9309. * Value: RSSI dB units w.r.t. noise floor
  9310. * - TIMESTAMP_SUBMICROSEC
  9311. * Bits 15:8
  9312. * Purpose: high-resolution timestamp
  9313. * Value:
  9314. * Sub-microsecond time of PPDU reception.
  9315. * This timestamp ranges from [0,MAC clock MHz).
  9316. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9317. * to form a high-resolution, large range rx timestamp.
  9318. * - PHY_ERR_CODE
  9319. * Bits 23:16
  9320. * Purpose:
  9321. * If the rx frame processing resulted in a PHY error, indicate what
  9322. * type of rx PHY error occurred.
  9323. * Value:
  9324. * This field is valid if the "P" (PHY_ERR) flag is set.
  9325. * TBD: document/specify the values for this field
  9326. * - PHY_ERR
  9327. * Bit 24
  9328. * Purpose: indicate whether the rx PPDU had a PHY error
  9329. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9330. * - LEGACY_RATE
  9331. * Bits 28:25
  9332. * Purpose:
  9333. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9334. * specify which rate was used.
  9335. * Value:
  9336. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9337. * flag.
  9338. * If LEGACY_RATE_SEL is 0:
  9339. * 0x8: OFDM 48 Mbps
  9340. * 0x9: OFDM 24 Mbps
  9341. * 0xA: OFDM 12 Mbps
  9342. * 0xB: OFDM 6 Mbps
  9343. * 0xC: OFDM 54 Mbps
  9344. * 0xD: OFDM 36 Mbps
  9345. * 0xE: OFDM 18 Mbps
  9346. * 0xF: OFDM 9 Mbps
  9347. * If LEGACY_RATE_SEL is 1:
  9348. * 0x8: CCK 11 Mbps long preamble
  9349. * 0x9: CCK 5.5 Mbps long preamble
  9350. * 0xA: CCK 2 Mbps long preamble
  9351. * 0xB: CCK 1 Mbps long preamble
  9352. * 0xC: CCK 11 Mbps short preamble
  9353. * 0xD: CCK 5.5 Mbps short preamble
  9354. * 0xE: CCK 2 Mbps short preamble
  9355. * - LEGACY_RATE_SEL
  9356. * Bit 29
  9357. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9358. * Value:
  9359. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9360. * used a legacy rate.
  9361. * 0 -> OFDM, 1 -> CCK
  9362. * - END_VALID
  9363. * Bit 30
  9364. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9365. * the start of the PPDU are valid. Specifically, the following
  9366. * fields are only valid if END_VALID is set:
  9367. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9368. * TIMESTAMP_SUBMICROSEC
  9369. * Value:
  9370. * 0 -> rx PPDU desc end fields are not valid
  9371. * 1 -> rx PPDU desc end fields are valid
  9372. * - START_VALID
  9373. * Bit 31
  9374. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9375. * the end of the PPDU are valid. Specifically, the following
  9376. * fields are only valid if START_VALID is set:
  9377. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9378. * VHT-SIG-A
  9379. * Value:
  9380. * 0 -> rx PPDU desc start fields are not valid
  9381. * 1 -> rx PPDU desc start fields are valid
  9382. * - RSSI0_PRI20
  9383. * Bits 7:0
  9384. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9385. * Value: RSSI dB units w.r.t. noise floor
  9386. *
  9387. * - RSSI0_EXT20
  9388. * Bits 7:0
  9389. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9390. * (if the rx bandwidth was >= 40 MHz)
  9391. * Value: RSSI dB units w.r.t. noise floor
  9392. * - RSSI0_EXT40
  9393. * Bits 7:0
  9394. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9395. * (if the rx bandwidth was >= 80 MHz)
  9396. * Value: RSSI dB units w.r.t. noise floor
  9397. * - RSSI0_EXT80
  9398. * Bits 7:0
  9399. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9400. * (if the rx bandwidth was >= 160 MHz)
  9401. * Value: RSSI dB units w.r.t. noise floor
  9402. *
  9403. * - RSSI1_PRI20
  9404. * Bits 7:0
  9405. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9406. * Value: RSSI dB units w.r.t. noise floor
  9407. * - RSSI1_EXT20
  9408. * Bits 7:0
  9409. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9410. * (if the rx bandwidth was >= 40 MHz)
  9411. * Value: RSSI dB units w.r.t. noise floor
  9412. * - RSSI1_EXT40
  9413. * Bits 7:0
  9414. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9415. * (if the rx bandwidth was >= 80 MHz)
  9416. * Value: RSSI dB units w.r.t. noise floor
  9417. * - RSSI1_EXT80
  9418. * Bits 7:0
  9419. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9420. * (if the rx bandwidth was >= 160 MHz)
  9421. * Value: RSSI dB units w.r.t. noise floor
  9422. *
  9423. * - RSSI2_PRI20
  9424. * Bits 7:0
  9425. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9426. * Value: RSSI dB units w.r.t. noise floor
  9427. * - RSSI2_EXT20
  9428. * Bits 7:0
  9429. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9430. * (if the rx bandwidth was >= 40 MHz)
  9431. * Value: RSSI dB units w.r.t. noise floor
  9432. * - RSSI2_EXT40
  9433. * Bits 7:0
  9434. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9435. * (if the rx bandwidth was >= 80 MHz)
  9436. * Value: RSSI dB units w.r.t. noise floor
  9437. * - RSSI2_EXT80
  9438. * Bits 7:0
  9439. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9440. * (if the rx bandwidth was >= 160 MHz)
  9441. * Value: RSSI dB units w.r.t. noise floor
  9442. *
  9443. * - RSSI3_PRI20
  9444. * Bits 7:0
  9445. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9446. * Value: RSSI dB units w.r.t. noise floor
  9447. * - RSSI3_EXT20
  9448. * Bits 7:0
  9449. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9450. * (if the rx bandwidth was >= 40 MHz)
  9451. * Value: RSSI dB units w.r.t. noise floor
  9452. * - RSSI3_EXT40
  9453. * Bits 7:0
  9454. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9455. * (if the rx bandwidth was >= 80 MHz)
  9456. * Value: RSSI dB units w.r.t. noise floor
  9457. * - RSSI3_EXT80
  9458. * Bits 7:0
  9459. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9460. * (if the rx bandwidth was >= 160 MHz)
  9461. * Value: RSSI dB units w.r.t. noise floor
  9462. *
  9463. * - TSF32
  9464. * Bits 31:0
  9465. * Purpose: specify the time the rx PPDU was received, in TSF units
  9466. * Value: 32 LSBs of the TSF
  9467. * - TIMESTAMP_MICROSEC
  9468. * Bits 31:0
  9469. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9470. * Value: PPDU rx time, in microseconds
  9471. * - VHT_SIG_A1
  9472. * Bits 23:0
  9473. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9474. * from the rx PPDU
  9475. * Value:
  9476. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9477. * VHT-SIG-A1 data.
  9478. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9479. * first 24 bits of the HT-SIG data.
  9480. * Otherwise, this field is invalid.
  9481. * Refer to the the 802.11 protocol for the definition of the
  9482. * HT-SIG and VHT-SIG-A1 fields
  9483. * - VHT_SIG_A2
  9484. * Bits 23:0
  9485. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9486. * from the rx PPDU
  9487. * Value:
  9488. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9489. * VHT-SIG-A2 data.
  9490. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9491. * last 24 bits of the HT-SIG data.
  9492. * Otherwise, this field is invalid.
  9493. * Refer to the the 802.11 protocol for the definition of the
  9494. * HT-SIG and VHT-SIG-A2 fields
  9495. * - PREAMBLE_TYPE
  9496. * Bits 31:24
  9497. * Purpose: indicate the PHY format of the received burst
  9498. * Value:
  9499. * 0x4: Legacy (OFDM/CCK)
  9500. * 0x8: HT
  9501. * 0x9: HT with TxBF
  9502. * 0xC: VHT
  9503. * 0xD: VHT with TxBF
  9504. * - SERVICE
  9505. * Bits 31:24
  9506. * Purpose: TBD
  9507. * Value: TBD
  9508. *
  9509. * Rx MSDU descriptor fields:
  9510. * - FW_RX_DESC_BYTES
  9511. * Bits 15:0
  9512. * Purpose: Indicate how many bytes in the Rx indication are used for
  9513. * FW Rx descriptors
  9514. *
  9515. * Payload fields:
  9516. * - MPDU_COUNT
  9517. * Bits 7:0
  9518. * Purpose: Indicate how many sequential MPDUs share the same status.
  9519. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9520. * - MPDU_STATUS
  9521. * Bits 15:8
  9522. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9523. * received successfully.
  9524. * Value:
  9525. * 0x1: success
  9526. * 0x2: FCS error
  9527. * 0x3: duplicate error
  9528. * 0x4: replay error
  9529. * 0x5: invalid peer
  9530. */
  9531. /* header fields */
  9532. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9533. #define HTT_RX_IND_EXT_TID_S 8
  9534. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9535. #define HTT_RX_IND_FLUSH_VALID_S 13
  9536. #define HTT_RX_IND_REL_VALID_M 0x4000
  9537. #define HTT_RX_IND_REL_VALID_S 14
  9538. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9539. #define HTT_RX_IND_PEER_ID_S 16
  9540. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9541. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9542. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9543. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9544. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9545. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9546. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9547. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9548. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9549. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9550. /* rx PPDU descriptor fields */
  9551. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9552. #define HTT_RX_IND_RSSI_CMB_S 0
  9553. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9554. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9555. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9556. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9557. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9558. #define HTT_RX_IND_PHY_ERR_S 24
  9559. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9560. #define HTT_RX_IND_LEGACY_RATE_S 25
  9561. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9562. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9563. #define HTT_RX_IND_END_VALID_M 0x40000000
  9564. #define HTT_RX_IND_END_VALID_S 30
  9565. #define HTT_RX_IND_START_VALID_M 0x80000000
  9566. #define HTT_RX_IND_START_VALID_S 31
  9567. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9568. #define HTT_RX_IND_RSSI_PRI20_S 0
  9569. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9570. #define HTT_RX_IND_RSSI_EXT20_S 8
  9571. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9572. #define HTT_RX_IND_RSSI_EXT40_S 16
  9573. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9574. #define HTT_RX_IND_RSSI_EXT80_S 24
  9575. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9576. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9577. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9578. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9579. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9580. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9581. #define HTT_RX_IND_SERVICE_M 0xff000000
  9582. #define HTT_RX_IND_SERVICE_S 24
  9583. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9584. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9585. /* rx MSDU descriptor fields */
  9586. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9587. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9588. /* payload fields */
  9589. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9590. #define HTT_RX_IND_MPDU_COUNT_S 0
  9591. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9592. #define HTT_RX_IND_MPDU_STATUS_S 8
  9593. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9594. do { \
  9595. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9596. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9597. } while (0)
  9598. #define HTT_RX_IND_EXT_TID_GET(word) \
  9599. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9600. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9601. do { \
  9602. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9603. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9604. } while (0)
  9605. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9606. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9607. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9608. do { \
  9609. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9610. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9611. } while (0)
  9612. #define HTT_RX_IND_REL_VALID_GET(word) \
  9613. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9614. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9615. do { \
  9616. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9617. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9618. } while (0)
  9619. #define HTT_RX_IND_PEER_ID_GET(word) \
  9620. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9621. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9622. do { \
  9623. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9624. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9625. } while (0)
  9626. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9627. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9628. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9629. do { \
  9630. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9631. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9632. } while (0)
  9633. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9634. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9635. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9636. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9637. do { \
  9638. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9639. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9640. } while (0)
  9641. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9642. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9643. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9644. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9645. do { \
  9646. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9647. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9648. } while (0)
  9649. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9650. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9651. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9652. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9653. do { \
  9654. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9655. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9656. } while (0)
  9657. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9658. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9659. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9660. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9661. do { \
  9662. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9663. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9664. } while (0)
  9665. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9666. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9667. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9668. /* FW rx PPDU descriptor fields */
  9669. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9670. do { \
  9671. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9672. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9673. } while (0)
  9674. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9675. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9676. HTT_RX_IND_RSSI_CMB_S)
  9677. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9678. do { \
  9679. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9680. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9681. } while (0)
  9682. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9683. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9684. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9685. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9686. do { \
  9687. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9688. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9689. } while (0)
  9690. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9691. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9692. HTT_RX_IND_PHY_ERR_CODE_S)
  9693. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9694. do { \
  9695. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9696. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9697. } while (0)
  9698. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9699. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9700. HTT_RX_IND_PHY_ERR_S)
  9701. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9702. do { \
  9703. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9704. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9705. } while (0)
  9706. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9707. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9708. HTT_RX_IND_LEGACY_RATE_S)
  9709. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9710. do { \
  9711. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9712. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9713. } while (0)
  9714. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9715. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9716. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9717. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9718. do { \
  9719. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9720. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9721. } while (0)
  9722. #define HTT_RX_IND_END_VALID_GET(word) \
  9723. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9724. HTT_RX_IND_END_VALID_S)
  9725. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9726. do { \
  9727. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9728. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9729. } while (0)
  9730. #define HTT_RX_IND_START_VALID_GET(word) \
  9731. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9732. HTT_RX_IND_START_VALID_S)
  9733. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9734. do { \
  9735. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9736. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9737. } while (0)
  9738. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9739. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9740. HTT_RX_IND_RSSI_PRI20_S)
  9741. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9742. do { \
  9743. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9744. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9745. } while (0)
  9746. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9747. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9748. HTT_RX_IND_RSSI_EXT20_S)
  9749. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9750. do { \
  9751. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9752. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9753. } while (0)
  9754. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9755. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9756. HTT_RX_IND_RSSI_EXT40_S)
  9757. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9758. do { \
  9759. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9760. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9761. } while (0)
  9762. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9763. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9764. HTT_RX_IND_RSSI_EXT80_S)
  9765. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9766. do { \
  9767. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  9768. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  9769. } while (0)
  9770. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  9771. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  9772. HTT_RX_IND_VHT_SIG_A1_S)
  9773. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  9774. do { \
  9775. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  9776. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  9777. } while (0)
  9778. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  9779. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  9780. HTT_RX_IND_VHT_SIG_A2_S)
  9781. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  9782. do { \
  9783. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  9784. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  9785. } while (0)
  9786. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  9787. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  9788. HTT_RX_IND_PREAMBLE_TYPE_S)
  9789. #define HTT_RX_IND_SERVICE_SET(word, value) \
  9790. do { \
  9791. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  9792. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  9793. } while (0)
  9794. #define HTT_RX_IND_SERVICE_GET(word) \
  9795. (((word) & HTT_RX_IND_SERVICE_M) >> \
  9796. HTT_RX_IND_SERVICE_S)
  9797. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  9798. do { \
  9799. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  9800. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  9801. } while (0)
  9802. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  9803. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  9804. HTT_RX_IND_SA_ANT_MATRIX_S)
  9805. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  9806. do { \
  9807. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  9808. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  9809. } while (0)
  9810. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  9811. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  9812. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  9813. do { \
  9814. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  9815. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  9816. } while (0)
  9817. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  9818. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  9819. #define HTT_RX_IND_HL_BYTES \
  9820. (HTT_RX_IND_HDR_BYTES + \
  9821. 4 /* single FW rx MSDU descriptor */ + \
  9822. 4 /* single MPDU range information element */)
  9823. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  9824. /* Could we use one macro entry? */
  9825. #define HTT_WORD_SET(word, field, value) \
  9826. do { \
  9827. HTT_CHECK_SET_VAL(field, value); \
  9828. (word) |= ((value) << field ## _S); \
  9829. } while (0)
  9830. #define HTT_WORD_GET(word, field) \
  9831. (((word) & field ## _M) >> field ## _S)
  9832. PREPACK struct hl_htt_rx_ind_base {
  9833. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  9834. } POSTPACK;
  9835. /*
  9836. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  9837. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  9838. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  9839. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  9840. * htt_rx_ind_hl_rx_desc_t.
  9841. */
  9842. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  9843. struct htt_rx_ind_hl_rx_desc_t {
  9844. A_UINT8 ver;
  9845. A_UINT8 len;
  9846. struct {
  9847. A_UINT8
  9848. first_msdu: 1,
  9849. last_msdu: 1,
  9850. c3_failed: 1,
  9851. c4_failed: 1,
  9852. ipv6: 1,
  9853. tcp: 1,
  9854. udp: 1,
  9855. reserved: 1;
  9856. } flags;
  9857. /* NOTE: no reserved space - don't append any new fields here */
  9858. };
  9859. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  9860. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9861. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  9862. #define HTT_RX_IND_HL_RX_DESC_VER 0
  9863. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  9864. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9865. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  9866. #define HTT_RX_IND_HL_FLAG_OFFSET \
  9867. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9868. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  9869. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  9870. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  9871. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  9872. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  9873. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  9874. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  9875. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  9876. /* This structure is used in HL, the basic descriptor information
  9877. * used by host. the structure is translated by FW from HW desc
  9878. * or generated by FW. But in HL monitor mode, the host would use
  9879. * the same structure with LL.
  9880. */
  9881. PREPACK struct hl_htt_rx_desc_base {
  9882. A_UINT32
  9883. seq_num:12,
  9884. encrypted:1,
  9885. chan_info_present:1,
  9886. resv0:2,
  9887. mcast_bcast:1,
  9888. fragment:1,
  9889. key_id_oct:8,
  9890. resv1:6;
  9891. A_UINT32
  9892. pn_31_0;
  9893. union {
  9894. struct {
  9895. A_UINT16 pn_47_32;
  9896. A_UINT16 pn_63_48;
  9897. } pn16;
  9898. A_UINT32 pn_63_32;
  9899. } u0;
  9900. A_UINT32
  9901. pn_95_64;
  9902. A_UINT32
  9903. pn_127_96;
  9904. } POSTPACK;
  9905. /*
  9906. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  9907. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  9908. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  9909. * Please see htt_chan_change_t for description of the fields.
  9910. */
  9911. PREPACK struct htt_chan_info_t
  9912. {
  9913. A_UINT32 primary_chan_center_freq_mhz: 16,
  9914. contig_chan1_center_freq_mhz: 16;
  9915. A_UINT32 contig_chan2_center_freq_mhz: 16,
  9916. phy_mode: 8,
  9917. reserved: 8;
  9918. } POSTPACK;
  9919. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  9920. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  9921. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  9922. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  9923. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  9924. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  9925. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  9926. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  9927. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  9928. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  9929. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  9930. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  9931. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  9932. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  9933. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  9934. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  9935. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  9936. /* Channel information */
  9937. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  9938. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  9939. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  9940. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  9941. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  9942. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  9943. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  9944. #define HTT_CHAN_INFO_PHY_MODE_S 16
  9945. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  9946. do { \
  9947. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  9948. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  9949. } while (0)
  9950. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  9951. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  9952. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  9953. do { \
  9954. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  9955. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  9956. } while (0)
  9957. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  9958. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  9959. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  9960. do { \
  9961. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  9962. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  9963. } while (0)
  9964. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  9965. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  9966. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  9967. do { \
  9968. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  9969. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  9970. } while (0)
  9971. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  9972. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  9973. /*
  9974. * @brief target -> host message definition for FW offloaded pkts
  9975. *
  9976. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  9977. *
  9978. * @details
  9979. * The following field definitions describe the format of the firmware
  9980. * offload deliver message sent from the target to the host.
  9981. *
  9982. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  9983. *
  9984. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  9985. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  9986. * | reserved_1 | msg type |
  9987. * |--------------------------------------------------------------------------|
  9988. * | phy_timestamp_l32 |
  9989. * |--------------------------------------------------------------------------|
  9990. * | WORD2 (see below) |
  9991. * |--------------------------------------------------------------------------|
  9992. * | seqno | framectrl |
  9993. * |--------------------------------------------------------------------------|
  9994. * | reserved_3 | vdev_id | tid_num|
  9995. * |--------------------------------------------------------------------------|
  9996. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  9997. * |--------------------------------------------------------------------------|
  9998. *
  9999. * where:
  10000. * STAT = status
  10001. * F = format (802.3 vs. 802.11)
  10002. *
  10003. * definition for word 2
  10004. *
  10005. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10006. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10007. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10008. * |--------------------------------------------------------------------------|
  10009. *
  10010. * where:
  10011. * PR = preamble
  10012. * BF = beamformed
  10013. */
  10014. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10015. {
  10016. A_UINT32 /* word 0 */
  10017. msg_type:8, /* [ 7: 0] */
  10018. reserved_1:24; /* [31: 8] */
  10019. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10020. A_UINT32 /* word 2 */
  10021. /* preamble:
  10022. * 0-OFDM,
  10023. * 1-CCk,
  10024. * 2-HT,
  10025. * 3-VHT
  10026. */
  10027. preamble: 2, /* [1:0] */
  10028. /* mcs:
  10029. * In case of HT preamble interpret
  10030. * MCS along with NSS.
  10031. * Valid values for HT are 0 to 7.
  10032. * HT mcs 0 with NSS 2 is mcs 8.
  10033. * Valid values for VHT are 0 to 9.
  10034. */
  10035. mcs: 4, /* [5:2] */
  10036. /* rate:
  10037. * This is applicable only for
  10038. * CCK and OFDM preamble type
  10039. * rate 0: OFDM 48 Mbps,
  10040. * 1: OFDM 24 Mbps,
  10041. * 2: OFDM 12 Mbps
  10042. * 3: OFDM 6 Mbps
  10043. * 4: OFDM 54 Mbps
  10044. * 5: OFDM 36 Mbps
  10045. * 6: OFDM 18 Mbps
  10046. * 7: OFDM 9 Mbps
  10047. * rate 0: CCK 11 Mbps Long
  10048. * 1: CCK 5.5 Mbps Long
  10049. * 2: CCK 2 Mbps Long
  10050. * 3: CCK 1 Mbps Long
  10051. * 4: CCK 11 Mbps Short
  10052. * 5: CCK 5.5 Mbps Short
  10053. * 6: CCK 2 Mbps Short
  10054. */
  10055. rate : 3, /* [ 8: 6] */
  10056. rssi : 8, /* [16: 9] units=dBm */
  10057. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10058. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10059. stbc : 1, /* [22] */
  10060. sgi : 1, /* [23] */
  10061. ldpc : 1, /* [24] */
  10062. beamformed: 1, /* [25] */
  10063. reserved_2: 6; /* [31:26] */
  10064. A_UINT32 /* word 3 */
  10065. framectrl:16, /* [15: 0] */
  10066. seqno:16; /* [31:16] */
  10067. A_UINT32 /* word 4 */
  10068. tid_num:5, /* [ 4: 0] actual TID number */
  10069. vdev_id:8, /* [12: 5] */
  10070. reserved_3:19; /* [31:13] */
  10071. A_UINT32 /* word 5 */
  10072. /* status:
  10073. * 0: tx_ok
  10074. * 1: retry
  10075. * 2: drop
  10076. * 3: filtered
  10077. * 4: abort
  10078. * 5: tid delete
  10079. * 6: sw abort
  10080. * 7: dropped by peer migration
  10081. */
  10082. status:3, /* [2:0] */
  10083. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10084. tx_mpdu_bytes:16, /* [19:4] */
  10085. /* Indicates retry count of offloaded/local generated Data tx frames */
  10086. tx_retry_cnt:6, /* [25:20] */
  10087. reserved_4:6; /* [31:26] */
  10088. } POSTPACK;
  10089. /* FW offload deliver ind message header fields */
  10090. /* DWORD one */
  10091. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10092. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10093. /* DWORD two */
  10094. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10095. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10096. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10097. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10098. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10099. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10100. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10101. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10102. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10103. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10104. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10105. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10106. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10107. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10108. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10109. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10110. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10111. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10112. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10113. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10114. /* DWORD three*/
  10115. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10116. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10117. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10118. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10119. /* DWORD four */
  10120. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10121. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10122. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10123. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10124. /* DWORD five */
  10125. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10126. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10127. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10128. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10129. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10130. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10131. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10132. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10133. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10134. do { \
  10135. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10136. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10137. } while (0)
  10138. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10139. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10140. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10141. do { \
  10142. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10143. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10144. } while (0)
  10145. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10146. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10147. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10148. do { \
  10149. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10150. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10151. } while (0)
  10152. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10153. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10154. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10155. do { \
  10156. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10157. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10158. } while (0)
  10159. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10160. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10161. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10162. do { \
  10163. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10164. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10165. } while (0)
  10166. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10167. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10168. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10169. do { \
  10170. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10171. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10172. } while (0)
  10173. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10174. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10175. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10176. do { \
  10177. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10178. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10179. } while (0)
  10180. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10181. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10182. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10183. do { \
  10184. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10185. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10186. } while (0)
  10187. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10188. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10189. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10190. do { \
  10191. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10192. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10193. } while (0)
  10194. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10195. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10196. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10197. do { \
  10198. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10199. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10200. } while (0)
  10201. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10202. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10203. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10204. do { \
  10205. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10206. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10207. } while (0)
  10208. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10209. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10210. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10211. do { \
  10212. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10213. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10214. } while (0)
  10215. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10216. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10217. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10218. do { \
  10219. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10220. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10221. } while (0)
  10222. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10223. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10224. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10225. do { \
  10226. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10227. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10228. } while (0)
  10229. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10230. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10231. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10232. do { \
  10233. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10234. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10235. } while (0)
  10236. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10237. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10238. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10239. do { \
  10240. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10241. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10242. } while (0)
  10243. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10244. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10245. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10246. do { \
  10247. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10248. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10249. } while (0)
  10250. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10251. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10252. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10253. do { \
  10254. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10255. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10256. } while (0)
  10257. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10258. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10259. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10260. do { \
  10261. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10262. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10263. } while (0)
  10264. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10265. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10266. /*
  10267. * @brief target -> host rx reorder flush message definition
  10268. *
  10269. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10270. *
  10271. * @details
  10272. * The following field definitions describe the format of the rx flush
  10273. * message sent from the target to the host.
  10274. * The message consists of a 4-octet header, followed by one or more
  10275. * 4-octet payload information elements.
  10276. *
  10277. * |31 24|23 8|7 0|
  10278. * |--------------------------------------------------------------|
  10279. * | TID | peer ID | msg type |
  10280. * |--------------------------------------------------------------|
  10281. * | seq num end | seq num start | MPDU status | reserved |
  10282. * |--------------------------------------------------------------|
  10283. * First DWORD:
  10284. * - MSG_TYPE
  10285. * Bits 7:0
  10286. * Purpose: identifies this as an rx flush message
  10287. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10288. * - PEER_ID
  10289. * Bits 23:8 (only bits 18:8 actually used)
  10290. * Purpose: identify which peer's rx data is being flushed
  10291. * Value: (rx) peer ID
  10292. * - TID
  10293. * Bits 31:24 (only bits 27:24 actually used)
  10294. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10295. * Value: traffic identifier
  10296. * Second DWORD:
  10297. * - MPDU_STATUS
  10298. * Bits 15:8
  10299. * Purpose:
  10300. * Indicate whether the flushed MPDUs should be discarded or processed.
  10301. * Value:
  10302. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10303. * stages of rx processing
  10304. * other: discard the MPDUs
  10305. * It is anticipated that flush messages will always have
  10306. * MPDU status == 1, but the status flag is included for
  10307. * flexibility.
  10308. * - SEQ_NUM_START
  10309. * Bits 23:16
  10310. * Purpose:
  10311. * Indicate the start of a series of consecutive MPDUs being flushed.
  10312. * Not all MPDUs within this range are necessarily valid - the host
  10313. * must check each sequence number within this range to see if the
  10314. * corresponding MPDU is actually present.
  10315. * Value:
  10316. * The sequence number for the first MPDU in the sequence.
  10317. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10318. * - SEQ_NUM_END
  10319. * Bits 30:24
  10320. * Purpose:
  10321. * Indicate the end of a series of consecutive MPDUs being flushed.
  10322. * Value:
  10323. * The sequence number one larger than the sequence number of the
  10324. * last MPDU being flushed.
  10325. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10326. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10327. * are to be released for further rx processing.
  10328. * Not all MPDUs within this range are necessarily valid - the host
  10329. * must check each sequence number within this range to see if the
  10330. * corresponding MPDU is actually present.
  10331. */
  10332. /* first DWORD */
  10333. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10334. #define HTT_RX_FLUSH_PEER_ID_S 8
  10335. #define HTT_RX_FLUSH_TID_M 0xff000000
  10336. #define HTT_RX_FLUSH_TID_S 24
  10337. /* second DWORD */
  10338. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10339. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10340. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10341. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10342. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10343. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10344. #define HTT_RX_FLUSH_BYTES 8
  10345. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10346. do { \
  10347. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10348. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10349. } while (0)
  10350. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10351. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10352. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10353. do { \
  10354. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10355. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10356. } while (0)
  10357. #define HTT_RX_FLUSH_TID_GET(word) \
  10358. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10359. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10360. do { \
  10361. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10362. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10363. } while (0)
  10364. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10365. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10366. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10367. do { \
  10368. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10369. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10370. } while (0)
  10371. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10372. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10373. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10374. do { \
  10375. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10376. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10377. } while (0)
  10378. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10379. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10380. /*
  10381. * @brief target -> host rx pn check indication message
  10382. *
  10383. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10384. *
  10385. * @details
  10386. * The following field definitions describe the format of the Rx PN check
  10387. * indication message sent from the target to the host.
  10388. * The message consists of a 4-octet header, followed by the start and
  10389. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10390. * IE is one octet containing the sequence number that failed the PN
  10391. * check.
  10392. *
  10393. * |31 24|23 8|7 0|
  10394. * |--------------------------------------------------------------|
  10395. * | TID | peer ID | msg type |
  10396. * |--------------------------------------------------------------|
  10397. * | Reserved | PN IE count | seq num end | seq num start|
  10398. * |--------------------------------------------------------------|
  10399. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10400. * |--------------------------------------------------------------|
  10401. * First DWORD:
  10402. * - MSG_TYPE
  10403. * Bits 7:0
  10404. * Purpose: Identifies this as an rx pn check indication message
  10405. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10406. * - PEER_ID
  10407. * Bits 23:8 (only bits 18:8 actually used)
  10408. * Purpose: identify which peer
  10409. * Value: (rx) peer ID
  10410. * - TID
  10411. * Bits 31:24 (only bits 27:24 actually used)
  10412. * Purpose: identify traffic identifier
  10413. * Value: traffic identifier
  10414. * Second DWORD:
  10415. * - SEQ_NUM_START
  10416. * Bits 7:0
  10417. * Purpose:
  10418. * Indicates the starting sequence number of the MPDU in this
  10419. * series of MPDUs that went though PN check.
  10420. * Value:
  10421. * The sequence number for the first MPDU in the sequence.
  10422. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10423. * - SEQ_NUM_END
  10424. * Bits 15:8
  10425. * Purpose:
  10426. * Indicates the ending sequence number of the MPDU in this
  10427. * series of MPDUs that went though PN check.
  10428. * Value:
  10429. * The sequence number one larger then the sequence number of the last
  10430. * MPDU being flushed.
  10431. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10432. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10433. * for invalid PN numbers and are ready to be released for further processing.
  10434. * Not all MPDUs within this range are necessarily valid - the host
  10435. * must check each sequence number within this range to see if the
  10436. * corresponding MPDU is actually present.
  10437. * - PN_IE_COUNT
  10438. * Bits 23:16
  10439. * Purpose:
  10440. * Used to determine the variable number of PN information elements in this
  10441. * message
  10442. *
  10443. * PN information elements:
  10444. * - PN_IE_x-
  10445. * Purpose:
  10446. * Each PN information element contains the sequence number of the MPDU that
  10447. * has failed the target PN check.
  10448. * Value:
  10449. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10450. * that failed the PN check.
  10451. */
  10452. /* first DWORD */
  10453. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10454. #define HTT_RX_PN_IND_PEER_ID_S 8
  10455. #define HTT_RX_PN_IND_TID_M 0xff000000
  10456. #define HTT_RX_PN_IND_TID_S 24
  10457. /* second DWORD */
  10458. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10459. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10460. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10461. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10462. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10463. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10464. #define HTT_RX_PN_IND_BYTES 8
  10465. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10466. do { \
  10467. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10468. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10469. } while (0)
  10470. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10471. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10472. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10473. do { \
  10474. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10475. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10476. } while (0)
  10477. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10478. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10479. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10480. do { \
  10481. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10482. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10483. } while (0)
  10484. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10485. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10486. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10487. do { \
  10488. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10489. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10490. } while (0)
  10491. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10492. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10493. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10494. do { \
  10495. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10496. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10497. } while (0)
  10498. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10499. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10500. /*
  10501. * @brief target -> host rx offload deliver message for LL system
  10502. *
  10503. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10504. *
  10505. * @details
  10506. * In a low latency system this message is sent whenever the offload
  10507. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10508. * The DMA of the actual packets into host memory is done before sending out
  10509. * this message. This message indicates only how many MSDUs to reap. The
  10510. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10511. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10512. * DMA'd by the MAC directly into host memory these packets do not contain
  10513. * the MAC descriptors in the header portion of the packet. Instead they contain
  10514. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10515. * message, the packets are delivered directly to the NW stack without going
  10516. * through the regular reorder buffering and PN checking path since it has
  10517. * already been done in target.
  10518. *
  10519. * |31 24|23 16|15 8|7 0|
  10520. * |-----------------------------------------------------------------------|
  10521. * | Total MSDU count | reserved | msg type |
  10522. * |-----------------------------------------------------------------------|
  10523. *
  10524. * @brief target -> host rx offload deliver message for HL system
  10525. *
  10526. * @details
  10527. * In a high latency system this message is sent whenever the offload manager
  10528. * flushes out the packets it has coalesced in its coalescing buffer. The
  10529. * actual packets are also carried along with this message. When the host
  10530. * receives this message, it is expected to deliver these packets to the NW
  10531. * stack directly instead of routing them through the reorder buffering and
  10532. * PN checking path since it has already been done in target.
  10533. *
  10534. * |31 24|23 16|15 8|7 0|
  10535. * |-----------------------------------------------------------------------|
  10536. * | Total MSDU count | reserved | msg type |
  10537. * |-----------------------------------------------------------------------|
  10538. * | peer ID | MSDU length |
  10539. * |-----------------------------------------------------------------------|
  10540. * | MSDU payload | FW Desc | tid | vdev ID |
  10541. * |-----------------------------------------------------------------------|
  10542. * | MSDU payload contd. |
  10543. * |-----------------------------------------------------------------------|
  10544. * | peer ID | MSDU length |
  10545. * |-----------------------------------------------------------------------|
  10546. * | MSDU payload | FW Desc | tid | vdev ID |
  10547. * |-----------------------------------------------------------------------|
  10548. * | MSDU payload contd. |
  10549. * |-----------------------------------------------------------------------|
  10550. *
  10551. */
  10552. /* first DWORD */
  10553. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10554. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10555. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10556. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10557. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10558. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10559. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10560. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10561. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10562. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10563. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10564. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10565. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10566. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10567. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10568. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10569. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10570. do { \
  10571. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10572. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10573. } while (0)
  10574. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10575. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10576. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10577. do { \
  10578. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10579. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10580. } while (0)
  10581. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10582. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10583. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10584. do { \
  10585. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10586. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10587. } while (0)
  10588. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10589. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10590. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10591. do { \
  10592. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10593. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10594. } while (0)
  10595. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10596. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10597. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10598. do { \
  10599. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10600. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10601. } while (0)
  10602. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10603. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10604. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10605. do { \
  10606. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10607. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10608. } while (0)
  10609. /**
  10610. * @brief target -> host rx peer map/unmap message definition
  10611. *
  10612. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10613. *
  10614. * @details
  10615. * The following diagram shows the format of the rx peer map message sent
  10616. * from the target to the host. This layout assumes the target operates
  10617. * as little-endian.
  10618. *
  10619. * This message always contains a SW peer ID. The main purpose of the
  10620. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10621. * with, so that the host can use that peer ID to determine which peer
  10622. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10623. * other purposes, such as identifying during tx completions which peer
  10624. * the tx frames in question were transmitted to.
  10625. *
  10626. * In certain generations of chips, the peer map message also contains
  10627. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10628. * to identify which peer the frame needs to be forwarded to (i.e. the
  10629. * peer assocated with the Destination MAC Address within the packet),
  10630. * and particularly which vdev needs to transmit the frame (for cases
  10631. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10632. * meaning as AST_INDEX_0.
  10633. * This DA-based peer ID that is provided for certain rx frames
  10634. * (the rx frames that need to be re-transmitted as tx frames)
  10635. * is the ID that the HW uses for referring to the peer in question,
  10636. * rather than the peer ID that the SW+FW use to refer to the peer.
  10637. *
  10638. *
  10639. * |31 24|23 16|15 8|7 0|
  10640. * |-----------------------------------------------------------------------|
  10641. * | SW peer ID | VDEV ID | msg type |
  10642. * |-----------------------------------------------------------------------|
  10643. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10644. * |-----------------------------------------------------------------------|
  10645. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10646. * |-----------------------------------------------------------------------|
  10647. *
  10648. *
  10649. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10650. *
  10651. * The following diagram shows the format of the rx peer unmap message sent
  10652. * from the target to the host.
  10653. *
  10654. * |31 24|23 16|15 8|7 0|
  10655. * |-----------------------------------------------------------------------|
  10656. * | SW peer ID | VDEV ID | msg type |
  10657. * |-----------------------------------------------------------------------|
  10658. *
  10659. * The following field definitions describe the format of the rx peer map
  10660. * and peer unmap messages sent from the target to the host.
  10661. * - MSG_TYPE
  10662. * Bits 7:0
  10663. * Purpose: identifies this as an rx peer map or peer unmap message
  10664. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10665. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10666. * - VDEV_ID
  10667. * Bits 15:8
  10668. * Purpose: Indicates which virtual device the peer is associated
  10669. * with.
  10670. * Value: vdev ID (used in the host to look up the vdev object)
  10671. * - PEER_ID (a.k.a. SW_PEER_ID)
  10672. * Bits 31:16
  10673. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10674. * freeing (unmap)
  10675. * Value: (rx) peer ID
  10676. * - MAC_ADDR_L32 (peer map only)
  10677. * Bits 31:0
  10678. * Purpose: Identifies which peer node the peer ID is for.
  10679. * Value: lower 4 bytes of peer node's MAC address
  10680. * - MAC_ADDR_U16 (peer map only)
  10681. * Bits 15:0
  10682. * Purpose: Identifies which peer node the peer ID is for.
  10683. * Value: upper 2 bytes of peer node's MAC address
  10684. * - HW_PEER_ID
  10685. * Bits 31:16
  10686. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10687. * address, so for rx frames marked for rx --> tx forwarding, the
  10688. * host can determine from the HW peer ID provided as meta-data with
  10689. * the rx frame which peer the frame is supposed to be forwarded to.
  10690. * Value: ID used by the MAC HW to identify the peer
  10691. */
  10692. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10693. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10694. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10695. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10696. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10697. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10698. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10699. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10700. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10701. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10702. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10703. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10704. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10705. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10706. do { \
  10707. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10708. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10709. } while (0)
  10710. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10711. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10712. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10713. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10714. do { \
  10715. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10716. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10717. } while (0)
  10718. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10719. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10720. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10721. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10722. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10723. do { \
  10724. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10725. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10726. } while (0)
  10727. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10728. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10729. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10730. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10731. #define HTT_RX_PEER_MAP_BYTES 12
  10732. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10733. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10734. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10735. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10736. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10737. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10738. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10739. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10740. #define HTT_RX_PEER_UNMAP_BYTES 4
  10741. /**
  10742. * @brief target -> host rx peer map V2 message definition
  10743. *
  10744. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10745. *
  10746. * @details
  10747. * The following diagram shows the format of the rx peer map v2 message sent
  10748. * from the target to the host. This layout assumes the target operates
  10749. * as little-endian.
  10750. *
  10751. * This message always contains a SW peer ID. The main purpose of the
  10752. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10753. * with, so that the host can use that peer ID to determine which peer
  10754. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10755. * other purposes, such as identifying during tx completions which peer
  10756. * the tx frames in question were transmitted to.
  10757. *
  10758. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10759. * is used during rx --> tx frame forwarding to identify which peer the
  10760. * frame needs to be forwarded to (i.e. the peer assocated with the
  10761. * Destination MAC Address within the packet), and particularly which vdev
  10762. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10763. * This DA-based peer ID that is provided for certain rx frames
  10764. * (the rx frames that need to be re-transmitted as tx frames)
  10765. * is the ID that the HW uses for referring to the peer in question,
  10766. * rather than the peer ID that the SW+FW use to refer to the peer.
  10767. *
  10768. * The HW peer id here is the same meaning as AST_INDEX_0.
  10769. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  10770. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  10771. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  10772. * AST is valid.
  10773. *
  10774. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  10775. * |-------------------------------------------------------------------------|
  10776. * | SW peer ID | VDEV ID | msg type |
  10777. * |-------------------------------------------------------------------------|
  10778. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10779. * |-------------------------------------------------------------------------|
  10780. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10781. * |-------------------------------------------------------------------------|
  10782. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  10783. * |-------------------------------------------------------------------------|
  10784. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  10785. * |-------------------------------------------------------------------------|
  10786. * |TID valid low pri| TID valid hi pri | AST index 2 |
  10787. * |-------------------------------------------------------------------------|
  10788. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  10789. * |-------------------------------------------------------------------------|
  10790. * | Reserved_2 |
  10791. * |-------------------------------------------------------------------------|
  10792. * Where:
  10793. * NH = Next Hop
  10794. * ASTVM = AST valid mask
  10795. * OA = on-chip AST valid bit
  10796. * ASTFM = AST flow mask
  10797. *
  10798. * The following field definitions describe the format of the rx peer map v2
  10799. * messages sent from the target to the host.
  10800. * - MSG_TYPE
  10801. * Bits 7:0
  10802. * Purpose: identifies this as an rx peer map v2 message
  10803. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  10804. * - VDEV_ID
  10805. * Bits 15:8
  10806. * Purpose: Indicates which virtual device the peer is associated with.
  10807. * Value: vdev ID (used in the host to look up the vdev object)
  10808. * - SW_PEER_ID
  10809. * Bits 31:16
  10810. * Purpose: The peer ID (index) that WAL is allocating
  10811. * Value: (rx) peer ID
  10812. * - MAC_ADDR_L32
  10813. * Bits 31:0
  10814. * Purpose: Identifies which peer node the peer ID is for.
  10815. * Value: lower 4 bytes of peer node's MAC address
  10816. * - MAC_ADDR_U16
  10817. * Bits 15:0
  10818. * Purpose: Identifies which peer node the peer ID is for.
  10819. * Value: upper 2 bytes of peer node's MAC address
  10820. * - HW_PEER_ID / AST_INDEX_0
  10821. * Bits 31:16
  10822. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10823. * address, so for rx frames marked for rx --> tx forwarding, the
  10824. * host can determine from the HW peer ID provided as meta-data with
  10825. * the rx frame which peer the frame is supposed to be forwarded to.
  10826. * Value: ID used by the MAC HW to identify the peer
  10827. * - AST_HASH_VALUE
  10828. * Bits 15:0
  10829. * Purpose: Indicates AST Hash value is required for the TCL AST index
  10830. * override feature.
  10831. * - NEXT_HOP
  10832. * Bit 16
  10833. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  10834. * (Wireless Distribution System).
  10835. * - AST_VALID_MASK
  10836. * Bits 19:17
  10837. * Purpose: Indicate if the AST 1 through AST 3 are valid
  10838. * - ONCHIP_AST_VALID_FLAG
  10839. * Bit 20
  10840. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  10841. * is valid.
  10842. * - AST_INDEX_1
  10843. * Bits 15:0
  10844. * Purpose: indicate the second AST index for this peer
  10845. * - AST_0_FLOW_MASK
  10846. * Bits 19:16
  10847. * Purpose: identify the which flow the AST 0 entry corresponds to.
  10848. * - AST_1_FLOW_MASK
  10849. * Bits 23:20
  10850. * Purpose: identify the which flow the AST 1 entry corresponds to.
  10851. * - AST_2_FLOW_MASK
  10852. * Bits 27:24
  10853. * Purpose: identify the which flow the AST 2 entry corresponds to.
  10854. * - AST_3_FLOW_MASK
  10855. * Bits 31:28
  10856. * Purpose: identify the which flow the AST 3 entry corresponds to.
  10857. * - AST_INDEX_2
  10858. * Bits 15:0
  10859. * Purpose: indicate the third AST index for this peer
  10860. * - TID_VALID_HI_PRI
  10861. * Bits 23:16
  10862. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  10863. * - TID_VALID_LOW_PRI
  10864. * Bits 31:24
  10865. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  10866. * - AST_INDEX_3
  10867. * Bits 15:0
  10868. * Purpose: indicate the fourth AST index for this peer
  10869. * - ONCHIP_AST_IDX / RESERVED
  10870. * Bits 31:16
  10871. * Purpose: This field is valid only when split AST feature is enabled.
  10872. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  10873. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10874. * address, this ast_idx is used for LMAC modules for RXPCU.
  10875. * Value: ID used by the LMAC HW to identify the peer
  10876. */
  10877. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  10878. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  10879. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  10880. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  10881. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  10882. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  10883. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  10884. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  10885. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  10886. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  10887. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  10888. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  10889. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  10890. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  10891. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  10892. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  10893. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  10894. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  10895. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  10896. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  10897. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  10898. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  10899. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  10900. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  10901. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  10902. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  10903. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  10904. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  10905. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  10906. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  10907. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  10908. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  10909. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  10910. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  10911. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  10912. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  10913. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  10914. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  10915. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  10916. do { \
  10917. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  10918. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  10919. } while (0)
  10920. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  10921. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  10922. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  10923. do { \
  10924. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  10925. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  10926. } while (0)
  10927. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  10928. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  10929. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  10930. do { \
  10931. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  10932. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  10933. } while (0)
  10934. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  10935. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  10936. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  10937. do { \
  10938. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  10939. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  10940. } while (0)
  10941. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  10942. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  10943. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  10944. do { \
  10945. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  10946. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  10947. } while (0)
  10948. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  10949. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  10950. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  10951. do { \
  10952. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  10953. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  10954. } while (0)
  10955. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  10956. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  10957. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  10958. do { \
  10959. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  10960. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  10961. } while (0)
  10962. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  10963. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  10964. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10965. do { \
  10966. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  10967. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  10968. } while (0)
  10969. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  10970. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  10971. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  10972. do { \
  10973. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  10974. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  10975. } while (0)
  10976. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  10977. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  10978. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  10979. do { \
  10980. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  10981. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  10982. } while (0)
  10983. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  10984. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  10985. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  10986. do { \
  10987. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  10988. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  10989. } while (0)
  10990. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  10991. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  10992. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  10993. do { \
  10994. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  10995. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  10996. } while (0)
  10997. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  10998. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  10999. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  11000. do { \
  11001. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11002. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11003. } while (0)
  11004. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11005. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11006. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11007. do { \
  11008. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11009. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11010. } while (0)
  11011. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11012. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11013. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11014. do { \
  11015. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11016. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11017. } while (0)
  11018. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11019. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11020. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11021. do { \
  11022. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11023. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11024. } while (0)
  11025. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11026. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11027. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11028. do { \
  11029. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11030. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11031. } while (0)
  11032. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11033. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11034. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11035. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11036. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11037. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11038. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11039. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11040. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11041. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11042. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11043. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11044. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11045. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11046. /**
  11047. * @brief target -> host rx peer map V3 message definition
  11048. *
  11049. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11050. *
  11051. * @details
  11052. * The following diagram shows the format of the rx peer map v3 message sent
  11053. * from the target to the host.
  11054. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11055. * This layout assumes the target operates as little-endian.
  11056. *
  11057. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11058. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11059. * | SW peer ID | VDEV ID | msg type |
  11060. * |-----------------+--------------------+-----------------+-----------------|
  11061. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11062. * |-----------------+--------------------+-----------------+-----------------|
  11063. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11064. * |-----------------+--------+-----------+-----------------+-----------------|
  11065. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11066. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11067. * | (8bits) | | (4bits) | |
  11068. * |-----------------+--------+--+--+--+--------------------------------------|
  11069. * | RESERVED |E |O | | |
  11070. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11071. * | |V |V | | |
  11072. * |-----------------+--------------------+-----------------------------------|
  11073. * | HTT_MSDU_IDX_ | RESERVED | |
  11074. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11075. * | (8bits) | | |
  11076. * |-----------------+--------------------+-----------------------------------|
  11077. * | Reserved_2 |
  11078. * |--------------------------------------------------------------------------|
  11079. * | Reserved_3 |
  11080. * |--------------------------------------------------------------------------|
  11081. *
  11082. * Where:
  11083. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11084. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11085. * NH = Next Hop
  11086. * The following field definitions describe the format of the rx peer map v3
  11087. * messages sent from the target to the host.
  11088. * - MSG_TYPE
  11089. * Bits 7:0
  11090. * Purpose: identifies this as a peer map v3 message
  11091. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11092. * - VDEV_ID
  11093. * Bits 15:8
  11094. * Purpose: Indicates which virtual device the peer is associated with.
  11095. * - SW_PEER_ID
  11096. * Bits 31:16
  11097. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11098. * - MAC_ADDR_L32
  11099. * Bits 31:0
  11100. * Purpose: Identifies which peer node the peer ID is for.
  11101. * Value: lower 4 bytes of peer node's MAC address
  11102. * - MAC_ADDR_U16
  11103. * Bits 15:0
  11104. * Purpose: Identifies which peer node the peer ID is for.
  11105. * Value: upper 2 bytes of peer node's MAC address
  11106. * - MULTICAST_SW_PEER_ID
  11107. * Bits 31:16
  11108. * Purpose: The multicast peer ID (index)
  11109. * Value: set to HTT_INVALID_PEER if not valid
  11110. * - HW_PEER_ID / AST_INDEX
  11111. * Bits 15:0
  11112. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11113. * address, so for rx frames marked for rx --> tx forwarding, the
  11114. * host can determine from the HW peer ID provided as meta-data with
  11115. * the rx frame which peer the frame is supposed to be forwarded to.
  11116. * - CACHE_SET_NUM
  11117. * Bits 19:16
  11118. * Purpose: Cache Set Number for AST_INDEX
  11119. * Cache set number that should be used to cache the index based
  11120. * search results, for address and flow search.
  11121. * This value should be equal to LSB 4 bits of the hash value
  11122. * of match data, in case of search index points to an entry which
  11123. * may be used in content based search also. The value can be
  11124. * anything when the entry pointed by search index will not be
  11125. * used for content based search.
  11126. * - HTT_MSDU_IDX_VALID_MASK
  11127. * Bits 31:24
  11128. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11129. * - ONCHIP_AST_IDX / RESERVED
  11130. * Bits 15:0
  11131. * Purpose: This field is valid only when split AST feature is enabled.
  11132. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11133. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11134. * address, this ast_idx is used for LMAC modules for RXPCU.
  11135. * - NEXT_HOP
  11136. * Bits 16
  11137. * Purpose: Flag indicates next_hop AST entry used for WDS
  11138. * (Wireless Distribution System).
  11139. * - ONCHIP_AST_VALID
  11140. * Bits 17
  11141. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11142. * - EXT_AST_VALID
  11143. * Bits 18
  11144. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11145. * - EXT_AST_INDEX
  11146. * Bits 15:0
  11147. * Purpose: This field describes Extended AST index
  11148. * Valid if EXT_AST_VALID flag set
  11149. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11150. * Bits 31:24
  11151. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11152. */
  11153. /* dword 0 */
  11154. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11155. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11156. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11157. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11158. /* dword 1 */
  11159. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11160. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11161. /* dword 2 */
  11162. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11163. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11164. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11165. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11166. /* dword 3 */
  11167. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11168. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11169. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11170. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11171. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11172. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11173. /* dword 4 */
  11174. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11175. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11176. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11177. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11178. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11179. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11180. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11181. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11182. /* dword 5 */
  11183. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11184. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11185. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11186. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11187. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11188. do { \
  11189. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11190. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11191. } while (0)
  11192. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11193. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11194. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11195. do { \
  11196. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11197. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11198. } while (0)
  11199. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11200. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11201. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11202. do { \
  11203. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11204. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11205. } while (0)
  11206. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11207. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11208. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11209. do { \
  11210. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11211. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11212. } while (0)
  11213. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11214. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11215. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11216. do { \
  11217. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11218. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11219. } while (0)
  11220. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11221. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11222. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11223. do { \
  11224. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11225. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11226. } while (0)
  11227. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11228. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11229. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11230. do { \
  11231. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11232. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11233. } while (0)
  11234. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11235. (((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)
  11236. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11237. do { \
  11238. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11239. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11240. } while (0)
  11241. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11242. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11243. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11244. do { \
  11245. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11246. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11247. } while (0)
  11248. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11249. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11250. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11251. do { \
  11252. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11253. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11254. } while (0)
  11255. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11256. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11257. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11258. do { \
  11259. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11260. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11261. } while (0)
  11262. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11263. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11264. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11265. do { \
  11266. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11267. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11268. } while (0)
  11269. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11270. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11271. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11272. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11273. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11274. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11275. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11276. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11277. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11278. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11279. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11280. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11281. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11282. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11283. /**
  11284. * @brief target -> host rx peer unmap V2 message definition
  11285. *
  11286. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11287. *
  11288. * The following diagram shows the format of the rx peer unmap message sent
  11289. * from the target to the host.
  11290. *
  11291. * |31 24|23 16|15 8|7 0|
  11292. * |-----------------------------------------------------------------------|
  11293. * | SW peer ID | VDEV ID | msg type |
  11294. * |-----------------------------------------------------------------------|
  11295. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11296. * |-----------------------------------------------------------------------|
  11297. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11298. * |-----------------------------------------------------------------------|
  11299. * | Peer Delete Duration |
  11300. * |-----------------------------------------------------------------------|
  11301. * | Reserved_0 | WDS Free Count |
  11302. * |-----------------------------------------------------------------------|
  11303. * | Reserved_1 |
  11304. * |-----------------------------------------------------------------------|
  11305. * | Reserved_2 |
  11306. * |-----------------------------------------------------------------------|
  11307. *
  11308. *
  11309. * The following field definitions describe the format of the rx peer unmap
  11310. * messages sent from the target to the host.
  11311. * - MSG_TYPE
  11312. * Bits 7:0
  11313. * Purpose: identifies this as an rx peer unmap v2 message
  11314. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11315. * - VDEV_ID
  11316. * Bits 15:8
  11317. * Purpose: Indicates which virtual device the peer is associated
  11318. * with.
  11319. * Value: vdev ID (used in the host to look up the vdev object)
  11320. * - SW_PEER_ID
  11321. * Bits 31:16
  11322. * Purpose: The peer ID (index) that WAL is freeing
  11323. * Value: (rx) peer ID
  11324. * - MAC_ADDR_L32
  11325. * Bits 31:0
  11326. * Purpose: Identifies which peer node the peer ID is for.
  11327. * Value: lower 4 bytes of peer node's MAC address
  11328. * - MAC_ADDR_U16
  11329. * Bits 15:0
  11330. * Purpose: Identifies which peer node the peer ID is for.
  11331. * Value: upper 2 bytes of peer node's MAC address
  11332. * - NEXT_HOP
  11333. * Bits 16
  11334. * Purpose: Bit indicates next_hop AST entry used for WDS
  11335. * (Wireless Distribution System).
  11336. * - PEER_DELETE_DURATION
  11337. * Bits 31:0
  11338. * Purpose: Time taken to delete peer, in msec,
  11339. * Used for monitoring / debugging PEER delete response delay
  11340. * - PEER_WDS_FREE_COUNT
  11341. * Bits 15:0
  11342. * Purpose: Count of WDS entries deleted associated to peer deleted
  11343. */
  11344. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11345. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11346. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11347. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11348. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11349. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11350. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11351. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11352. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11353. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11354. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11355. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11356. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11357. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11358. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11359. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11360. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11361. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11362. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11363. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11364. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11365. do { \
  11366. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11367. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11368. } while (0)
  11369. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11370. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11371. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11372. do { \
  11373. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11374. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11375. } while (0)
  11376. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11377. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11378. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11379. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11380. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11381. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11382. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11383. /**
  11384. * @brief target -> host rx peer mlo map message definition
  11385. *
  11386. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11387. *
  11388. * @details
  11389. * The following diagram shows the format of the rx mlo peer map message sent
  11390. * from the target to the host. This layout assumes the target operates
  11391. * as little-endian.
  11392. *
  11393. * MCC:
  11394. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11395. *
  11396. * WIN:
  11397. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11398. * It will be sent on the Assoc Link.
  11399. *
  11400. * This message always contains a MLO peer ID. The main purpose of the
  11401. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11402. * with, so that the host can use that MLO peer ID to determine which peer
  11403. * transmitted the rx frame.
  11404. *
  11405. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11406. * |-------------------------------------------------------------------------|
  11407. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11408. * |-------------------------------------------------------------------------|
  11409. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11410. * |-------------------------------------------------------------------------|
  11411. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11412. * |-------------------------------------------------------------------------|
  11413. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11414. * |-------------------------------------------------------------------------|
  11415. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11416. * |-------------------------------------------------------------------------|
  11417. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11418. * |-------------------------------------------------------------------------|
  11419. * |RSVD |
  11420. * |-------------------------------------------------------------------------|
  11421. * |RSVD |
  11422. * |-------------------------------------------------------------------------|
  11423. * | htt_tlv_hdr_t |
  11424. * |-------------------------------------------------------------------------|
  11425. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11426. * |-------------------------------------------------------------------------|
  11427. * | htt_tlv_hdr_t |
  11428. * |-------------------------------------------------------------------------|
  11429. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11430. * |-------------------------------------------------------------------------|
  11431. * | htt_tlv_hdr_t |
  11432. * |-------------------------------------------------------------------------|
  11433. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11434. * |-------------------------------------------------------------------------|
  11435. *
  11436. * Where:
  11437. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11438. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11439. * V (valid) - 1 Bit Bit17
  11440. * CHIPID - 3 Bits
  11441. * TIDMASK - 8 Bits
  11442. * CACHE_SET_NUM - 8 Bits
  11443. *
  11444. * The following field definitions describe the format of the rx MLO peer map
  11445. * messages sent from the target to the host.
  11446. * - MSG_TYPE
  11447. * Bits 7:0
  11448. * Purpose: identifies this as an rx mlo peer map message
  11449. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11450. *
  11451. * - MLO_PEER_ID
  11452. * Bits 23:8
  11453. * Purpose: The MLO peer ID (index).
  11454. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11455. * Value: MLO peer ID
  11456. *
  11457. * - NUMLINK
  11458. * Bits: 26:24 (3Bits)
  11459. * Purpose: Indicate the max number of logical links supported per client.
  11460. * Value: number of logical links
  11461. *
  11462. * - PRC
  11463. * Bits: 29:27 (3Bits)
  11464. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11465. * if there is migration of the primary chip.
  11466. * Value: Primary REO CHIPID
  11467. *
  11468. * - MAC_ADDR_L32
  11469. * Bits 31:0
  11470. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11471. * Value: lower 4 bytes of peer node's MAC address
  11472. *
  11473. * - MAC_ADDR_U16
  11474. * Bits 15:0
  11475. * Purpose: Identifies which peer node the peer ID is for.
  11476. * Value: upper 2 bytes of peer node's MAC address
  11477. *
  11478. * - PRIMARY_TCL_AST_IDX
  11479. * Bits 15:0
  11480. * Purpose: Primary TCL AST index for this peer.
  11481. *
  11482. * - V
  11483. * 1 Bit Position 16
  11484. * Purpose: If the ast idx is valid.
  11485. *
  11486. * - CHIPID
  11487. * Bits 19:17
  11488. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11489. *
  11490. * - TIDMASK
  11491. * Bits 27:20
  11492. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11493. *
  11494. * - CACHE_SET_NUM
  11495. * Bits 31:28
  11496. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11497. * Cache set number that should be used to cache the index based
  11498. * search results, for address and flow search.
  11499. * This value should be equal to LSB four bits of the hash value
  11500. * of match data, in case of search index points to an entry which
  11501. * may be used in content based search also. The value can be
  11502. * anything when the entry pointed by search index will not be
  11503. * used for content based search.
  11504. *
  11505. * - htt_tlv_hdr_t
  11506. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11507. *
  11508. * Bits 11:0
  11509. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11510. *
  11511. * Bits 23:12
  11512. * Purpose: Length, Length of the value that follows the header
  11513. *
  11514. * Bits 31:28
  11515. * Purpose: Reserved.
  11516. *
  11517. *
  11518. * - SW_PEER_ID
  11519. * Bits 15:0
  11520. * Purpose: The peer ID (index) that WAL is allocating
  11521. * Value: (rx) peer ID
  11522. *
  11523. * - VDEV_ID
  11524. * Bits 23:16
  11525. * Purpose: Indicates which virtual device the peer is associated with.
  11526. * Value: vdev ID (used in the host to look up the vdev object)
  11527. *
  11528. * - CHIPID
  11529. * Bits 26:24
  11530. * Purpose: Indicates which Chip id the peer is associated with.
  11531. * Value: chip ID (Provided by Host as part of QMI exchange)
  11532. */
  11533. typedef enum {
  11534. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11535. } MLO_PEER_MAP_TLV_TAG_ID;
  11536. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11537. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11538. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11539. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11540. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11541. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11542. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11543. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11544. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11545. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11546. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11547. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11548. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11549. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11550. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11551. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11552. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11553. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11554. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11555. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11556. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11557. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11558. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11559. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11560. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11561. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11562. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11563. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11564. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11565. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11566. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11567. do { \
  11568. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11569. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11570. } while (0)
  11571. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11572. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11573. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11574. do { \
  11575. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11576. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11577. } while (0)
  11578. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11579. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11580. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11581. do { \
  11582. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11583. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11584. } while (0)
  11585. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11586. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11587. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11588. do { \
  11589. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11590. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11591. } while (0)
  11592. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11593. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11594. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11595. do { \
  11596. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11597. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11598. } while (0)
  11599. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11600. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11601. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11602. do { \
  11603. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11604. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11605. } while (0)
  11606. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11607. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11608. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11609. do { \
  11610. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11611. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11612. } while (0)
  11613. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11614. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11615. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11616. do { \
  11617. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11618. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11619. } while (0)
  11620. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11621. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11622. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11623. do { \
  11624. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11625. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11626. } while (0)
  11627. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11628. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11629. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11630. do { \
  11631. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11632. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11633. } while (0)
  11634. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11635. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11636. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11637. do { \
  11638. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11639. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11640. } while (0)
  11641. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11642. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11643. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11644. do { \
  11645. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11646. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11647. } while (0)
  11648. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11649. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11650. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11651. do { \
  11652. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11653. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11654. } while (0)
  11655. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11656. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11657. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11658. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11659. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11660. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11661. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11662. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11663. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11664. *
  11665. * The following diagram shows the format of the rx mlo peer unmap message sent
  11666. * from the target to the host.
  11667. *
  11668. * |31 24|23 16|15 8|7 0|
  11669. * |-----------------------------------------------------------------------|
  11670. * | RSVD_24_31 | MLO peer ID | msg type |
  11671. * |-----------------------------------------------------------------------|
  11672. */
  11673. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11674. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11675. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11676. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11677. /**
  11678. * @brief target -> host message specifying security parameters
  11679. *
  11680. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11681. *
  11682. * @details
  11683. * The following diagram shows the format of the security specification
  11684. * message sent from the target to the host.
  11685. * This security specification message tells the host whether a PN check is
  11686. * necessary on rx data frames, and if so, how large the PN counter is.
  11687. * This message also tells the host about the security processing to apply
  11688. * to defragmented rx frames - specifically, whether a Message Integrity
  11689. * Check is required, and the Michael key to use.
  11690. *
  11691. * |31 24|23 16|15|14 8|7 0|
  11692. * |-----------------------------------------------------------------------|
  11693. * | peer ID | U| security type | msg type |
  11694. * |-----------------------------------------------------------------------|
  11695. * | Michael Key K0 |
  11696. * |-----------------------------------------------------------------------|
  11697. * | Michael Key K1 |
  11698. * |-----------------------------------------------------------------------|
  11699. * | WAPI RSC Low0 |
  11700. * |-----------------------------------------------------------------------|
  11701. * | WAPI RSC Low1 |
  11702. * |-----------------------------------------------------------------------|
  11703. * | WAPI RSC Hi0 |
  11704. * |-----------------------------------------------------------------------|
  11705. * | WAPI RSC Hi1 |
  11706. * |-----------------------------------------------------------------------|
  11707. *
  11708. * The following field definitions describe the format of the security
  11709. * indication message sent from the target to the host.
  11710. * - MSG_TYPE
  11711. * Bits 7:0
  11712. * Purpose: identifies this as a security specification message
  11713. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11714. * - SEC_TYPE
  11715. * Bits 14:8
  11716. * Purpose: specifies which type of security applies to the peer
  11717. * Value: htt_sec_type enum value
  11718. * - UNICAST
  11719. * Bit 15
  11720. * Purpose: whether this security is applied to unicast or multicast data
  11721. * Value: 1 -> unicast, 0 -> multicast
  11722. * - PEER_ID
  11723. * Bits 31:16
  11724. * Purpose: The ID number for the peer the security specification is for
  11725. * Value: peer ID
  11726. * - MICHAEL_KEY_K0
  11727. * Bits 31:0
  11728. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11729. * Value: Michael Key K0 (if security type is TKIP)
  11730. * - MICHAEL_KEY_K1
  11731. * Bits 31:0
  11732. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11733. * Value: Michael Key K1 (if security type is TKIP)
  11734. * - WAPI_RSC_LOW0
  11735. * Bits 31:0
  11736. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11737. * Value: WAPI RSC Low0 (if security type is WAPI)
  11738. * - WAPI_RSC_LOW1
  11739. * Bits 31:0
  11740. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11741. * Value: WAPI RSC Low1 (if security type is WAPI)
  11742. * - WAPI_RSC_HI0
  11743. * Bits 31:0
  11744. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11745. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11746. * - WAPI_RSC_HI1
  11747. * Bits 31:0
  11748. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11749. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11750. */
  11751. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11752. #define HTT_SEC_IND_SEC_TYPE_S 8
  11753. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11754. #define HTT_SEC_IND_UNICAST_S 15
  11755. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11756. #define HTT_SEC_IND_PEER_ID_S 16
  11757. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11758. do { \
  11759. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11760. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11761. } while (0)
  11762. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11763. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11764. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11765. do { \
  11766. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  11767. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  11768. } while (0)
  11769. #define HTT_SEC_IND_UNICAST_GET(word) \
  11770. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  11771. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  11772. do { \
  11773. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  11774. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  11775. } while (0)
  11776. #define HTT_SEC_IND_PEER_ID_GET(word) \
  11777. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  11778. #define HTT_SEC_IND_BYTES 28
  11779. /**
  11780. * @brief target -> host rx ADDBA / DELBA message definitions
  11781. *
  11782. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  11783. *
  11784. * @details
  11785. * The following diagram shows the format of the rx ADDBA message sent
  11786. * from the target to the host:
  11787. *
  11788. * |31 20|19 16|15 8|7 0|
  11789. * |---------------------------------------------------------------------|
  11790. * | peer ID | TID | window size | msg type |
  11791. * |---------------------------------------------------------------------|
  11792. *
  11793. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  11794. *
  11795. * The following diagram shows the format of the rx DELBA message sent
  11796. * from the target to the host:
  11797. *
  11798. * |31 20|19 16|15 10|9 8|7 0|
  11799. * |---------------------------------------------------------------------|
  11800. * | peer ID | TID | window size | IR| msg type |
  11801. * |---------------------------------------------------------------------|
  11802. *
  11803. * The following field definitions describe the format of the rx ADDBA
  11804. * and DELBA messages sent from the target to the host.
  11805. * - MSG_TYPE
  11806. * Bits 7:0
  11807. * Purpose: identifies this as an rx ADDBA or DELBA message
  11808. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  11809. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  11810. * - IR (initiator / recipient)
  11811. * Bits 9:8 (DELBA only)
  11812. * Purpose: specify whether the DELBA handshake was initiated by the
  11813. * local STA/AP, or by the peer STA/AP
  11814. * Value:
  11815. * 0 - unspecified
  11816. * 1 - initiator (a.k.a. originator)
  11817. * 2 - recipient (a.k.a. responder)
  11818. * 3 - unused / reserved
  11819. * - WIN_SIZE
  11820. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  11821. * Purpose: Specifies the length of the block ack window (max = 64).
  11822. * Value:
  11823. * block ack window length specified by the received ADDBA/DELBA
  11824. * management message.
  11825. * - TID
  11826. * Bits 19:16
  11827. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  11828. * Value:
  11829. * TID specified by the received ADDBA or DELBA management message.
  11830. * - PEER_ID
  11831. * Bits 31:20
  11832. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  11833. * Value:
  11834. * ID (hash value) used by the host for fast, direct lookup of
  11835. * host SW peer info, including rx reorder states.
  11836. */
  11837. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  11838. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  11839. #define HTT_RX_ADDBA_TID_M 0xf0000
  11840. #define HTT_RX_ADDBA_TID_S 16
  11841. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  11842. #define HTT_RX_ADDBA_PEER_ID_S 20
  11843. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  11844. do { \
  11845. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  11846. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  11847. } while (0)
  11848. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  11849. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  11850. #define HTT_RX_ADDBA_TID_SET(word, value) \
  11851. do { \
  11852. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  11853. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  11854. } while (0)
  11855. #define HTT_RX_ADDBA_TID_GET(word) \
  11856. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  11857. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  11858. do { \
  11859. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  11860. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  11861. } while (0)
  11862. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  11863. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  11864. #define HTT_RX_ADDBA_BYTES 4
  11865. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  11866. #define HTT_RX_DELBA_INITIATOR_S 8
  11867. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  11868. #define HTT_RX_DELBA_WIN_SIZE_S 10
  11869. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  11870. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  11871. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  11872. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  11873. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  11874. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  11875. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  11876. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  11877. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  11878. do { \
  11879. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  11880. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  11881. } while (0)
  11882. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  11883. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  11884. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  11885. do { \
  11886. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  11887. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  11888. } while (0)
  11889. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  11890. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  11891. #define HTT_RX_DELBA_BYTES 4
  11892. /**
  11893. * @brief tx queue group information element definition
  11894. *
  11895. * @details
  11896. * The following diagram shows the format of the tx queue group
  11897. * information element, which can be included in target --> host
  11898. * messages to specify the number of tx "credits" (tx descriptors
  11899. * for LL, or tx buffers for HL) available to a particular group
  11900. * of host-side tx queues, and which host-side tx queues belong to
  11901. * the group.
  11902. *
  11903. * |31|30 24|23 16|15|14|13 0|
  11904. * |------------------------------------------------------------------------|
  11905. * | X| reserved | tx queue grp ID | A| S| credit count |
  11906. * |------------------------------------------------------------------------|
  11907. * | vdev ID mask | AC mask |
  11908. * |------------------------------------------------------------------------|
  11909. *
  11910. * The following definitions describe the fields within the tx queue group
  11911. * information element:
  11912. * - credit_count
  11913. * Bits 13:1
  11914. * Purpose: specify how many tx credits are available to the tx queue group
  11915. * Value: An absolute or relative, positive or negative credit value
  11916. * The 'A' bit specifies whether the value is absolute or relative.
  11917. * The 'S' bit specifies whether the value is positive or negative.
  11918. * A negative value can only be relative, not absolute.
  11919. * An absolute value replaces any prior credit value the host has for
  11920. * the tx queue group in question.
  11921. * A relative value is added to the prior credit value the host has for
  11922. * the tx queue group in question.
  11923. * - sign
  11924. * Bit 14
  11925. * Purpose: specify whether the credit count is positive or negative
  11926. * Value: 0 -> positive, 1 -> negative
  11927. * - absolute
  11928. * Bit 15
  11929. * Purpose: specify whether the credit count is absolute or relative
  11930. * Value: 0 -> relative, 1 -> absolute
  11931. * - txq_group_id
  11932. * Bits 23:16
  11933. * Purpose: indicate which tx queue group's credit and/or membership are
  11934. * being specified
  11935. * Value: 0 to max_tx_queue_groups-1
  11936. * - reserved
  11937. * Bits 30:16
  11938. * Value: 0x0
  11939. * - eXtension
  11940. * Bit 31
  11941. * Purpose: specify whether another tx queue group info element follows
  11942. * Value: 0 -> no more tx queue group information elements
  11943. * 1 -> another tx queue group information element immediately follows
  11944. * - ac_mask
  11945. * Bits 15:0
  11946. * Purpose: specify which Access Categories belong to the tx queue group
  11947. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  11948. * the tx queue group.
  11949. * The AC bit-mask values are obtained by left-shifting by the
  11950. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  11951. * - vdev_id_mask
  11952. * Bits 31:16
  11953. * Purpose: specify which vdev's tx queues belong to the tx queue group
  11954. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  11955. * belong to the tx queue group.
  11956. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  11957. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  11958. */
  11959. PREPACK struct htt_txq_group {
  11960. A_UINT32
  11961. credit_count: 14,
  11962. sign: 1,
  11963. absolute: 1,
  11964. tx_queue_group_id: 8,
  11965. reserved0: 7,
  11966. extension: 1;
  11967. A_UINT32
  11968. ac_mask: 16,
  11969. vdev_id_mask: 16;
  11970. } POSTPACK;
  11971. /* first word */
  11972. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  11973. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  11974. #define HTT_TXQ_GROUP_SIGN_S 14
  11975. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  11976. #define HTT_TXQ_GROUP_ABS_S 15
  11977. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  11978. #define HTT_TXQ_GROUP_ID_S 16
  11979. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  11980. #define HTT_TXQ_GROUP_EXT_S 31
  11981. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  11982. /* second word */
  11983. #define HTT_TXQ_GROUP_AC_MASK_S 0
  11984. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  11985. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  11986. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  11987. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  11988. do { \
  11989. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  11990. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  11991. } while (0)
  11992. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  11993. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  11994. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  11995. do { \
  11996. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  11997. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  11998. } while (0)
  11999. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  12000. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  12001. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12002. do { \
  12003. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12004. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12005. } while (0)
  12006. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12007. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12008. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12009. do { \
  12010. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12011. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12012. } while (0)
  12013. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12014. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12015. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12016. do { \
  12017. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12018. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12019. } while (0)
  12020. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12021. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12022. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12023. do { \
  12024. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12025. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12026. } while (0)
  12027. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12028. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12029. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12030. do { \
  12031. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12032. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12033. } while (0)
  12034. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12035. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12036. /**
  12037. * @brief target -> host TX completion indication message definition
  12038. *
  12039. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12040. *
  12041. * @details
  12042. * The following diagram shows the format of the TX completion indication sent
  12043. * from the target to the host
  12044. *
  12045. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12046. * |-------------------------------------------------------------------|
  12047. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12048. * |-------------------------------------------------------------------|
  12049. * payload:| MSDU1 ID | MSDU0 ID |
  12050. * |-------------------------------------------------------------------|
  12051. * : MSDU3 ID | MSDU2 ID :
  12052. * |-------------------------------------------------------------------|
  12053. * | struct htt_tx_compl_ind_append_retries |
  12054. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12055. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12056. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12057. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12058. * |-------------------------------------------------------------------|
  12059. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12060. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12061. * | MSDU0 tx_tsf64_low |
  12062. * |-------------------------------------------------------------------|
  12063. * | MSDU0 tx_tsf64_high |
  12064. * |-------------------------------------------------------------------|
  12065. * | MSDU1 tx_tsf64_low |
  12066. * |-------------------------------------------------------------------|
  12067. * | MSDU1 tx_tsf64_high |
  12068. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12069. * | phy_timestamp |
  12070. * |-------------------------------------------------------------------|
  12071. * | rate specs (see below) |
  12072. * |-------------------------------------------------------------------|
  12073. * | seqctrl | framectrl |
  12074. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12075. * Where:
  12076. * A0 = append (a.k.a. append0)
  12077. * A1 = append1
  12078. * TP = MSDU tx power presence
  12079. * A2 = append2
  12080. * A3 = append3
  12081. * A4 = append4
  12082. *
  12083. * The following field definitions describe the format of the TX completion
  12084. * indication sent from the target to the host
  12085. * Header fields:
  12086. * - msg_type
  12087. * Bits 7:0
  12088. * Purpose: identifies this as HTT TX completion indication
  12089. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12090. * - status
  12091. * Bits 10:8
  12092. * Purpose: the TX completion status of payload fragmentations descriptors
  12093. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12094. * - tid
  12095. * Bits 14:11
  12096. * Purpose: the tid associated with those fragmentation descriptors. It is
  12097. * valid or not, depending on the tid_invalid bit.
  12098. * Value: 0 to 15
  12099. * - tid_invalid
  12100. * Bits 15:15
  12101. * Purpose: this bit indicates whether the tid field is valid or not
  12102. * Value: 0 indicates valid; 1 indicates invalid
  12103. * - num
  12104. * Bits 23:16
  12105. * Purpose: the number of payload in this indication
  12106. * Value: 1 to 255
  12107. * - append (a.k.a. append0)
  12108. * Bits 24:24
  12109. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12110. * the number of tx retries for one MSDU at the end of this message
  12111. * Value: 0 indicates no appending; 1 indicates appending
  12112. * - append1
  12113. * Bits 25:25
  12114. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12115. * contains the timestamp info for each TX msdu id in payload.
  12116. * The order of the timestamps matches the order of the MSDU IDs.
  12117. * Note that a big-endian host needs to account for the reordering
  12118. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12119. * conversion) when determining which tx timestamp corresponds to
  12120. * which MSDU ID.
  12121. * Value: 0 indicates no appending; 1 indicates appending
  12122. * - msdu_tx_power_presence
  12123. * Bits 26:26
  12124. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12125. * for each MSDU referenced by the TX_COMPL_IND message.
  12126. * The tx power is reported in 0.5 dBm units.
  12127. * The order of the per-MSDU tx power reports matches the order
  12128. * of the MSDU IDs.
  12129. * Note that a big-endian host needs to account for the reordering
  12130. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12131. * conversion) when determining which Tx Power corresponds to
  12132. * which MSDU ID.
  12133. * Value: 0 indicates MSDU tx power reports are not appended,
  12134. * 1 indicates MSDU tx power reports are appended
  12135. * - append2
  12136. * Bits 27:27
  12137. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12138. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12139. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12140. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  12141. * for each MSDU, for convenience.
  12142. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12143. * this append2 bit is set).
  12144. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12145. * dB above the noise floor.
  12146. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12147. * 1 indicates MSDU ACK RSSI values are appended.
  12148. * - append3
  12149. * Bits 28:28
  12150. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12151. * contains the tx tsf info based on wlan global TSF for
  12152. * each TX msdu id in payload.
  12153. * The order of the tx tsf matches the order of the MSDU IDs.
  12154. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12155. * values to indicate the the lower 32 bits and higher 32 bits of
  12156. * the tx tsf.
  12157. * The tx_tsf64 here represents the time MSDU was acked and the
  12158. * tx_tsf64 has microseconds units.
  12159. * Value: 0 indicates no appending; 1 indicates appending
  12160. * - append4
  12161. * Bits 29:29
  12162. * Purpose: Indicate whether data frame control fields and fields required
  12163. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12164. * message. The order of the this message matches the order of
  12165. * the MSDU IDs.
  12166. * Value: 0 indicates frame control fields and fields required for
  12167. * radio tap header values are not appended,
  12168. * 1 indicates frame control fields and fields required for
  12169. * radio tap header values are appended.
  12170. * Payload fields:
  12171. * - hmsdu_id
  12172. * Bits 15:0
  12173. * Purpose: this ID is used to track the Tx buffer in host
  12174. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12175. */
  12176. PREPACK struct htt_tx_data_hdr_information {
  12177. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12178. A_UINT32 /* word 1 */
  12179. /* preamble:
  12180. * 0-OFDM,
  12181. * 1-CCk,
  12182. * 2-HT,
  12183. * 3-VHT
  12184. */
  12185. preamble: 2, /* [1:0] */
  12186. /* mcs:
  12187. * In case of HT preamble interpret
  12188. * MCS along with NSS.
  12189. * Valid values for HT are 0 to 7.
  12190. * HT mcs 0 with NSS 2 is mcs 8.
  12191. * Valid values for VHT are 0 to 9.
  12192. */
  12193. mcs: 4, /* [5:2] */
  12194. /* rate:
  12195. * This is applicable only for
  12196. * CCK and OFDM preamble type
  12197. * rate 0: OFDM 48 Mbps,
  12198. * 1: OFDM 24 Mbps,
  12199. * 2: OFDM 12 Mbps
  12200. * 3: OFDM 6 Mbps
  12201. * 4: OFDM 54 Mbps
  12202. * 5: OFDM 36 Mbps
  12203. * 6: OFDM 18 Mbps
  12204. * 7: OFDM 9 Mbps
  12205. * rate 0: CCK 11 Mbps Long
  12206. * 1: CCK 5.5 Mbps Long
  12207. * 2: CCK 2 Mbps Long
  12208. * 3: CCK 1 Mbps Long
  12209. * 4: CCK 11 Mbps Short
  12210. * 5: CCK 5.5 Mbps Short
  12211. * 6: CCK 2 Mbps Short
  12212. */
  12213. rate : 3, /* [ 8: 6] */
  12214. rssi : 8, /* [16: 9] units=dBm */
  12215. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12216. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12217. stbc : 1, /* [22] */
  12218. sgi : 1, /* [23] */
  12219. ldpc : 1, /* [24] */
  12220. beamformed: 1, /* [25] */
  12221. /* tx_retry_cnt:
  12222. * Indicates retry count of data tx frames provided by the host.
  12223. */
  12224. tx_retry_cnt: 6; /* [31:26] */
  12225. A_UINT32 /* word 2 */
  12226. framectrl:16, /* [15: 0] */
  12227. seqno:16; /* [31:16] */
  12228. } POSTPACK;
  12229. #define HTT_TX_COMPL_IND_STATUS_S 8
  12230. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12231. #define HTT_TX_COMPL_IND_TID_S 11
  12232. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12233. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12234. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12235. #define HTT_TX_COMPL_IND_NUM_S 16
  12236. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12237. #define HTT_TX_COMPL_IND_APPEND_S 24
  12238. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12239. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12240. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12241. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12242. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12243. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12244. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12245. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12246. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12247. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12248. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12249. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12250. do { \
  12251. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12252. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12253. } while (0)
  12254. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12255. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12256. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12257. do { \
  12258. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12259. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12260. } while (0)
  12261. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12262. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12263. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12264. do { \
  12265. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12266. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12267. } while (0)
  12268. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12269. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12270. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12271. do { \
  12272. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12273. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12274. } while (0)
  12275. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12276. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12277. HTT_TX_COMPL_IND_TID_INV_S)
  12278. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12279. do { \
  12280. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12281. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12282. } while (0)
  12283. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12284. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12285. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12286. do { \
  12287. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12288. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12289. } while (0)
  12290. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12291. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12292. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12293. do { \
  12294. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12295. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12296. } while (0)
  12297. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12298. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12299. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12300. do { \
  12301. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12302. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12303. } while (0)
  12304. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12305. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12306. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12307. do { \
  12308. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12309. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12310. } while (0)
  12311. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12312. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12313. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12314. do { \
  12315. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12316. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12317. } while (0)
  12318. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12319. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12320. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12321. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12322. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12323. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12324. #define HTT_TX_COMPL_IND_STAT_OK 0
  12325. /* DISCARD:
  12326. * current meaning:
  12327. * MSDUs were queued for transmission but filtered by HW or SW
  12328. * without any over the air attempts
  12329. * legacy meaning (HL Rome):
  12330. * MSDUs were discarded by the target FW without any over the air
  12331. * attempts due to lack of space
  12332. */
  12333. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12334. /* NO_ACK:
  12335. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12336. */
  12337. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12338. /* POSTPONE:
  12339. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12340. * be downloaded again later (in the appropriate order), when they are
  12341. * deliverable.
  12342. */
  12343. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12344. /*
  12345. * The PEER_DEL tx completion status is used for HL cases
  12346. * where the peer the frame is for has been deleted.
  12347. * The host has already discarded its copy of the frame, but
  12348. * it still needs the tx completion to restore its credit.
  12349. */
  12350. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12351. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12352. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12353. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12354. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12355. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12356. PREPACK struct htt_tx_compl_ind_base {
  12357. A_UINT32 hdr;
  12358. A_UINT16 payload[1/*or more*/];
  12359. } POSTPACK;
  12360. PREPACK struct htt_tx_compl_ind_append_retries {
  12361. A_UINT16 msdu_id;
  12362. A_UINT8 tx_retries;
  12363. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12364. 0: this is the last append_retries struct */
  12365. } POSTPACK;
  12366. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12367. A_UINT32 timestamp[1/*or more*/];
  12368. } POSTPACK;
  12369. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12370. A_UINT32 tx_tsf64_low;
  12371. A_UINT32 tx_tsf64_high;
  12372. } POSTPACK;
  12373. /* htt_tx_data_hdr_information payload extension fields: */
  12374. /* DWORD zero */
  12375. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12376. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12377. /* DWORD one */
  12378. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12379. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12380. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12381. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12382. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12383. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12384. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12385. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12386. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12387. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12388. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12389. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12390. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12391. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12392. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12393. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12394. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12395. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12396. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12397. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12398. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12399. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12400. /* DWORD two */
  12401. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12402. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12403. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12404. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12405. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12406. do { \
  12407. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12408. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12409. } while (0)
  12410. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12411. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12412. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12413. do { \
  12414. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12415. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12416. } while (0)
  12417. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12418. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12419. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12420. do { \
  12421. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12422. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12423. } while (0)
  12424. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12425. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12426. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12427. do { \
  12428. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12429. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12430. } while (0)
  12431. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12432. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12433. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12434. do { \
  12435. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12436. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12437. } while (0)
  12438. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12439. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12440. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12441. do { \
  12442. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12443. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12444. } while (0)
  12445. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12446. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12447. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12448. do { \
  12449. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12450. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12451. } while (0)
  12452. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12453. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12454. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12455. do { \
  12456. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12457. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12458. } while (0)
  12459. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12460. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12461. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12462. do { \
  12463. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12464. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12465. } while (0)
  12466. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12467. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12468. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12469. do { \
  12470. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12471. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12472. } while (0)
  12473. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12474. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12475. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12476. do { \
  12477. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12478. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12479. } while (0)
  12480. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12481. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12482. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12483. do { \
  12484. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12485. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12486. } while (0)
  12487. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12488. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12489. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12490. do { \
  12491. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12492. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12493. } while (0)
  12494. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12495. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12496. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12497. do { \
  12498. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12499. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12500. } while (0)
  12501. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12502. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12503. /**
  12504. * @brief target -> host rate-control update indication message
  12505. *
  12506. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12507. *
  12508. * @details
  12509. * The following diagram shows the format of the RC Update message
  12510. * sent from the target to the host, while processing the tx-completion
  12511. * of a transmitted PPDU.
  12512. *
  12513. * |31 24|23 16|15 8|7 0|
  12514. * |-------------------------------------------------------------|
  12515. * | peer ID | vdev ID | msg_type |
  12516. * |-------------------------------------------------------------|
  12517. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12518. * |-------------------------------------------------------------|
  12519. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12520. * |-------------------------------------------------------------|
  12521. * | : |
  12522. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12523. * | : |
  12524. * |-------------------------------------------------------------|
  12525. * | : |
  12526. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12527. * | : |
  12528. * |-------------------------------------------------------------|
  12529. * : :
  12530. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12531. *
  12532. */
  12533. typedef struct {
  12534. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12535. A_UINT32 rate_code_flags;
  12536. A_UINT32 flags; /* Encodes information such as excessive
  12537. retransmission, aggregate, some info
  12538. from .11 frame control,
  12539. STBC, LDPC, (SGI and Tx Chain Mask
  12540. are encoded in ptx_rc->flags field),
  12541. AMPDU truncation (BT/time based etc.),
  12542. RTS/CTS attempt */
  12543. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12544. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12545. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12546. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12547. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12548. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12549. } HTT_RC_TX_DONE_PARAMS;
  12550. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12551. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12552. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12553. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12554. #define HTT_RC_UPDATE_VDEVID_S 8
  12555. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12556. #define HTT_RC_UPDATE_PEERID_S 16
  12557. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12558. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12559. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12560. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12561. do { \
  12562. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12563. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12564. } while (0)
  12565. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12566. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12567. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12568. do { \
  12569. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12570. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12571. } while (0)
  12572. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12573. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12574. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12575. do { \
  12576. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12577. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12578. } while (0)
  12579. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12580. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12581. /**
  12582. * @brief target -> host rx fragment indication message definition
  12583. *
  12584. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12585. *
  12586. * @details
  12587. * The following field definitions describe the format of the rx fragment
  12588. * indication message sent from the target to the host.
  12589. * The rx fragment indication message shares the format of the
  12590. * rx indication message, but not all fields from the rx indication message
  12591. * are relevant to the rx fragment indication message.
  12592. *
  12593. *
  12594. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12595. * |-----------+-------------------+---------------------+-------------|
  12596. * | peer ID | |FV| ext TID | msg type |
  12597. * |-------------------------------------------------------------------|
  12598. * | | flush | flush |
  12599. * | | end | start |
  12600. * | | seq num | seq num |
  12601. * |-------------------------------------------------------------------|
  12602. * | reserved | FW rx desc bytes |
  12603. * |-------------------------------------------------------------------|
  12604. * | | FW MSDU Rx |
  12605. * | | desc B0 |
  12606. * |-------------------------------------------------------------------|
  12607. * Header fields:
  12608. * - MSG_TYPE
  12609. * Bits 7:0
  12610. * Purpose: identifies this as an rx fragment indication message
  12611. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12612. * - EXT_TID
  12613. * Bits 12:8
  12614. * Purpose: identify the traffic ID of the rx data, including
  12615. * special "extended" TID values for multicast, broadcast, and
  12616. * non-QoS data frames
  12617. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12618. * - FLUSH_VALID (FV)
  12619. * Bit 13
  12620. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12621. * is valid
  12622. * Value:
  12623. * 1 -> flush IE is valid and needs to be processed
  12624. * 0 -> flush IE is not valid and should be ignored
  12625. * - PEER_ID
  12626. * Bits 31:16
  12627. * Purpose: Identify, by ID, which peer sent the rx data
  12628. * Value: ID of the peer who sent the rx data
  12629. * - FLUSH_SEQ_NUM_START
  12630. * Bits 5:0
  12631. * Purpose: Indicate the start of a series of MPDUs to flush
  12632. * Not all MPDUs within this series are necessarily valid - the host
  12633. * must check each sequence number within this range to see if the
  12634. * corresponding MPDU is actually present.
  12635. * This field is only valid if the FV bit is set.
  12636. * Value:
  12637. * The sequence number for the first MPDUs to check to flush.
  12638. * The sequence number is masked by 0x3f.
  12639. * - FLUSH_SEQ_NUM_END
  12640. * Bits 11:6
  12641. * Purpose: Indicate the end of a series of MPDUs to flush
  12642. * Value:
  12643. * The sequence number one larger than the sequence number of the
  12644. * last MPDU to check to flush.
  12645. * The sequence number is masked by 0x3f.
  12646. * Not all MPDUs within this series are necessarily valid - the host
  12647. * must check each sequence number within this range to see if the
  12648. * corresponding MPDU is actually present.
  12649. * This field is only valid if the FV bit is set.
  12650. * Rx descriptor fields:
  12651. * - FW_RX_DESC_BYTES
  12652. * Bits 15:0
  12653. * Purpose: Indicate how many bytes in the Rx indication are used for
  12654. * FW Rx descriptors
  12655. * Value: 1
  12656. */
  12657. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  12658. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  12659. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  12660. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  12661. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  12662. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  12663. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  12664. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  12665. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  12666. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  12667. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  12668. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  12669. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  12670. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  12671. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  12672. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  12673. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  12674. #define HTT_RX_FRAG_IND_BYTES \
  12675. (4 /* msg hdr */ + \
  12676. 4 /* flush spec */ + \
  12677. 4 /* (unused) FW rx desc bytes spec */ + \
  12678. 4 /* FW rx desc */)
  12679. /**
  12680. * @brief target -> host test message definition
  12681. *
  12682. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  12683. *
  12684. * @details
  12685. * The following field definitions describe the format of the test
  12686. * message sent from the target to the host.
  12687. * The message consists of a 4-octet header, followed by a variable
  12688. * number of 32-bit integer values, followed by a variable number
  12689. * of 8-bit character values.
  12690. *
  12691. * |31 16|15 8|7 0|
  12692. * |-----------------------------------------------------------|
  12693. * | num chars | num ints | msg type |
  12694. * |-----------------------------------------------------------|
  12695. * | int 0 |
  12696. * |-----------------------------------------------------------|
  12697. * | int 1 |
  12698. * |-----------------------------------------------------------|
  12699. * | ... |
  12700. * |-----------------------------------------------------------|
  12701. * | char 3 | char 2 | char 1 | char 0 |
  12702. * |-----------------------------------------------------------|
  12703. * | | | ... | char 4 |
  12704. * |-----------------------------------------------------------|
  12705. * - MSG_TYPE
  12706. * Bits 7:0
  12707. * Purpose: identifies this as a test message
  12708. * Value: HTT_MSG_TYPE_TEST
  12709. * - NUM_INTS
  12710. * Bits 15:8
  12711. * Purpose: indicate how many 32-bit integers follow the message header
  12712. * - NUM_CHARS
  12713. * Bits 31:16
  12714. * Purpose: indicate how many 8-bit charaters follow the series of integers
  12715. */
  12716. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  12717. #define HTT_RX_TEST_NUM_INTS_S 8
  12718. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  12719. #define HTT_RX_TEST_NUM_CHARS_S 16
  12720. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  12721. do { \
  12722. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  12723. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  12724. } while (0)
  12725. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  12726. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  12727. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  12728. do { \
  12729. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  12730. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  12731. } while (0)
  12732. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  12733. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  12734. /**
  12735. * @brief target -> host packet log message
  12736. *
  12737. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  12738. *
  12739. * @details
  12740. * The following field definitions describe the format of the packet log
  12741. * message sent from the target to the host.
  12742. * The message consists of a 4-octet header,followed by a variable number
  12743. * of 32-bit character values.
  12744. *
  12745. * |31 16|15 12|11 10|9 8|7 0|
  12746. * |------------------------------------------------------------------|
  12747. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  12748. * |------------------------------------------------------------------|
  12749. * | payload |
  12750. * |------------------------------------------------------------------|
  12751. * - MSG_TYPE
  12752. * Bits 7:0
  12753. * Purpose: identifies this as a pktlog message
  12754. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  12755. * - mac_id
  12756. * Bits 9:8
  12757. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  12758. * Value: 0-3
  12759. * - pdev_id
  12760. * Bits 11:10
  12761. * Purpose: pdev_id
  12762. * Value: 0-3
  12763. * 0 (for rings at SOC level),
  12764. * 1/2/3 PDEV -> 0/1/2
  12765. * - payload_size
  12766. * Bits 31:16
  12767. * Purpose: explicitly specify the payload size
  12768. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  12769. */
  12770. PREPACK struct htt_pktlog_msg {
  12771. A_UINT32 header;
  12772. A_UINT32 payload[1/* or more */];
  12773. } POSTPACK;
  12774. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  12775. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  12776. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  12777. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  12778. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  12779. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  12780. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  12781. do { \
  12782. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  12783. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  12784. } while (0)
  12785. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  12786. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  12787. HTT_T2H_PKTLOG_MAC_ID_S)
  12788. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  12789. do { \
  12790. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  12791. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  12792. } while (0)
  12793. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  12794. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  12795. HTT_T2H_PKTLOG_PDEV_ID_S)
  12796. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  12797. do { \
  12798. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  12799. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  12800. } while (0)
  12801. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  12802. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  12803. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  12804. /*
  12805. * Rx reorder statistics
  12806. * NB: all the fields must be defined in 4 octets size.
  12807. */
  12808. struct rx_reorder_stats {
  12809. /* Non QoS MPDUs received */
  12810. A_UINT32 deliver_non_qos;
  12811. /* MPDUs received in-order */
  12812. A_UINT32 deliver_in_order;
  12813. /* Flush due to reorder timer expired */
  12814. A_UINT32 deliver_flush_timeout;
  12815. /* Flush due to move out of window */
  12816. A_UINT32 deliver_flush_oow;
  12817. /* Flush due to DELBA */
  12818. A_UINT32 deliver_flush_delba;
  12819. /* MPDUs dropped due to FCS error */
  12820. A_UINT32 fcs_error;
  12821. /* MPDUs dropped due to monitor mode non-data packet */
  12822. A_UINT32 mgmt_ctrl;
  12823. /* Unicast-data MPDUs dropped due to invalid peer */
  12824. A_UINT32 invalid_peer;
  12825. /* MPDUs dropped due to duplication (non aggregation) */
  12826. A_UINT32 dup_non_aggr;
  12827. /* MPDUs dropped due to processed before */
  12828. A_UINT32 dup_past;
  12829. /* MPDUs dropped due to duplicate in reorder queue */
  12830. A_UINT32 dup_in_reorder;
  12831. /* Reorder timeout happened */
  12832. A_UINT32 reorder_timeout;
  12833. /* invalid bar ssn */
  12834. A_UINT32 invalid_bar_ssn;
  12835. /* reorder reset due to bar ssn */
  12836. A_UINT32 ssn_reset;
  12837. /* Flush due to delete peer */
  12838. A_UINT32 deliver_flush_delpeer;
  12839. /* Flush due to offload*/
  12840. A_UINT32 deliver_flush_offload;
  12841. /* Flush due to out of buffer*/
  12842. A_UINT32 deliver_flush_oob;
  12843. /* MPDUs dropped due to PN check fail */
  12844. A_UINT32 pn_fail;
  12845. /* MPDUs dropped due to unable to allocate memory */
  12846. A_UINT32 store_fail;
  12847. /* Number of times the tid pool alloc succeeded */
  12848. A_UINT32 tid_pool_alloc_succ;
  12849. /* Number of times the MPDU pool alloc succeeded */
  12850. A_UINT32 mpdu_pool_alloc_succ;
  12851. /* Number of times the MSDU pool alloc succeeded */
  12852. A_UINT32 msdu_pool_alloc_succ;
  12853. /* Number of times the tid pool alloc failed */
  12854. A_UINT32 tid_pool_alloc_fail;
  12855. /* Number of times the MPDU pool alloc failed */
  12856. A_UINT32 mpdu_pool_alloc_fail;
  12857. /* Number of times the MSDU pool alloc failed */
  12858. A_UINT32 msdu_pool_alloc_fail;
  12859. /* Number of times the tid pool freed */
  12860. A_UINT32 tid_pool_free;
  12861. /* Number of times the MPDU pool freed */
  12862. A_UINT32 mpdu_pool_free;
  12863. /* Number of times the MSDU pool freed */
  12864. A_UINT32 msdu_pool_free;
  12865. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  12866. A_UINT32 msdu_queued;
  12867. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  12868. A_UINT32 msdu_recycled;
  12869. /* Number of MPDUs with invalid peer but A2 found in AST */
  12870. A_UINT32 invalid_peer_a2_in_ast;
  12871. /* Number of MPDUs with invalid peer but A3 found in AST */
  12872. A_UINT32 invalid_peer_a3_in_ast;
  12873. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  12874. A_UINT32 invalid_peer_bmc_mpdus;
  12875. /* Number of MSDUs with err attention word */
  12876. A_UINT32 rxdesc_err_att;
  12877. /* Number of MSDUs with flag of peer_idx_invalid */
  12878. A_UINT32 rxdesc_err_peer_idx_inv;
  12879. /* Number of MSDUs with flag of peer_idx_timeout */
  12880. A_UINT32 rxdesc_err_peer_idx_to;
  12881. /* Number of MSDUs with flag of overflow */
  12882. A_UINT32 rxdesc_err_ov;
  12883. /* Number of MSDUs with flag of msdu_length_err */
  12884. A_UINT32 rxdesc_err_msdu_len;
  12885. /* Number of MSDUs with flag of mpdu_length_err */
  12886. A_UINT32 rxdesc_err_mpdu_len;
  12887. /* Number of MSDUs with flag of tkip_mic_err */
  12888. A_UINT32 rxdesc_err_tkip_mic;
  12889. /* Number of MSDUs with flag of decrypt_err */
  12890. A_UINT32 rxdesc_err_decrypt;
  12891. /* Number of MSDUs with flag of fcs_err */
  12892. A_UINT32 rxdesc_err_fcs;
  12893. /* Number of Unicast (bc_mc bit is not set in attention word)
  12894. * frames with invalid peer handler
  12895. */
  12896. A_UINT32 rxdesc_uc_msdus_inv_peer;
  12897. /* Number of unicast frame directly (direct bit is set in attention word)
  12898. * to DUT with invalid peer handler
  12899. */
  12900. A_UINT32 rxdesc_direct_msdus_inv_peer;
  12901. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  12902. * frames with invalid peer handler
  12903. */
  12904. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  12905. /* Number of MSDUs dropped due to no first MSDU flag */
  12906. A_UINT32 rxdesc_no_1st_msdu;
  12907. /* Number of MSDUs droped due to ring overflow */
  12908. A_UINT32 msdu_drop_ring_ov;
  12909. /* Number of MSDUs dropped due to FC mismatch */
  12910. A_UINT32 msdu_drop_fc_mismatch;
  12911. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  12912. A_UINT32 msdu_drop_mgmt_remote_ring;
  12913. /* Number of MSDUs dropped due to errors not reported in attention word */
  12914. A_UINT32 msdu_drop_misc;
  12915. /* Number of MSDUs go to offload before reorder */
  12916. A_UINT32 offload_msdu_wal;
  12917. /* Number of data frame dropped by offload after reorder */
  12918. A_UINT32 offload_msdu_reorder;
  12919. /* Number of MPDUs with sequence number in the past and within the BA window */
  12920. A_UINT32 dup_past_within_window;
  12921. /* Number of MPDUs with sequence number in the past and outside the BA window */
  12922. A_UINT32 dup_past_outside_window;
  12923. /* Number of MSDUs with decrypt/MIC error */
  12924. A_UINT32 rxdesc_err_decrypt_mic;
  12925. /* Number of data MSDUs received on both local and remote rings */
  12926. A_UINT32 data_msdus_on_both_rings;
  12927. /* MPDUs never filled */
  12928. A_UINT32 holes_not_filled;
  12929. };
  12930. /*
  12931. * Rx Remote buffer statistics
  12932. * NB: all the fields must be defined in 4 octets size.
  12933. */
  12934. struct rx_remote_buffer_mgmt_stats {
  12935. /* Total number of MSDUs reaped for Rx processing */
  12936. A_UINT32 remote_reaped;
  12937. /* MSDUs recycled within firmware */
  12938. A_UINT32 remote_recycled;
  12939. /* MSDUs stored by Data Rx */
  12940. A_UINT32 data_rx_msdus_stored;
  12941. /* Number of HTT indications from WAL Rx MSDU */
  12942. A_UINT32 wal_rx_ind;
  12943. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  12944. A_UINT32 wal_rx_ind_unconsumed;
  12945. /* Number of HTT indications from Data Rx MSDU */
  12946. A_UINT32 data_rx_ind;
  12947. /* Number of unconsumed HTT indications from Data Rx MSDU */
  12948. A_UINT32 data_rx_ind_unconsumed;
  12949. /* Number of HTT indications from ATHBUF */
  12950. A_UINT32 athbuf_rx_ind;
  12951. /* Number of remote buffers requested for refill */
  12952. A_UINT32 refill_buf_req;
  12953. /* Number of remote buffers filled by the host */
  12954. A_UINT32 refill_buf_rsp;
  12955. /* Number of times MAC hw_index = f/w write_index */
  12956. A_INT32 mac_no_bufs;
  12957. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  12958. A_INT32 fw_indices_equal;
  12959. /* Number of times f/w finds no buffers to post */
  12960. A_INT32 host_no_bufs;
  12961. };
  12962. /*
  12963. * TXBF MU/SU packets and NDPA statistics
  12964. * NB: all the fields must be defined in 4 octets size.
  12965. */
  12966. struct rx_txbf_musu_ndpa_pkts_stats {
  12967. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  12968. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  12969. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  12970. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  12971. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  12972. A_UINT32 reserved[3]; /* must be set to 0x0 */
  12973. };
  12974. /*
  12975. * htt_dbg_stats_status -
  12976. * present - The requested stats have been delivered in full.
  12977. * This indicates that either the stats information was contained
  12978. * in its entirety within this message, or else this message
  12979. * completes the delivery of the requested stats info that was
  12980. * partially delivered through earlier STATS_CONF messages.
  12981. * partial - The requested stats have been delivered in part.
  12982. * One or more subsequent STATS_CONF messages with the same
  12983. * cookie value will be sent to deliver the remainder of the
  12984. * information.
  12985. * error - The requested stats could not be delivered, for example due
  12986. * to a shortage of memory to construct a message holding the
  12987. * requested stats.
  12988. * invalid - The requested stat type is either not recognized, or the
  12989. * target is configured to not gather the stats type in question.
  12990. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12991. * series_done - This special value indicates that no further stats info
  12992. * elements are present within a series of stats info elems
  12993. * (within a stats upload confirmation message).
  12994. */
  12995. enum htt_dbg_stats_status {
  12996. HTT_DBG_STATS_STATUS_PRESENT = 0,
  12997. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  12998. HTT_DBG_STATS_STATUS_ERROR = 2,
  12999. HTT_DBG_STATS_STATUS_INVALID = 3,
  13000. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  13001. };
  13002. /**
  13003. * @brief target -> host statistics upload
  13004. *
  13005. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13006. *
  13007. * @details
  13008. * The following field definitions describe the format of the HTT target
  13009. * to host stats upload confirmation message.
  13010. * The message contains a cookie echoed from the HTT host->target stats
  13011. * upload request, which identifies which request the confirmation is
  13012. * for, and a series of tag-length-value stats information elements.
  13013. * The tag-length header for each stats info element also includes a
  13014. * status field, to indicate whether the request for the stat type in
  13015. * question was fully met, partially met, unable to be met, or invalid
  13016. * (if the stat type in question is disabled in the target).
  13017. * A special value of all 1's in this status field is used to indicate
  13018. * the end of the series of stats info elements.
  13019. *
  13020. *
  13021. * |31 16|15 8|7 5|4 0|
  13022. * |------------------------------------------------------------|
  13023. * | reserved | msg type |
  13024. * |------------------------------------------------------------|
  13025. * | cookie LSBs |
  13026. * |------------------------------------------------------------|
  13027. * | cookie MSBs |
  13028. * |------------------------------------------------------------|
  13029. * | stats entry length | reserved | S |stat type|
  13030. * |------------------------------------------------------------|
  13031. * | |
  13032. * | type-specific stats info |
  13033. * | |
  13034. * |------------------------------------------------------------|
  13035. * | stats entry length | reserved | S |stat type|
  13036. * |------------------------------------------------------------|
  13037. * | |
  13038. * | type-specific stats info |
  13039. * | |
  13040. * |------------------------------------------------------------|
  13041. * | n/a | reserved | 111 | n/a |
  13042. * |------------------------------------------------------------|
  13043. * Header fields:
  13044. * - MSG_TYPE
  13045. * Bits 7:0
  13046. * Purpose: identifies this is a statistics upload confirmation message
  13047. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13048. * - COOKIE_LSBS
  13049. * Bits 31:0
  13050. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13051. * message with its preceding host->target stats request message.
  13052. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13053. * - COOKIE_MSBS
  13054. * Bits 31:0
  13055. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13056. * message with its preceding host->target stats request message.
  13057. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13058. *
  13059. * Stats Information Element tag-length header fields:
  13060. * - STAT_TYPE
  13061. * Bits 4:0
  13062. * Purpose: identifies the type of statistics info held in the
  13063. * following information element
  13064. * Value: htt_dbg_stats_type
  13065. * - STATUS
  13066. * Bits 7:5
  13067. * Purpose: indicate whether the requested stats are present
  13068. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13069. * the completion of the stats entry series
  13070. * - LENGTH
  13071. * Bits 31:16
  13072. * Purpose: indicate the stats information size
  13073. * Value: This field specifies the number of bytes of stats information
  13074. * that follows the element tag-length header.
  13075. * It is expected but not required that this length is a multiple of
  13076. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13077. * subsequent stats entry header will begin on a 4-byte aligned
  13078. * boundary.
  13079. */
  13080. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13081. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13082. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13083. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13084. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13085. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13086. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13087. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13088. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13089. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13090. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13091. do { \
  13092. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13093. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13094. } while (0)
  13095. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13096. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13097. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13098. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13099. do { \
  13100. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13101. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13102. } while (0)
  13103. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13104. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13105. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13106. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13107. do { \
  13108. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13109. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13110. } while (0)
  13111. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13112. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13113. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13114. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13115. #define HTT_MAX_AGGR 64
  13116. #define HTT_HL_MAX_AGGR 18
  13117. /**
  13118. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13119. *
  13120. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13121. *
  13122. * @details
  13123. * The following field definitions describe the format of the HTT host
  13124. * to target frag_desc/msdu_ext bank configuration message.
  13125. * The message contains the based address and the min and max id of the
  13126. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13127. * MSDU_EXT/FRAG_DESC.
  13128. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13129. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13130. * the hardware does the mapping/translation.
  13131. *
  13132. * Total banks that can be configured is configured to 16.
  13133. *
  13134. * This should be called before any TX has be initiated by the HTT
  13135. *
  13136. * |31 16|15 8|7 5|4 0|
  13137. * |------------------------------------------------------------|
  13138. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13139. * |------------------------------------------------------------|
  13140. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13141. #if HTT_PADDR64
  13142. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13143. #endif
  13144. * |------------------------------------------------------------|
  13145. * | ... |
  13146. * |------------------------------------------------------------|
  13147. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13148. #if HTT_PADDR64
  13149. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13150. #endif
  13151. * |------------------------------------------------------------|
  13152. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13153. * |------------------------------------------------------------|
  13154. * | ... |
  13155. * |------------------------------------------------------------|
  13156. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13157. * |------------------------------------------------------------|
  13158. * Header fields:
  13159. * - MSG_TYPE
  13160. * Bits 7:0
  13161. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13162. * for systems with 64-bit format for bus addresses:
  13163. * - BANKx_BASE_ADDRESS_LO
  13164. * Bits 31:0
  13165. * Purpose: Provide a mechanism to specify the base address of the
  13166. * MSDU_EXT bank physical/bus address.
  13167. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13168. * - BANKx_BASE_ADDRESS_HI
  13169. * Bits 31:0
  13170. * Purpose: Provide a mechanism to specify the base address of the
  13171. * MSDU_EXT bank physical/bus address.
  13172. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13173. * for systems with 32-bit format for bus addresses:
  13174. * - BANKx_BASE_ADDRESS
  13175. * Bits 31:0
  13176. * Purpose: Provide a mechanism to specify the base address of the
  13177. * MSDU_EXT bank physical/bus address.
  13178. * Value: MSDU_EXT bank physical / bus address
  13179. * - BANKx_MIN_ID
  13180. * Bits 15:0
  13181. * Purpose: Provide a mechanism to specify the min index that needs to
  13182. * mapped.
  13183. * - BANKx_MAX_ID
  13184. * Bits 31:16
  13185. * Purpose: Provide a mechanism to specify the max index that needs to
  13186. * mapped.
  13187. *
  13188. */
  13189. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13190. * safe value.
  13191. * @note MAX supported banks is 16.
  13192. */
  13193. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13194. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13195. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13196. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13197. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13198. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13199. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13200. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13201. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13202. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13203. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13204. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13205. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13206. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13207. do { \
  13208. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13209. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13210. } while (0)
  13211. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13212. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13213. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13214. do { \
  13215. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13216. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13217. } while (0)
  13218. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13219. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13220. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13221. do { \
  13222. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13223. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13224. } while (0)
  13225. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13226. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13227. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13228. do { \
  13229. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13230. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13231. } while (0)
  13232. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13233. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13234. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13235. do { \
  13236. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13237. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13238. } while (0)
  13239. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13240. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13241. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13242. do { \
  13243. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13244. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13245. } while (0)
  13246. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13247. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13248. /*
  13249. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13250. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13251. * addresses are stored in a XXX-bit field.
  13252. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13253. * htt_tx_frag_desc64_bank_cfg_t structs.
  13254. */
  13255. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13256. _paddr_bits_, \
  13257. _paddr__bank_base_address_) \
  13258. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13259. /** word 0 \
  13260. * msg_type: 8, \
  13261. * pdev_id: 2, \
  13262. * swap: 1, \
  13263. * reserved0: 5, \
  13264. * num_banks: 8, \
  13265. * desc_size: 8; \
  13266. */ \
  13267. A_UINT32 word0; \
  13268. /* \
  13269. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13270. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13271. * the second A_UINT32). \
  13272. */ \
  13273. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13274. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13275. } POSTPACK
  13276. /* define htt_tx_frag_desc32_bank_cfg_t */
  13277. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13278. /* define htt_tx_frag_desc64_bank_cfg_t */
  13279. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13280. /*
  13281. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13282. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13283. */
  13284. #if HTT_PADDR64
  13285. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13286. #else
  13287. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13288. #endif
  13289. /**
  13290. * @brief target -> host HTT TX Credit total count update message definition
  13291. *
  13292. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13293. *
  13294. *|31 16|15|14 9| 8 |7 0 |
  13295. *|---------------------+--+----------+-------+----------|
  13296. *|cur htt credit delta | Q| reserved | sign | msg type |
  13297. *|------------------------------------------------------|
  13298. *
  13299. * Header fields:
  13300. * - MSG_TYPE
  13301. * Bits 7:0
  13302. * Purpose: identifies this as a htt tx credit delta update message
  13303. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13304. * - SIGN
  13305. * Bits 8
  13306. * identifies whether credit delta is positive or negative
  13307. * Value:
  13308. * - 0x0: credit delta is positive, rebalance in some buffers
  13309. * - 0x1: credit delta is negative, rebalance out some buffers
  13310. * - reserved
  13311. * Bits 14:9
  13312. * Value: 0x0
  13313. * - TXQ_GRP
  13314. * Bit 15
  13315. * Purpose: indicates whether any tx queue group information elements
  13316. * are appended to the tx credit update message
  13317. * Value: 0 -> no tx queue group information element is present
  13318. * 1 -> a tx queue group information element immediately follows
  13319. * - DELTA_COUNT
  13320. * Bits 31:16
  13321. * Purpose: Specify current htt credit delta absolute count
  13322. */
  13323. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13324. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13325. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13326. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13327. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13328. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13329. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13330. do { \
  13331. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13332. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13333. } while (0)
  13334. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13335. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13336. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13337. do { \
  13338. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13339. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13340. } while (0)
  13341. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13342. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13343. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13344. do { \
  13345. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13346. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13347. } while (0)
  13348. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13349. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13350. #define HTT_TX_CREDIT_MSG_BYTES 4
  13351. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13352. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13353. /**
  13354. * @brief HTT WDI_IPA Operation Response Message
  13355. *
  13356. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13357. *
  13358. * @details
  13359. * HTT WDI_IPA Operation Response message is sent by target
  13360. * to host confirming suspend or resume operation.
  13361. * |31 24|23 16|15 8|7 0|
  13362. * |----------------+----------------+----------------+----------------|
  13363. * | op_code | Rsvd | msg_type |
  13364. * |-------------------------------------------------------------------|
  13365. * | Rsvd | Response len |
  13366. * |-------------------------------------------------------------------|
  13367. * | |
  13368. * | Response-type specific info |
  13369. * | |
  13370. * | |
  13371. * |-------------------------------------------------------------------|
  13372. * Header fields:
  13373. * - MSG_TYPE
  13374. * Bits 7:0
  13375. * Purpose: Identifies this as WDI_IPA Operation Response message
  13376. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13377. * - OP_CODE
  13378. * Bits 31:16
  13379. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13380. * value: = enum htt_wdi_ipa_op_code
  13381. * - RSP_LEN
  13382. * Bits 16:0
  13383. * Purpose: length for the response-type specific info
  13384. * value: = length in bytes for response-type specific info
  13385. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13386. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13387. */
  13388. PREPACK struct htt_wdi_ipa_op_response_t
  13389. {
  13390. /* DWORD 0: flags and meta-data */
  13391. A_UINT32
  13392. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13393. reserved1: 8,
  13394. op_code: 16;
  13395. A_UINT32
  13396. rsp_len: 16,
  13397. reserved2: 16;
  13398. } POSTPACK;
  13399. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13400. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13401. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13402. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13403. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13404. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13405. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13406. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13407. do { \
  13408. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13409. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13410. } while (0)
  13411. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13412. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13413. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13414. do { \
  13415. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13416. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13417. } while (0)
  13418. enum htt_phy_mode {
  13419. htt_phy_mode_11a = 0,
  13420. htt_phy_mode_11g = 1,
  13421. htt_phy_mode_11b = 2,
  13422. htt_phy_mode_11g_only = 3,
  13423. htt_phy_mode_11na_ht20 = 4,
  13424. htt_phy_mode_11ng_ht20 = 5,
  13425. htt_phy_mode_11na_ht40 = 6,
  13426. htt_phy_mode_11ng_ht40 = 7,
  13427. htt_phy_mode_11ac_vht20 = 8,
  13428. htt_phy_mode_11ac_vht40 = 9,
  13429. htt_phy_mode_11ac_vht80 = 10,
  13430. htt_phy_mode_11ac_vht20_2g = 11,
  13431. htt_phy_mode_11ac_vht40_2g = 12,
  13432. htt_phy_mode_11ac_vht80_2g = 13,
  13433. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13434. htt_phy_mode_11ac_vht160 = 15,
  13435. htt_phy_mode_max,
  13436. };
  13437. /**
  13438. * @brief target -> host HTT channel change indication
  13439. *
  13440. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13441. *
  13442. * @details
  13443. * Specify when a channel change occurs.
  13444. * This allows the host to precisely determine which rx frames arrived
  13445. * on the old channel and which rx frames arrived on the new channel.
  13446. *
  13447. *|31 |7 0 |
  13448. *|-------------------------------------------+----------|
  13449. *| reserved | msg type |
  13450. *|------------------------------------------------------|
  13451. *| primary_chan_center_freq_mhz |
  13452. *|------------------------------------------------------|
  13453. *| contiguous_chan1_center_freq_mhz |
  13454. *|------------------------------------------------------|
  13455. *| contiguous_chan2_center_freq_mhz |
  13456. *|------------------------------------------------------|
  13457. *| phy_mode |
  13458. *|------------------------------------------------------|
  13459. *
  13460. * Header fields:
  13461. * - MSG_TYPE
  13462. * Bits 7:0
  13463. * Purpose: identifies this as a htt channel change indication message
  13464. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13465. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13466. * Bits 31:0
  13467. * Purpose: identify the (center of the) new 20 MHz primary channel
  13468. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13469. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13470. * Bits 31:0
  13471. * Purpose: identify the (center of the) contiguous frequency range
  13472. * comprising the new channel.
  13473. * For example, if the new channel is a 80 MHz channel extending
  13474. * 60 MHz beyond the primary channel, this field would be 30 larger
  13475. * than the primary channel center frequency field.
  13476. * Value: center frequency of the contiguous frequency range comprising
  13477. * the full channel in MHz units
  13478. * (80+80 channels also use the CONTIG_CHAN2 field)
  13479. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13480. * Bits 31:0
  13481. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13482. * within a VHT 80+80 channel.
  13483. * This field is only relevant for VHT 80+80 channels.
  13484. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13485. * channel (arbitrary value for cases besides VHT 80+80)
  13486. * - PHY_MODE
  13487. * Bits 31:0
  13488. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13489. * and band
  13490. * Value: htt_phy_mode enum value
  13491. */
  13492. PREPACK struct htt_chan_change_t
  13493. {
  13494. /* DWORD 0: flags and meta-data */
  13495. A_UINT32
  13496. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13497. reserved1: 24;
  13498. A_UINT32 primary_chan_center_freq_mhz;
  13499. A_UINT32 contig_chan1_center_freq_mhz;
  13500. A_UINT32 contig_chan2_center_freq_mhz;
  13501. A_UINT32 phy_mode;
  13502. } POSTPACK;
  13503. /*
  13504. * Due to historical / backwards-compatibility reasons, maintain the
  13505. * below htt_chan_change_msg struct definition, which needs to be
  13506. * consistent with the above htt_chan_change_t struct definition
  13507. * (aside from the htt_chan_change_t definition including the msg_type
  13508. * dword within the message, and the htt_chan_change_msg only containing
  13509. * the payload of the message that follows the msg_type dword).
  13510. */
  13511. PREPACK struct htt_chan_change_msg {
  13512. A_UINT32 chan_mhz; /* frequency in mhz */
  13513. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13514. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13515. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13516. } POSTPACK;
  13517. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13518. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13519. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13520. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13521. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13522. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13523. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13524. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13525. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13526. do { \
  13527. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13528. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13529. } while (0)
  13530. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13531. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13532. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13533. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13534. do { \
  13535. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13536. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13537. } while (0)
  13538. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13539. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13540. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13541. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13542. do { \
  13543. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13544. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13545. } while (0)
  13546. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13547. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13548. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13549. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13550. do { \
  13551. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13552. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13553. } while (0)
  13554. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13555. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13556. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13557. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13558. /**
  13559. * @brief rx offload packet error message
  13560. *
  13561. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13562. *
  13563. * @details
  13564. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13565. * of target payload like mic err.
  13566. *
  13567. * |31 24|23 16|15 8|7 0|
  13568. * |----------------+----------------+----------------+----------------|
  13569. * | tid | vdev_id | msg_sub_type | msg_type |
  13570. * |-------------------------------------------------------------------|
  13571. * : (sub-type dependent content) :
  13572. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13573. * Header fields:
  13574. * - msg_type
  13575. * Bits 7:0
  13576. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13577. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13578. * - msg_sub_type
  13579. * Bits 15:8
  13580. * Purpose: Identifies which type of rx error is reported by this message
  13581. * value: htt_rx_ofld_pkt_err_type
  13582. * - vdev_id
  13583. * Bits 23:16
  13584. * Purpose: Identifies which vdev received the erroneous rx frame
  13585. * value:
  13586. * - tid
  13587. * Bits 31:24
  13588. * Purpose: Identifies the traffic type of the rx frame
  13589. * value:
  13590. *
  13591. * - The payload fields used if the sub-type == MIC error are shown below.
  13592. * Note - MIC err is per MSDU, while PN is per MPDU.
  13593. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13594. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13595. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13596. * instead of sending separate HTT messages for each wrong MSDU within
  13597. * the MPDU.
  13598. *
  13599. * |31 24|23 16|15 8|7 0|
  13600. * |----------------+----------------+----------------+----------------|
  13601. * | Rsvd | key_id | peer_id |
  13602. * |-------------------------------------------------------------------|
  13603. * | receiver MAC addr 31:0 |
  13604. * |-------------------------------------------------------------------|
  13605. * | Rsvd | receiver MAC addr 47:32 |
  13606. * |-------------------------------------------------------------------|
  13607. * | transmitter MAC addr 31:0 |
  13608. * |-------------------------------------------------------------------|
  13609. * | Rsvd | transmitter MAC addr 47:32 |
  13610. * |-------------------------------------------------------------------|
  13611. * | PN 31:0 |
  13612. * |-------------------------------------------------------------------|
  13613. * | Rsvd | PN 47:32 |
  13614. * |-------------------------------------------------------------------|
  13615. * - peer_id
  13616. * Bits 15:0
  13617. * Purpose: identifies which peer is frame is from
  13618. * value:
  13619. * - key_id
  13620. * Bits 23:16
  13621. * Purpose: identifies key_id of rx frame
  13622. * value:
  13623. * - RA_31_0 (receiver MAC addr 31:0)
  13624. * Bits 31:0
  13625. * Purpose: identifies by MAC address which vdev received the frame
  13626. * value: MAC address lower 4 bytes
  13627. * - RA_47_32 (receiver MAC addr 47:32)
  13628. * Bits 15:0
  13629. * Purpose: identifies by MAC address which vdev received the frame
  13630. * value: MAC address upper 2 bytes
  13631. * - TA_31_0 (transmitter MAC addr 31:0)
  13632. * Bits 31:0
  13633. * Purpose: identifies by MAC address which peer transmitted the frame
  13634. * value: MAC address lower 4 bytes
  13635. * - TA_47_32 (transmitter MAC addr 47:32)
  13636. * Bits 15:0
  13637. * Purpose: identifies by MAC address which peer transmitted the frame
  13638. * value: MAC address upper 2 bytes
  13639. * - PN_31_0
  13640. * Bits 31:0
  13641. * Purpose: Identifies pn of rx frame
  13642. * value: PN lower 4 bytes
  13643. * - PN_47_32
  13644. * Bits 15:0
  13645. * Purpose: Identifies pn of rx frame
  13646. * value:
  13647. * TKIP or CCMP: PN upper 2 bytes
  13648. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  13649. */
  13650. enum htt_rx_ofld_pkt_err_type {
  13651. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  13652. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  13653. };
  13654. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  13655. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  13656. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  13657. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  13658. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  13659. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  13660. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  13661. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  13662. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  13663. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  13664. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  13665. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  13666. do { \
  13667. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  13668. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  13669. } while (0)
  13670. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  13671. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  13672. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  13673. do { \
  13674. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  13675. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  13676. } while (0)
  13677. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  13678. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  13679. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  13680. do { \
  13681. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  13682. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  13683. } while (0)
  13684. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  13685. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  13686. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  13687. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  13688. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  13689. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  13690. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  13691. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  13692. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  13693. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  13694. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  13695. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  13696. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  13697. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  13698. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  13699. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  13700. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  13701. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  13702. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  13703. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  13704. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  13705. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  13706. do { \
  13707. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  13708. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  13709. } while (0)
  13710. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  13711. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  13712. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  13713. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  13714. do { \
  13715. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  13716. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  13717. } while (0)
  13718. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  13719. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  13720. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  13721. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  13722. do { \
  13723. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  13724. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  13725. } while (0)
  13726. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  13727. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  13728. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  13729. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  13730. do { \
  13731. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  13732. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  13733. } while (0)
  13734. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  13735. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  13736. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  13737. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  13738. do { \
  13739. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  13740. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  13741. } while (0)
  13742. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  13743. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  13744. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  13745. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  13746. do { \
  13747. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  13748. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  13749. } while (0)
  13750. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  13751. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  13752. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  13753. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  13754. do { \
  13755. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  13756. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  13757. } while (0)
  13758. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  13759. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  13760. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  13761. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  13762. do { \
  13763. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  13764. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  13765. } while (0)
  13766. /**
  13767. * @brief target -> host peer rate report message
  13768. *
  13769. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  13770. *
  13771. * @details
  13772. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  13773. * justified rate of all the peers.
  13774. *
  13775. * |31 24|23 16|15 8|7 0|
  13776. * |----------------+----------------+----------------+----------------|
  13777. * | peer_count | | msg_type |
  13778. * |-------------------------------------------------------------------|
  13779. * : Payload (variant number of peer rate report) :
  13780. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13781. * Header fields:
  13782. * - msg_type
  13783. * Bits 7:0
  13784. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  13785. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  13786. * - reserved
  13787. * Bits 15:8
  13788. * Purpose:
  13789. * value:
  13790. * - peer_count
  13791. * Bits 31:16
  13792. * Purpose: Specify how many peer rate report elements are present in the payload.
  13793. * value:
  13794. *
  13795. * Payload:
  13796. * There are variant number of peer rate report follow the first 32 bits.
  13797. * The peer rate report is defined as follows.
  13798. *
  13799. * |31 20|19 16|15 0|
  13800. * |-----------------------+---------+---------------------------------|-
  13801. * | reserved | phy | peer_id | \
  13802. * |-------------------------------------------------------------------| -> report #0
  13803. * | rate | /
  13804. * |-----------------------+---------+---------------------------------|-
  13805. * | reserved | phy | peer_id | \
  13806. * |-------------------------------------------------------------------| -> report #1
  13807. * | rate | /
  13808. * |-----------------------+---------+---------------------------------|-
  13809. * | reserved | phy | peer_id | \
  13810. * |-------------------------------------------------------------------| -> report #2
  13811. * | rate | /
  13812. * |-------------------------------------------------------------------|-
  13813. * : :
  13814. * : :
  13815. * : :
  13816. * :-------------------------------------------------------------------:
  13817. *
  13818. * - peer_id
  13819. * Bits 15:0
  13820. * Purpose: identify the peer
  13821. * value:
  13822. * - phy
  13823. * Bits 19:16
  13824. * Purpose: identify which phy is in use
  13825. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  13826. * Please see enum htt_peer_report_phy_type for detail.
  13827. * - reserved
  13828. * Bits 31:20
  13829. * Purpose:
  13830. * value:
  13831. * - rate
  13832. * Bits 31:0
  13833. * Purpose: represent the justified rate of the peer specified by peer_id
  13834. * value:
  13835. */
  13836. enum htt_peer_rate_report_phy_type {
  13837. HTT_PEER_RATE_REPORT_11B = 0,
  13838. HTT_PEER_RATE_REPORT_11A_G,
  13839. HTT_PEER_RATE_REPORT_11N,
  13840. HTT_PEER_RATE_REPORT_11AC,
  13841. };
  13842. #define HTT_PEER_RATE_REPORT_SIZE 8
  13843. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  13844. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  13845. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  13846. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  13847. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  13848. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  13849. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  13850. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  13851. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  13852. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  13853. do { \
  13854. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  13855. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  13856. } while (0)
  13857. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  13858. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  13859. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  13860. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  13861. do { \
  13862. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  13863. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  13864. } while (0)
  13865. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  13866. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  13867. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  13868. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  13869. do { \
  13870. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  13871. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  13872. } while (0)
  13873. /**
  13874. * @brief target -> host flow pool map message
  13875. *
  13876. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  13877. *
  13878. * @details
  13879. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  13880. * a flow of descriptors.
  13881. *
  13882. * This message is in TLV format and indicates the parameters to be setup a
  13883. * flow in the host. Each entry indicates that a particular flow ID is ready to
  13884. * receive descriptors from a specified pool.
  13885. *
  13886. * The message would appear as follows:
  13887. *
  13888. * |31 24|23 16|15 8|7 0|
  13889. * |----------------+----------------+----------------+----------------|
  13890. * header | reserved | num_flows | msg_type |
  13891. * |-------------------------------------------------------------------|
  13892. * | |
  13893. * : payload :
  13894. * | |
  13895. * |-------------------------------------------------------------------|
  13896. *
  13897. * The header field is one DWORD long and is interpreted as follows:
  13898. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  13899. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  13900. * this message
  13901. * b'16-31 - reserved: These bits are reserved for future use
  13902. *
  13903. * Payload:
  13904. * The payload would contain multiple objects of the following structure. Each
  13905. * object represents a flow.
  13906. *
  13907. * |31 24|23 16|15 8|7 0|
  13908. * |----------------+----------------+----------------+----------------|
  13909. * header | reserved | num_flows | msg_type |
  13910. * |-------------------------------------------------------------------|
  13911. * payload0| flow_type |
  13912. * |-------------------------------------------------------------------|
  13913. * | flow_id |
  13914. * |-------------------------------------------------------------------|
  13915. * | reserved0 | flow_pool_id |
  13916. * |-------------------------------------------------------------------|
  13917. * | reserved1 | flow_pool_size |
  13918. * |-------------------------------------------------------------------|
  13919. * | reserved2 |
  13920. * |-------------------------------------------------------------------|
  13921. * payload1| flow_type |
  13922. * |-------------------------------------------------------------------|
  13923. * | flow_id |
  13924. * |-------------------------------------------------------------------|
  13925. * | reserved0 | flow_pool_id |
  13926. * |-------------------------------------------------------------------|
  13927. * | reserved1 | flow_pool_size |
  13928. * |-------------------------------------------------------------------|
  13929. * | reserved2 |
  13930. * |-------------------------------------------------------------------|
  13931. * | . |
  13932. * | . |
  13933. * | . |
  13934. * |-------------------------------------------------------------------|
  13935. *
  13936. * Each payload is 5 DWORDS long and is interpreted as follows:
  13937. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  13938. * this flow is associated. It can be VDEV, peer,
  13939. * or tid (AC). Based on enum htt_flow_type.
  13940. *
  13941. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13942. * object. For flow_type vdev it is set to the
  13943. * vdevid, for peer it is peerid and for tid, it is
  13944. * tid_num.
  13945. *
  13946. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  13947. * in the host for this flow
  13948. * b'16:31 - reserved0: This field in reserved for the future. In case
  13949. * we have a hierarchical implementation (HCM) of
  13950. * pools, it can be used to indicate the ID of the
  13951. * parent-pool.
  13952. *
  13953. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  13954. * Descriptors for this flow will be
  13955. * allocated from this pool in the host.
  13956. * b'16:31 - reserved1: This field in reserved for the future. In case
  13957. * we have a hierarchical implementation of pools,
  13958. * it can be used to indicate the max number of
  13959. * descriptors in the pool. The b'0:15 can be used
  13960. * to indicate min number of descriptors in the
  13961. * HCM scheme.
  13962. *
  13963. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  13964. * we have a hierarchical implementation of pools,
  13965. * b'0:15 can be used to indicate the
  13966. * priority-based borrowing (PBB) threshold of
  13967. * the flow's pool. The b'16:31 are still left
  13968. * reserved.
  13969. */
  13970. enum htt_flow_type {
  13971. FLOW_TYPE_VDEV = 0,
  13972. /* Insert new flow types above this line */
  13973. };
  13974. PREPACK struct htt_flow_pool_map_payload_t {
  13975. A_UINT32 flow_type;
  13976. A_UINT32 flow_id;
  13977. A_UINT32 flow_pool_id:16,
  13978. reserved0:16;
  13979. A_UINT32 flow_pool_size:16,
  13980. reserved1:16;
  13981. A_UINT32 reserved2;
  13982. } POSTPACK;
  13983. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  13984. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  13985. (sizeof(struct htt_flow_pool_map_payload_t))
  13986. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  13987. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  13988. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  13989. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  13990. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  13991. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  13992. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  13993. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  13994. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  13995. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  13996. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  13997. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  13998. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  13999. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  14000. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  14001. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14002. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14003. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14004. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14005. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14006. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14007. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14008. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14009. do { \
  14010. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14011. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14012. } while (0)
  14013. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14014. do { \
  14015. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14016. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14017. } while (0)
  14018. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14019. do { \
  14020. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14021. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14022. } while (0)
  14023. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14024. do { \
  14025. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14026. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14027. } while (0)
  14028. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14029. do { \
  14030. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14031. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14032. } while (0)
  14033. /**
  14034. * @brief target -> host flow pool unmap message
  14035. *
  14036. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14037. *
  14038. * @details
  14039. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14040. * down a flow of descriptors.
  14041. * This message indicates that for the flow (whose ID is provided) is wanting
  14042. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14043. * pool of descriptors from where descriptors are being allocated for this
  14044. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14045. * be unmapped by the host.
  14046. *
  14047. * The message would appear as follows:
  14048. *
  14049. * |31 24|23 16|15 8|7 0|
  14050. * |----------------+----------------+----------------+----------------|
  14051. * | reserved0 | msg_type |
  14052. * |-------------------------------------------------------------------|
  14053. * | flow_type |
  14054. * |-------------------------------------------------------------------|
  14055. * | flow_id |
  14056. * |-------------------------------------------------------------------|
  14057. * | reserved1 | flow_pool_id |
  14058. * |-------------------------------------------------------------------|
  14059. *
  14060. * The message is interpreted as follows:
  14061. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14062. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14063. * b'8:31 - reserved0: Reserved for future use
  14064. *
  14065. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14066. * this flow is associated. It can be VDEV, peer,
  14067. * or tid (AC). Based on enum htt_flow_type.
  14068. *
  14069. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14070. * object. For flow_type vdev it is set to the
  14071. * vdevid, for peer it is peerid and for tid, it is
  14072. * tid_num.
  14073. *
  14074. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14075. * used in the host for this flow
  14076. * b'16:31 - reserved0: This field in reserved for the future.
  14077. *
  14078. */
  14079. PREPACK struct htt_flow_pool_unmap_t {
  14080. A_UINT32 msg_type:8,
  14081. reserved0:24;
  14082. A_UINT32 flow_type;
  14083. A_UINT32 flow_id;
  14084. A_UINT32 flow_pool_id:16,
  14085. reserved1:16;
  14086. } POSTPACK;
  14087. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14088. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14089. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14090. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14091. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14092. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14093. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14094. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14095. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14096. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14097. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14098. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14099. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14100. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14101. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14102. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14103. do { \
  14104. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14105. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14106. } while (0)
  14107. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14108. do { \
  14109. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14110. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14111. } while (0)
  14112. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14113. do { \
  14114. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14115. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14116. } while (0)
  14117. /**
  14118. * @brief target -> host SRING setup done message
  14119. *
  14120. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14121. *
  14122. * @details
  14123. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14124. * SRNG ring setup is done
  14125. *
  14126. * This message indicates whether the last setup operation is successful.
  14127. * It will be sent to host when host set respose_required bit in
  14128. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14129. * The message would appear as follows:
  14130. *
  14131. * |31 24|23 16|15 8|7 0|
  14132. * |--------------- +----------------+----------------+----------------|
  14133. * | setup_status | ring_id | pdev_id | msg_type |
  14134. * |-------------------------------------------------------------------|
  14135. *
  14136. * The message is interpreted as follows:
  14137. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14138. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14139. * b'8:15 - pdev_id:
  14140. * 0 (for rings at SOC/UMAC level),
  14141. * 1/2/3 mac id (for rings at LMAC level)
  14142. * b'16:23 - ring_id: Identify the ring which is set up
  14143. * More details can be got from enum htt_srng_ring_id
  14144. * b'24:31 - setup_status: Indicate status of setup operation
  14145. * Refer to htt_ring_setup_status
  14146. */
  14147. PREPACK struct htt_sring_setup_done_t {
  14148. A_UINT32 msg_type: 8,
  14149. pdev_id: 8,
  14150. ring_id: 8,
  14151. setup_status: 8;
  14152. } POSTPACK;
  14153. enum htt_ring_setup_status {
  14154. htt_ring_setup_status_ok = 0,
  14155. htt_ring_setup_status_error,
  14156. };
  14157. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14158. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14159. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14160. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14161. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14162. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14163. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14164. do { \
  14165. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14166. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14167. } while (0)
  14168. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14169. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14170. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14171. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14172. HTT_SRING_SETUP_DONE_RING_ID_S)
  14173. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14174. do { \
  14175. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14176. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14177. } while (0)
  14178. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14179. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14180. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14181. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14182. HTT_SRING_SETUP_DONE_STATUS_S)
  14183. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14184. do { \
  14185. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14186. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14187. } while (0)
  14188. /**
  14189. * @brief target -> flow map flow info
  14190. *
  14191. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14192. *
  14193. * @details
  14194. * HTT TX map flow entry with tqm flow pointer
  14195. * Sent from firmware to host to add tqm flow pointer in corresponding
  14196. * flow search entry. Flow metadata is replayed back to host as part of this
  14197. * struct to enable host to find the specific flow search entry
  14198. *
  14199. * The message would appear as follows:
  14200. *
  14201. * |31 28|27 18|17 14|13 8|7 0|
  14202. * |-------+------------------------------------------+----------------|
  14203. * | rsvd0 | fse_hsh_idx | msg_type |
  14204. * |-------------------------------------------------------------------|
  14205. * | rsvd1 | tid | peer_id |
  14206. * |-------------------------------------------------------------------|
  14207. * | tqm_flow_pntr_lo |
  14208. * |-------------------------------------------------------------------|
  14209. * | tqm_flow_pntr_hi |
  14210. * |-------------------------------------------------------------------|
  14211. * | fse_meta_data |
  14212. * |-------------------------------------------------------------------|
  14213. *
  14214. * The message is interpreted as follows:
  14215. *
  14216. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14217. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14218. *
  14219. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14220. * for this flow entry
  14221. *
  14222. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14223. *
  14224. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14225. *
  14226. * dword1 - b'14:17 - tid
  14227. *
  14228. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14229. *
  14230. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14231. *
  14232. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14233. *
  14234. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14235. * given by host
  14236. */
  14237. PREPACK struct htt_tx_map_flow_info {
  14238. A_UINT32
  14239. msg_type: 8,
  14240. fse_hsh_idx: 20,
  14241. rsvd0: 4;
  14242. A_UINT32
  14243. peer_id: 14,
  14244. tid: 4,
  14245. rsvd1: 14;
  14246. A_UINT32 tqm_flow_pntr_lo;
  14247. A_UINT32 tqm_flow_pntr_hi;
  14248. struct htt_tx_flow_metadata fse_meta_data;
  14249. } POSTPACK;
  14250. /* DWORD 0 */
  14251. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14252. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14253. /* DWORD 1 */
  14254. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14255. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14256. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14257. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14258. /* DWORD 0 */
  14259. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14260. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14261. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14262. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14263. do { \
  14264. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14265. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14266. } while (0)
  14267. /* DWORD 1 */
  14268. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14269. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14270. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14271. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14272. do { \
  14273. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14274. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14275. } while (0)
  14276. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14277. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14278. HTT_TX_MAP_FLOW_INFO_TID_S)
  14279. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14280. do { \
  14281. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14282. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14283. } while (0)
  14284. /*
  14285. * htt_dbg_ext_stats_status -
  14286. * present - The requested stats have been delivered in full.
  14287. * This indicates that either the stats information was contained
  14288. * in its entirety within this message, or else this message
  14289. * completes the delivery of the requested stats info that was
  14290. * partially delivered through earlier STATS_CONF messages.
  14291. * partial - The requested stats have been delivered in part.
  14292. * One or more subsequent STATS_CONF messages with the same
  14293. * cookie value will be sent to deliver the remainder of the
  14294. * information.
  14295. * error - The requested stats could not be delivered, for example due
  14296. * to a shortage of memory to construct a message holding the
  14297. * requested stats.
  14298. * invalid - The requested stat type is either not recognized, or the
  14299. * target is configured to not gather the stats type in question.
  14300. */
  14301. enum htt_dbg_ext_stats_status {
  14302. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14303. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14304. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14305. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14306. };
  14307. /**
  14308. * @brief target -> host ppdu stats upload
  14309. *
  14310. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14311. *
  14312. * @details
  14313. * The following field definitions describe the format of the HTT target
  14314. * to host ppdu stats indication message.
  14315. *
  14316. *
  14317. * |31 16|15 12|11 10|9 8|7 0 |
  14318. * |----------------------------------------------------------------------|
  14319. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14320. * |----------------------------------------------------------------------|
  14321. * | ppdu_id |
  14322. * |----------------------------------------------------------------------|
  14323. * | Timestamp in us |
  14324. * |----------------------------------------------------------------------|
  14325. * | reserved |
  14326. * |----------------------------------------------------------------------|
  14327. * | type-specific stats info |
  14328. * | (see htt_ppdu_stats.h) |
  14329. * |----------------------------------------------------------------------|
  14330. * Header fields:
  14331. * - MSG_TYPE
  14332. * Bits 7:0
  14333. * Purpose: Identifies this is a PPDU STATS indication
  14334. * message.
  14335. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14336. * - mac_id
  14337. * Bits 9:8
  14338. * Purpose: mac_id of this ppdu_id
  14339. * Value: 0-3
  14340. * - pdev_id
  14341. * Bits 11:10
  14342. * Purpose: pdev_id of this ppdu_id
  14343. * Value: 0-3
  14344. * 0 (for rings at SOC level),
  14345. * 1/2/3 PDEV -> 0/1/2
  14346. * - payload_size
  14347. * Bits 31:16
  14348. * Purpose: total tlv size
  14349. * Value: payload_size in bytes
  14350. */
  14351. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14352. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14353. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14354. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14355. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14356. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14357. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14358. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14359. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14360. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14361. do { \
  14362. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14363. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14364. } while (0)
  14365. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14366. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14367. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14368. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14369. do { \
  14370. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14371. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14372. } while (0)
  14373. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14374. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14375. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14376. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14377. do { \
  14378. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14379. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14380. } while (0)
  14381. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14382. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14383. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14384. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14385. do { \
  14386. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14387. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14388. } while (0)
  14389. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14390. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14391. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14392. /* htt_t2h_ppdu_stats_ind_hdr_t
  14393. * This struct contains the fields within the header of the
  14394. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14395. * stats info.
  14396. * This struct assumes little-endian layout, and thus is only
  14397. * suitable for use within processors known to be little-endian
  14398. * (such as the target).
  14399. * In contrast, the above macros provide endian-portable methods
  14400. * to get and set the bitfields within this PPDU_STATS_IND header.
  14401. */
  14402. typedef struct {
  14403. A_UINT32 msg_type: 8, /* bits 7:0 */
  14404. mac_id: 2, /* bits 9:8 */
  14405. pdev_id: 2, /* bits 11:10 */
  14406. reserved1: 4, /* bits 15:12 */
  14407. payload_size: 16; /* bits 31:16 */
  14408. A_UINT32 ppdu_id;
  14409. A_UINT32 timestamp_us;
  14410. A_UINT32 reserved2;
  14411. } htt_t2h_ppdu_stats_ind_hdr_t;
  14412. /**
  14413. * @brief target -> host extended statistics upload
  14414. *
  14415. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14416. *
  14417. * @details
  14418. * The following field definitions describe the format of the HTT target
  14419. * to host stats upload confirmation message.
  14420. * The message contains a cookie echoed from the HTT host->target stats
  14421. * upload request, which identifies which request the confirmation is
  14422. * for, and a single stats can span over multiple HTT stats indication
  14423. * due to the HTT message size limitation so every HTT ext stats indication
  14424. * will have tag-length-value stats information elements.
  14425. * The tag-length header for each HTT stats IND message also includes a
  14426. * status field, to indicate whether the request for the stat type in
  14427. * question was fully met, partially met, unable to be met, or invalid
  14428. * (if the stat type in question is disabled in the target).
  14429. * A Done bit 1's indicate the end of the of stats info elements.
  14430. *
  14431. *
  14432. * |31 16|15 12|11|10 8|7 5|4 0|
  14433. * |--------------------------------------------------------------|
  14434. * | reserved | msg type |
  14435. * |--------------------------------------------------------------|
  14436. * | cookie LSBs |
  14437. * |--------------------------------------------------------------|
  14438. * | cookie MSBs |
  14439. * |--------------------------------------------------------------|
  14440. * | stats entry length | rsvd | D| S | stat type |
  14441. * |--------------------------------------------------------------|
  14442. * | type-specific stats info |
  14443. * | (see htt_stats.h) |
  14444. * |--------------------------------------------------------------|
  14445. * Header fields:
  14446. * - MSG_TYPE
  14447. * Bits 7:0
  14448. * Purpose: Identifies this is a extended statistics upload confirmation
  14449. * message.
  14450. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14451. * - COOKIE_LSBS
  14452. * Bits 31:0
  14453. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14454. * message with its preceding host->target stats request message.
  14455. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14456. * - COOKIE_MSBS
  14457. * Bits 31:0
  14458. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14459. * message with its preceding host->target stats request message.
  14460. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14461. *
  14462. * Stats Information Element tag-length header fields:
  14463. * - STAT_TYPE
  14464. * Bits 7:0
  14465. * Purpose: identifies the type of statistics info held in the
  14466. * following information element
  14467. * Value: htt_dbg_ext_stats_type
  14468. * - STATUS
  14469. * Bits 10:8
  14470. * Purpose: indicate whether the requested stats are present
  14471. * Value: htt_dbg_ext_stats_status
  14472. * - DONE
  14473. * Bits 11
  14474. * Purpose:
  14475. * Indicates the completion of the stats entry, this will be the last
  14476. * stats conf HTT segment for the requested stats type.
  14477. * Value:
  14478. * 0 -> the stats retrieval is ongoing
  14479. * 1 -> the stats retrieval is complete
  14480. * - LENGTH
  14481. * Bits 31:16
  14482. * Purpose: indicate the stats information size
  14483. * Value: This field specifies the number of bytes of stats information
  14484. * that follows the element tag-length header.
  14485. * It is expected but not required that this length is a multiple of
  14486. * 4 bytes.
  14487. */
  14488. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14489. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14490. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14491. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14492. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14493. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14494. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14495. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14496. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14497. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14498. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14499. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14500. do { \
  14501. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14502. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14503. } while (0)
  14504. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14505. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14506. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14507. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14508. do { \
  14509. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14510. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14511. } while (0)
  14512. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14513. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14514. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14515. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14516. do { \
  14517. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14518. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14519. } while (0)
  14520. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14521. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14522. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14523. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14524. do { \
  14525. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14526. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14527. } while (0)
  14528. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14529. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14530. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14531. /**
  14532. * @brief target -> host streaming statistics upload
  14533. *
  14534. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  14535. *
  14536. * @details
  14537. * The following field definitions describe the format of the HTT target
  14538. * to host streaming stats upload indication message.
  14539. * The host can use a STREAMING_STATS_REQ message to enable the target to
  14540. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  14541. * use the STREAMING_STATS_REQ message to halt the target's production of
  14542. * STREAMING_STATS_IND messages.
  14543. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  14544. * the stats enabled by the host's STREAMING_STATS_REQ message.
  14545. *
  14546. * |31 8|7 0|
  14547. * |--------------------------------------------------------------|
  14548. * | reserved | msg type |
  14549. * |--------------------------------------------------------------|
  14550. * | type-specific stats info |
  14551. * | (see htt_stats.h) |
  14552. * |--------------------------------------------------------------|
  14553. * Header fields:
  14554. * - MSG_TYPE
  14555. * Bits 7:0
  14556. * Purpose: Identifies this as a streaming statistics upload indication
  14557. * message.
  14558. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  14559. */
  14560. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  14561. typedef enum {
  14562. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14563. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14564. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14565. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14566. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14567. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14568. /* Reserved from 128 - 255 for target internal use.*/
  14569. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14570. } HTT_PEER_TYPE;
  14571. /** macro to convert MAC address from char array to HTT word format */
  14572. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14573. (phtt_mac_addr)->mac_addr31to0 = \
  14574. (((c_macaddr)[0] << 0) | \
  14575. ((c_macaddr)[1] << 8) | \
  14576. ((c_macaddr)[2] << 16) | \
  14577. ((c_macaddr)[3] << 24)); \
  14578. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14579. } while (0)
  14580. /**
  14581. * @brief target -> host monitor mac header indication message
  14582. *
  14583. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14584. *
  14585. * @details
  14586. * The following diagram shows the format of the monitor mac header message
  14587. * sent from the target to the host.
  14588. * This message is primarily sent when promiscuous rx mode is enabled.
  14589. * One message is sent per rx PPDU.
  14590. *
  14591. * |31 24|23 16|15 8|7 0|
  14592. * |-------------------------------------------------------------|
  14593. * | peer_id | reserved0 | msg_type |
  14594. * |-------------------------------------------------------------|
  14595. * | reserved1 | num_mpdu |
  14596. * |-------------------------------------------------------------|
  14597. * | struct hw_rx_desc |
  14598. * | (see wal_rx_desc.h) |
  14599. * |-------------------------------------------------------------|
  14600. * | struct ieee80211_frame_addr4 |
  14601. * | (see ieee80211_defs.h) |
  14602. * |-------------------------------------------------------------|
  14603. * | struct ieee80211_frame_addr4 |
  14604. * | (see ieee80211_defs.h) |
  14605. * |-------------------------------------------------------------|
  14606. * | ...... |
  14607. * |-------------------------------------------------------------|
  14608. *
  14609. * Header fields:
  14610. * - msg_type
  14611. * Bits 7:0
  14612. * Purpose: Identifies this is a monitor mac header indication message.
  14613. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14614. * - peer_id
  14615. * Bits 31:16
  14616. * Purpose: Software peer id given by host during association,
  14617. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14618. * for rx PPDUs received from unassociated peers.
  14619. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14620. * - num_mpdu
  14621. * Bits 15:0
  14622. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14623. * delivered within the message.
  14624. * Value: 1 to 32
  14625. * num_mpdu is limited to a maximum value of 32, due to buffer
  14626. * size limits. For PPDUs with more than 32 MPDUs, only the
  14627. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14628. * the PPDU will be provided.
  14629. */
  14630. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  14631. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  14632. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  14633. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  14634. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  14635. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  14636. do { \
  14637. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  14638. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  14639. } while (0)
  14640. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  14641. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  14642. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  14643. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  14644. do { \
  14645. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  14646. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  14647. } while (0)
  14648. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  14649. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  14650. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  14651. /**
  14652. * @brief target -> host flow pool resize Message
  14653. *
  14654. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  14655. *
  14656. * @details
  14657. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  14658. * the flow pool associated with the specified ID is resized
  14659. *
  14660. * The message would appear as follows:
  14661. *
  14662. * |31 16|15 8|7 0|
  14663. * |---------------------------------+----------------+----------------|
  14664. * | reserved0 | Msg type |
  14665. * |-------------------------------------------------------------------|
  14666. * | flow pool new size | flow pool ID |
  14667. * |-------------------------------------------------------------------|
  14668. *
  14669. * The message is interpreted as follows:
  14670. * b'0:7 - msg_type: This will be set to 0x21
  14671. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  14672. *
  14673. * b'0:15 - flow pool ID: Existing flow pool ID
  14674. *
  14675. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  14676. *
  14677. */
  14678. PREPACK struct htt_flow_pool_resize_t {
  14679. A_UINT32 msg_type:8,
  14680. reserved0:24;
  14681. A_UINT32 flow_pool_id:16,
  14682. flow_pool_new_size:16;
  14683. } POSTPACK;
  14684. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  14685. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  14686. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  14687. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  14688. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  14689. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  14690. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  14691. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  14692. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  14693. do { \
  14694. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  14695. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  14696. } while (0)
  14697. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  14698. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  14699. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  14700. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  14701. do { \
  14702. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  14703. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  14704. } while (0)
  14705. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  14706. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  14707. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  14708. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  14709. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  14710. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  14711. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  14712. /*
  14713. * The read and write indices point to the data within the host buffer.
  14714. * Because the first 4 bytes of the host buffer is used for the read index and
  14715. * the next 4 bytes for the write index, the data itself starts at offset 8.
  14716. * The read index and write index are the byte offsets from the base of the
  14717. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  14718. * Refer the ASCII text picture below.
  14719. */
  14720. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  14721. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  14722. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  14723. /*
  14724. ***************************************************************************
  14725. *
  14726. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14727. *
  14728. ***************************************************************************
  14729. *
  14730. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  14731. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  14732. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  14733. * written into the Host memory region mentioned below.
  14734. *
  14735. * Read index is updated by the Host. At any point of time, the read index will
  14736. * indicate the index that will next be read by the Host. The read index is
  14737. * in units of bytes offset from the base of the meta-data buffer.
  14738. *
  14739. * Write index is updated by the FW. At any point of time, the write index will
  14740. * indicate from where the FW can start writing any new data. The write index is
  14741. * in units of bytes offset from the base of the meta-data buffer.
  14742. *
  14743. * If the Host is not fast enough in reading the CFR data, any new capture data
  14744. * would be dropped if there is no space left to write the new captures.
  14745. *
  14746. * The last 4 bytes of the memory region will have the magic pattern
  14747. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  14748. * not overrun the host buffer.
  14749. *
  14750. * ,--------------------. read and write indices store the
  14751. * | | byte offset from the base of the
  14752. * | ,--------+--------. meta-data buffer to the next
  14753. * | | | | location within the data buffer
  14754. * | | v v that will be read / written
  14755. * ************************************************************************
  14756. * * Read * Write * * Magic *
  14757. * * index * index * CFR data1 ...... CFR data N * pattern *
  14758. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  14759. * ************************************************************************
  14760. * |<---------- data buffer ---------->|
  14761. *
  14762. * |<----------------- meta-data buffer allocated in Host ----------------|
  14763. *
  14764. * Note:
  14765. * - Considering the 4 bytes needed to store the Read index (R) and the
  14766. * Write index (W), the initial value is as follows:
  14767. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  14768. * - Buffer empty condition:
  14769. * R = W
  14770. *
  14771. * Regarding CFR data format:
  14772. * --------------------------
  14773. *
  14774. * Each CFR tone is stored in HW as 16-bits with the following format:
  14775. * {bits[15:12], bits[11:6], bits[5:0]} =
  14776. * {unsigned exponent (4 bits),
  14777. * signed mantissa_real (6 bits),
  14778. * signed mantissa_imag (6 bits)}
  14779. *
  14780. * CFR_real = mantissa_real * 2^(exponent-5)
  14781. * CFR_imag = mantissa_imag * 2^(exponent-5)
  14782. *
  14783. *
  14784. * The CFR data is written to the 16-bit unsigned output array (buff) in
  14785. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  14786. *
  14787. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  14788. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  14789. * .
  14790. * .
  14791. * .
  14792. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  14793. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  14794. */
  14795. /* Bandwidth of peer CFR captures */
  14796. typedef enum {
  14797. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  14798. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  14799. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  14800. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  14801. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  14802. HTT_PEER_CFR_CAPTURE_BW_MAX,
  14803. } HTT_PEER_CFR_CAPTURE_BW;
  14804. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  14805. * was captured
  14806. */
  14807. typedef enum {
  14808. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  14809. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  14810. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  14811. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  14812. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  14813. } HTT_PEER_CFR_CAPTURE_MODE;
  14814. typedef enum {
  14815. /* This message type is currently used for the below purpose:
  14816. *
  14817. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  14818. * wmi_peer_cfr_capture_cmd.
  14819. * If payload_present bit is set to 0 then the associated memory region
  14820. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  14821. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  14822. * message; the CFR dump will be present at the end of the message,
  14823. * after the chan_phy_mode.
  14824. */
  14825. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  14826. /* Always keep this last */
  14827. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  14828. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  14829. /**
  14830. * @brief target -> host CFR dump completion indication message definition
  14831. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  14832. *
  14833. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  14834. *
  14835. * @details
  14836. * The following diagram shows the format of the Channel Frequency Response
  14837. * (CFR) dump completion indication. This inidcation is sent to the Host when
  14838. * the channel capture of a peer is copied by Firmware into the Host memory
  14839. *
  14840. * **************************************************************************
  14841. *
  14842. * Message format when the CFR capture message type is
  14843. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14844. *
  14845. * **************************************************************************
  14846. *
  14847. * |31 16|15 |8|7 0|
  14848. * |----------------------------------------------------------------|
  14849. * header: | reserved |P| msg_type |
  14850. * word 0 | | | |
  14851. * |----------------------------------------------------------------|
  14852. * payload: | cfr_capture_msg_type |
  14853. * word 1 | |
  14854. * |----------------------------------------------------------------|
  14855. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  14856. * word 2 | | | | | | | | |
  14857. * |----------------------------------------------------------------|
  14858. * | mac_addr31to0 |
  14859. * word 3 | |
  14860. * |----------------------------------------------------------------|
  14861. * | unused / reserved | mac_addr47to32 |
  14862. * word 4 | | |
  14863. * |----------------------------------------------------------------|
  14864. * | index |
  14865. * word 5 | |
  14866. * |----------------------------------------------------------------|
  14867. * | length |
  14868. * word 6 | |
  14869. * |----------------------------------------------------------------|
  14870. * | timestamp |
  14871. * word 7 | |
  14872. * |----------------------------------------------------------------|
  14873. * | counter |
  14874. * word 8 | |
  14875. * |----------------------------------------------------------------|
  14876. * | chan_mhz |
  14877. * word 9 | |
  14878. * |----------------------------------------------------------------|
  14879. * | band_center_freq1 |
  14880. * word 10 | |
  14881. * |----------------------------------------------------------------|
  14882. * | band_center_freq2 |
  14883. * word 11 | |
  14884. * |----------------------------------------------------------------|
  14885. * | chan_phy_mode |
  14886. * word 12 | |
  14887. * |----------------------------------------------------------------|
  14888. * where,
  14889. * P - payload present bit (payload_present explained below)
  14890. * req_id - memory request id (mem_req_id explained below)
  14891. * S - status field (status explained below)
  14892. * capbw - capture bandwidth (capture_bw explained below)
  14893. * mode - mode of capture (mode explained below)
  14894. * sts - space time streams (sts_count explained below)
  14895. * chbw - channel bandwidth (channel_bw explained below)
  14896. * captype - capture type (cap_type explained below)
  14897. *
  14898. * The following field definitions describe the format of the CFR dump
  14899. * completion indication sent from the target to the host
  14900. *
  14901. * Header fields:
  14902. *
  14903. * Word 0
  14904. * - msg_type
  14905. * Bits 7:0
  14906. * Purpose: Identifies this as CFR TX completion indication
  14907. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  14908. * - payload_present
  14909. * Bit 8
  14910. * Purpose: Identifies how CFR data is sent to host
  14911. * Value: 0 - If CFR Payload is written to host memory
  14912. * 1 - If CFR Payload is sent as part of HTT message
  14913. * (This is the requirement for SDIO/USB where it is
  14914. * not possible to write CFR data to host memory)
  14915. * - reserved
  14916. * Bits 31:9
  14917. * Purpose: Reserved
  14918. * Value: 0
  14919. *
  14920. * Payload fields:
  14921. *
  14922. * Word 1
  14923. * - cfr_capture_msg_type
  14924. * Bits 31:0
  14925. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  14926. * to specify the format used for the remainder of the message
  14927. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14928. * (currently only MSG_TYPE_1 is defined)
  14929. *
  14930. * Word 2
  14931. * - mem_req_id
  14932. * Bits 6:0
  14933. * Purpose: Contain the mem request id of the region where the CFR capture
  14934. * has been stored - of type WMI_HOST_MEM_REQ_ID
  14935. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  14936. this value is invalid)
  14937. * - status
  14938. * Bit 7
  14939. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  14940. * Value: 1 (True) - Successful; 0 (False) - Not successful
  14941. * - capture_bw
  14942. * Bits 10:8
  14943. * Purpose: Carry the bandwidth of the CFR capture
  14944. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  14945. * - mode
  14946. * Bits 13:11
  14947. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  14948. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  14949. * - sts_count
  14950. * Bits 16:14
  14951. * Purpose: Carry the number of space time streams
  14952. * Value: Number of space time streams
  14953. * - channel_bw
  14954. * Bits 19:17
  14955. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  14956. * measurement
  14957. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  14958. * - cap_type
  14959. * Bits 23:20
  14960. * Purpose: Carry the type of the capture
  14961. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  14962. * - vdev_id
  14963. * Bits 31:24
  14964. * Purpose: Carry the virtual device id
  14965. * Value: vdev ID
  14966. *
  14967. * Word 3
  14968. * - mac_addr31to0
  14969. * Bits 31:0
  14970. * Purpose: Contain the bits 31:0 of the peer MAC address
  14971. * Value: Bits 31:0 of the peer MAC address
  14972. *
  14973. * Word 4
  14974. * - mac_addr47to32
  14975. * Bits 15:0
  14976. * Purpose: Contain the bits 47:32 of the peer MAC address
  14977. * Value: Bits 47:32 of the peer MAC address
  14978. *
  14979. * Word 5
  14980. * - index
  14981. * Bits 31:0
  14982. * Purpose: Contain the index at which this CFR dump was written in the Host
  14983. * allocated memory. This index is the number of bytes from the base address.
  14984. * Value: Index position
  14985. *
  14986. * Word 6
  14987. * - length
  14988. * Bits 31:0
  14989. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  14990. * Value: Length of the CFR capture of the peer
  14991. *
  14992. * Word 7
  14993. * - timestamp
  14994. * Bits 31:0
  14995. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  14996. * clock used for this timestamp is private to the target and not visible to
  14997. * the host i.e., Host can interpret only the relative timestamp deltas from
  14998. * one message to the next, but can't interpret the absolute timestamp from a
  14999. * single message.
  15000. * Value: Timestamp in microseconds
  15001. *
  15002. * Word 8
  15003. * - counter
  15004. * Bits 31:0
  15005. * Purpose: Carry the count of the current CFR capture from FW. This is
  15006. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15007. * in host memory)
  15008. * Value: Count of the current CFR capture
  15009. *
  15010. * Word 9
  15011. * - chan_mhz
  15012. * Bits 31:0
  15013. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15014. * Value: Primary 20 channel frequency
  15015. *
  15016. * Word 10
  15017. * - band_center_freq1
  15018. * Bits 31:0
  15019. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15020. * Value: Center frequency 1 in MHz
  15021. *
  15022. * Word 11
  15023. * - band_center_freq2
  15024. * Bits 31:0
  15025. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15026. * the VDEV
  15027. * 80plus80 mode
  15028. * Value: Center frequency 2 in MHz
  15029. *
  15030. * Word 12
  15031. * - chan_phy_mode
  15032. * Bits 31:0
  15033. * Purpose: Carry the phy mode of the channel, of the VDEV
  15034. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15035. */
  15036. PREPACK struct htt_cfr_dump_ind_type_1 {
  15037. A_UINT32 mem_req_id:7,
  15038. status:1,
  15039. capture_bw:3,
  15040. mode:3,
  15041. sts_count:3,
  15042. channel_bw:3,
  15043. cap_type:4,
  15044. vdev_id:8;
  15045. htt_mac_addr addr;
  15046. A_UINT32 index;
  15047. A_UINT32 length;
  15048. A_UINT32 timestamp;
  15049. A_UINT32 counter;
  15050. struct htt_chan_change_msg chan;
  15051. } POSTPACK;
  15052. PREPACK struct htt_cfr_dump_compl_ind {
  15053. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15054. union {
  15055. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15056. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15057. /* If there is a need to change the memory layout and its associated
  15058. * HTT indication format, a new CFR capture message type can be
  15059. * introduced and added into this union.
  15060. */
  15061. };
  15062. } POSTPACK;
  15063. /*
  15064. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15065. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15066. */
  15067. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15068. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15069. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15070. do { \
  15071. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15072. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15073. } while(0)
  15074. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15075. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15076. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15077. /*
  15078. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15079. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15080. */
  15081. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15082. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15083. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15084. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15085. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15086. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15087. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15088. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15089. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15090. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15091. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15092. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15093. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15094. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15095. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15096. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15097. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15098. do { \
  15099. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15100. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15101. } while (0)
  15102. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15103. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15104. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15105. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15106. do { \
  15107. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15108. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15109. } while (0)
  15110. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15111. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15112. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15113. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15114. do { \
  15115. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15116. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15117. } while (0)
  15118. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15119. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15120. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15121. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15122. do { \
  15123. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15124. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15125. } while (0)
  15126. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15127. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15128. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15129. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15130. do { \
  15131. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15132. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15133. } while (0)
  15134. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15135. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15136. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15137. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15138. do { \
  15139. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15140. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15141. } while (0)
  15142. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15143. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15144. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15145. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15146. do { \
  15147. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15148. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15149. } while (0)
  15150. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15151. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15152. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15153. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15154. do { \
  15155. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15156. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15157. } while (0)
  15158. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15159. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15160. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15161. /**
  15162. * @brief target -> host peer (PPDU) stats message
  15163. *
  15164. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15165. *
  15166. * @details
  15167. * This message is generated by FW when FW is sending stats to host
  15168. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15169. * This message is sent autonomously by the target rather than upon request
  15170. * by the host.
  15171. * The following field definitions describe the format of the HTT target
  15172. * to host peer stats indication message.
  15173. *
  15174. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15175. * or more PPDU stats records.
  15176. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15177. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15178. * then the message would start with the
  15179. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15180. * below.
  15181. *
  15182. * |31 16|15|14|13 11|10 9|8|7 0|
  15183. * |-------------------------------------------------------------|
  15184. * | reserved |MSG_TYPE |
  15185. * |-------------------------------------------------------------|
  15186. * rec 0 | TLV header |
  15187. * rec 0 |-------------------------------------------------------------|
  15188. * rec 0 | ppdu successful bytes |
  15189. * rec 0 |-------------------------------------------------------------|
  15190. * rec 0 | ppdu retry bytes |
  15191. * rec 0 |-------------------------------------------------------------|
  15192. * rec 0 | ppdu failed bytes |
  15193. * rec 0 |-------------------------------------------------------------|
  15194. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15195. * rec 0 |-------------------------------------------------------------|
  15196. * rec 0 | retried MSDUs | successful MSDUs |
  15197. * rec 0 |-------------------------------------------------------------|
  15198. * rec 0 | TX duration | failed MSDUs |
  15199. * rec 0 |-------------------------------------------------------------|
  15200. * ...
  15201. * |-------------------------------------------------------------|
  15202. * rec N | TLV header |
  15203. * rec N |-------------------------------------------------------------|
  15204. * rec N | ppdu successful bytes |
  15205. * rec N |-------------------------------------------------------------|
  15206. * rec N | ppdu retry bytes |
  15207. * rec N |-------------------------------------------------------------|
  15208. * rec N | ppdu failed bytes |
  15209. * rec N |-------------------------------------------------------------|
  15210. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15211. * rec N |-------------------------------------------------------------|
  15212. * rec N | retried MSDUs | successful MSDUs |
  15213. * rec N |-------------------------------------------------------------|
  15214. * rec N | TX duration | failed MSDUs |
  15215. * rec N |-------------------------------------------------------------|
  15216. *
  15217. * where:
  15218. * A = is A-MPDU flag
  15219. * BA = block-ack failure flags
  15220. * BW = bandwidth spec
  15221. * SG = SGI enabled spec
  15222. * S = skipped rate ctrl
  15223. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15224. *
  15225. * Header
  15226. * ------
  15227. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15228. * dword0 - b'8:31 - reserved : Reserved for future use
  15229. *
  15230. * payload include below peer_stats information
  15231. * --------------------------------------------
  15232. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15233. * @tx_success_bytes : total successful bytes in the PPDU.
  15234. * @tx_retry_bytes : total retried bytes in the PPDU.
  15235. * @tx_failed_bytes : total failed bytes in the PPDU.
  15236. * @tx_ratecode : rate code used for the PPDU.
  15237. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15238. * @ba_ack_failed : BA/ACK failed for this PPDU
  15239. * b00 -> BA received
  15240. * b01 -> BA failed once
  15241. * b10 -> BA failed twice, when HW retry is enabled.
  15242. * @bw : BW
  15243. * b00 -> 20 MHz
  15244. * b01 -> 40 MHz
  15245. * b10 -> 80 MHz
  15246. * b11 -> 160 MHz (or 80+80)
  15247. * @sg : SGI enabled
  15248. * @s : skipped ratectrl
  15249. * @peer_id : peer id
  15250. * @tx_success_msdus : successful MSDUs
  15251. * @tx_retry_msdus : retried MSDUs
  15252. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15253. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15254. */
  15255. /**
  15256. * @brief target -> host backpressure event
  15257. *
  15258. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15259. *
  15260. * @details
  15261. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15262. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15263. * This message will only be sent if the backpressure condition has existed
  15264. * continuously for an initial period (100 ms).
  15265. * Repeat messages with updated information will be sent after each
  15266. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15267. * This message indicates the ring id along with current head and tail index
  15268. * locations (i.e. write and read indices).
  15269. * The backpressure time indicates the time in ms for which continous
  15270. * backpressure has been observed in the ring.
  15271. *
  15272. * The message format is as follows:
  15273. *
  15274. * |31 24|23 16|15 8|7 0|
  15275. * |----------------+----------------+----------------+----------------|
  15276. * | ring_id | ring_type | pdev_id | msg_type |
  15277. * |-------------------------------------------------------------------|
  15278. * | tail_idx | head_idx |
  15279. * |-------------------------------------------------------------------|
  15280. * | backpressure_time_ms |
  15281. * |-------------------------------------------------------------------|
  15282. *
  15283. * The message is interpreted as follows:
  15284. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15285. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15286. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15287. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15288. the msg is for LMAC ring.
  15289. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15290. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15291. * htt_backpressure_lmac_ring_id. This represents
  15292. * the ring id for which continous backpressure is seen
  15293. *
  15294. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15295. * the ring indicated by the ring_id
  15296. *
  15297. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15298. * the ring indicated by the ring id
  15299. *
  15300. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15301. * backpressure has been seen in the ring
  15302. * indicated by the ring_id.
  15303. * Units = milliseconds
  15304. */
  15305. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15306. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15307. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15308. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15309. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15310. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15311. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15312. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15313. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15314. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15315. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15316. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15317. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15318. do { \
  15319. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15320. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15321. } while (0)
  15322. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15323. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15324. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15325. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15326. do { \
  15327. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15328. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15329. } while (0)
  15330. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15331. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15332. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15333. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15334. do { \
  15335. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15336. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15337. } while (0)
  15338. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15339. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15340. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15341. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15342. do { \
  15343. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15344. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15345. } while (0)
  15346. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15347. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15348. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15349. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15350. do { \
  15351. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15352. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15353. } while (0)
  15354. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15355. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15356. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15357. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15358. do { \
  15359. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15360. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15361. } while (0)
  15362. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15363. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15364. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15365. enum htt_backpressure_ring_type {
  15366. HTT_SW_RING_TYPE_UMAC,
  15367. HTT_SW_RING_TYPE_LMAC,
  15368. HTT_SW_RING_TYPE_MAX,
  15369. };
  15370. /* Ring id for which the message is sent to host */
  15371. enum htt_backpressure_umac_ringid {
  15372. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15373. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15374. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15375. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15376. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15377. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15378. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15379. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15380. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15381. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15382. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15383. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15384. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15385. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15386. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15387. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15388. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15389. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15390. HTT_SW_UMAC_RING_IDX_MAX,
  15391. };
  15392. enum htt_backpressure_lmac_ringid {
  15393. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15394. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15395. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15396. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15397. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15398. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15399. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15400. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15401. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15402. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15403. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15404. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15405. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15406. HTT_SW_LMAC_RING_IDX_MAX,
  15407. };
  15408. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15409. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15410. pdev_id: 8,
  15411. ring_type: 8, /* htt_backpressure_ring_type */
  15412. /*
  15413. * ring_id holds an enum value from either
  15414. * htt_backpressure_umac_ringid or
  15415. * htt_backpressure_lmac_ringid, based on
  15416. * the ring_type setting.
  15417. */
  15418. ring_id: 8;
  15419. A_UINT16 head_idx;
  15420. A_UINT16 tail_idx;
  15421. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15422. } POSTPACK;
  15423. /*
  15424. * Defines two 32 bit words that can be used by the target to indicate a per
  15425. * user RU allocation and rate information.
  15426. *
  15427. * This information is currently provided in the "sw_response_reference_ptr"
  15428. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15429. * "rx_ppdu_end_user_stats" TLV.
  15430. *
  15431. * VALID:
  15432. * The consumer of these words must explicitly check the valid bit,
  15433. * and only attempt interpretation of any of the remaining fields if
  15434. * the valid bit is set to 1.
  15435. *
  15436. * VERSION:
  15437. * The consumer of these words must also explicitly check the version bit,
  15438. * and only use the V0 definition if the VERSION field is set to 0.
  15439. *
  15440. * Version 1 is currently undefined, with the exception of the VALID and
  15441. * VERSION fields.
  15442. *
  15443. * Version 0:
  15444. *
  15445. * The fields below are duplicated per BW.
  15446. *
  15447. * The consumer must determine which BW field to use, based on the UL OFDMA
  15448. * PPDU BW indicated by HW.
  15449. *
  15450. * RU_START: RU26 start index for the user.
  15451. * Note that this is always using the RU26 index, regardless
  15452. * of the actual RU assigned to the user
  15453. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15454. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15455. *
  15456. * For example, 20MHz (the value in the top row is RU_START)
  15457. *
  15458. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15459. * RU Size 1 (52): | | | | | |
  15460. * RU Size 2 (106): | | | |
  15461. * RU Size 3 (242): | |
  15462. *
  15463. * RU_SIZE: Indicates the RU size, as defined by enum
  15464. * htt_ul_ofdma_user_info_ru_size.
  15465. *
  15466. * LDPC: LDPC enabled (if 0, BCC is used)
  15467. *
  15468. * DCM: DCM enabled
  15469. *
  15470. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15471. * |---------------------------------+--------------------------------|
  15472. * |Ver|Valid| FW internal |
  15473. * |---------------------------------+--------------------------------|
  15474. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15475. * |---------------------------------+--------------------------------|
  15476. */
  15477. enum htt_ul_ofdma_user_info_ru_size {
  15478. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15479. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15480. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15481. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15482. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15483. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15484. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15485. };
  15486. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15487. struct htt_ul_ofdma_user_info_v0 {
  15488. A_UINT32 word0;
  15489. A_UINT32 word1;
  15490. };
  15491. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15492. A_UINT32 w0_fw_rsvd:30; \
  15493. A_UINT32 w0_valid:1; \
  15494. A_UINT32 w0_version:1;
  15495. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15496. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15497. };
  15498. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15499. A_UINT32 w1_nss:3; \
  15500. A_UINT32 w1_mcs:4; \
  15501. A_UINT32 w1_ldpc:1; \
  15502. A_UINT32 w1_dcm:1; \
  15503. A_UINT32 w1_ru_start:7; \
  15504. A_UINT32 w1_ru_size:3; \
  15505. A_UINT32 w1_trig_type:4; \
  15506. A_UINT32 w1_unused:9;
  15507. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15508. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15509. };
  15510. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15511. A_UINT32 w0_fw_rsvd:27; \
  15512. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15513. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15514. 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) */
  15515. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15516. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15517. };
  15518. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15519. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15520. A_UINT32 w1_trig_type:4; \
  15521. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15522. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15523. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15524. };
  15525. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15526. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15527. union {
  15528. A_UINT32 word0;
  15529. struct {
  15530. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15531. };
  15532. };
  15533. union {
  15534. A_UINT32 word1;
  15535. struct {
  15536. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15537. };
  15538. };
  15539. } POSTPACK;
  15540. /*
  15541. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15542. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15543. * this should be picked.
  15544. */
  15545. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15546. union {
  15547. A_UINT32 word0;
  15548. struct {
  15549. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15550. };
  15551. };
  15552. union {
  15553. A_UINT32 word1;
  15554. struct {
  15555. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15556. };
  15557. };
  15558. } POSTPACK;
  15559. enum HTT_UL_OFDMA_TRIG_TYPE {
  15560. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15561. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15562. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15563. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15564. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15565. };
  15566. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15567. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15568. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15569. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15570. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15571. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15572. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15573. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15574. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15575. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15576. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15577. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15578. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15579. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15580. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15581. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15582. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15583. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15584. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15585. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15586. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15587. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15588. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15589. /*--- word 0 ---*/
  15590. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15591. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15592. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15593. do { \
  15594. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15595. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15596. } while (0)
  15597. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15598. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15599. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15600. do { \
  15601. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15602. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15603. } while (0)
  15604. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15605. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15606. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15607. do { \
  15608. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15609. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15610. } while (0)
  15611. /*--- word 1 ---*/
  15612. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15613. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15614. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15615. do { \
  15616. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15617. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15618. } while (0)
  15619. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15620. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15621. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15622. do { \
  15623. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15624. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15625. } while (0)
  15626. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15627. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15628. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  15629. do { \
  15630. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  15631. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  15632. } while (0)
  15633. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  15634. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  15635. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  15636. do { \
  15637. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  15638. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  15639. } while (0)
  15640. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  15641. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  15642. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  15643. do { \
  15644. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  15645. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  15646. } while (0)
  15647. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  15648. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  15649. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  15650. do { \
  15651. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  15652. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  15653. } while (0)
  15654. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  15655. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  15656. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  15657. do { \
  15658. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  15659. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  15660. } while (0)
  15661. /**
  15662. * @brief target -> host channel calibration data message
  15663. *
  15664. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  15665. *
  15666. * @brief host -> target channel calibration data message
  15667. *
  15668. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  15669. *
  15670. * @details
  15671. * The following field definitions describe the format of the channel
  15672. * calibration data message sent from the target to the host when
  15673. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  15674. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  15675. * The message is defined as htt_chan_caldata_msg followed by a variable
  15676. * number of 32-bit character values.
  15677. *
  15678. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  15679. * |------------------------------------------------------------------|
  15680. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  15681. * |------------------------------------------------------------------|
  15682. * | payload size | mhz |
  15683. * |------------------------------------------------------------------|
  15684. * | center frequency 2 | center frequency 1 |
  15685. * |------------------------------------------------------------------|
  15686. * | check sum |
  15687. * |------------------------------------------------------------------|
  15688. * | payload |
  15689. * |------------------------------------------------------------------|
  15690. * message info field:
  15691. * - MSG_TYPE
  15692. * Bits 7:0
  15693. * Purpose: identifies this as a channel calibration data message
  15694. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  15695. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  15696. * - SUB_TYPE
  15697. * Bits 11:8
  15698. * Purpose: T2H: indicates whether target is providing chan cal data
  15699. * to the host to store, or requesting that the host
  15700. * download previously-stored data.
  15701. * H2T: indicates whether the host is providing the requested
  15702. * channel cal data, or if it is rejecting the data
  15703. * request because it does not have the requested data.
  15704. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  15705. * - CHKSUM_VALID
  15706. * Bit 12
  15707. * Purpose: indicates if the checksum field is valid
  15708. * value:
  15709. * - FRAG
  15710. * Bit 19:16
  15711. * Purpose: indicates the fragment index for message
  15712. * value: 0 for first fragment, 1 for second fragment, ...
  15713. * - APPEND
  15714. * Bit 20
  15715. * Purpose: indicates if this is the last fragment
  15716. * value: 0 = final fragment, 1 = more fragments will be appended
  15717. *
  15718. * channel and payload size field
  15719. * - MHZ
  15720. * Bits 15:0
  15721. * Purpose: indicates the channel primary frequency
  15722. * Value:
  15723. * - PAYLOAD_SIZE
  15724. * Bits 31:16
  15725. * Purpose: indicates the bytes of calibration data in payload
  15726. * Value:
  15727. *
  15728. * center frequency field
  15729. * - CENTER FREQUENCY 1
  15730. * Bits 15:0
  15731. * Purpose: indicates the channel center frequency
  15732. * Value: channel center frequency, in MHz units
  15733. * - CENTER FREQUENCY 2
  15734. * Bits 31:16
  15735. * Purpose: indicates the secondary channel center frequency,
  15736. * only for 11acvht 80plus80 mode
  15737. * Value: secondary channel center frequeny, in MHz units, if applicable
  15738. *
  15739. * checksum field
  15740. * - CHECK_SUM
  15741. * Bits 31:0
  15742. * Purpose: check the payload data, it is just for this fragment.
  15743. * This is intended for the target to check that the channel
  15744. * calibration data returned by the host is the unmodified data
  15745. * that was previously provided to the host by the target.
  15746. * value: checksum of fragment payload
  15747. */
  15748. PREPACK struct htt_chan_caldata_msg {
  15749. /* DWORD 0: message info */
  15750. A_UINT32
  15751. msg_type: 8,
  15752. sub_type: 4 ,
  15753. chksum_valid: 1, /** 1:valid, 0:invalid */
  15754. reserved1: 3,
  15755. frag_idx: 4, /** fragment index for calibration data */
  15756. appending: 1, /** 0: no fragment appending,
  15757. * 1: extra fragment appending */
  15758. reserved2: 11;
  15759. /* DWORD 1: channel and payload size */
  15760. A_UINT32
  15761. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  15762. payload_size: 16; /** unit: bytes */
  15763. /* DWORD 2: center frequency */
  15764. A_UINT32
  15765. band_center_freq1: 16, /** Center frequency 1 in MHz */
  15766. band_center_freq2: 16; /** Center frequency 2 in MHz,
  15767. * valid only for 11acvht 80plus80 mode */
  15768. /* DWORD 3: check sum */
  15769. A_UINT32 chksum;
  15770. /* variable length for calibration data */
  15771. A_UINT32 payload[1/* or more */];
  15772. } POSTPACK;
  15773. /* T2H SUBTYPE */
  15774. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  15775. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  15776. /* H2T SUBTYPE */
  15777. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  15778. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  15779. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  15780. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  15781. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  15782. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  15783. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  15784. do { \
  15785. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  15786. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  15787. } while (0)
  15788. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  15789. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  15790. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  15791. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  15792. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  15793. do { \
  15794. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  15795. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  15796. } while (0)
  15797. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  15798. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  15799. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  15800. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  15801. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  15802. do { \
  15803. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  15804. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  15805. } while (0)
  15806. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  15807. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  15808. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  15809. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  15810. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  15811. do { \
  15812. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  15813. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  15814. } while (0)
  15815. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  15816. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  15817. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  15818. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  15819. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  15820. do { \
  15821. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  15822. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  15823. } while (0)
  15824. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  15825. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  15826. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  15827. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  15828. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  15829. do { \
  15830. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  15831. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  15832. } while (0)
  15833. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  15834. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  15835. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  15836. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  15837. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  15838. do { \
  15839. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  15840. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  15841. } while (0)
  15842. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  15843. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  15844. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  15845. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  15846. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  15847. do { \
  15848. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  15849. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  15850. } while (0)
  15851. /**
  15852. * @brief target -> host FSE CMEM based send
  15853. *
  15854. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  15855. *
  15856. * @details
  15857. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  15858. * FSE placement in CMEM is enabled.
  15859. *
  15860. * This message sends the non-secure CMEM base address.
  15861. * It will be sent to host in response to message
  15862. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  15863. * The message would appear as follows:
  15864. *
  15865. * |31 24|23 16|15 8|7 0|
  15866. * |----------------+----------------+----------------+----------------|
  15867. * | reserved | num_entries | msg_type |
  15868. * |----------------+----------------+----------------+----------------|
  15869. * | base_address_lo |
  15870. * |----------------+----------------+----------------+----------------|
  15871. * | base_address_hi |
  15872. * |-------------------------------------------------------------------|
  15873. *
  15874. * The message is interpreted as follows:
  15875. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  15876. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  15877. * b'8:15 - number_entries: Indicated the number of entries
  15878. * programmed.
  15879. * b'16:31 - reserved.
  15880. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  15881. * CMEM base address
  15882. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  15883. * CMEM base address
  15884. */
  15885. PREPACK struct htt_cmem_base_send_t {
  15886. A_UINT32 msg_type: 8,
  15887. num_entries: 8,
  15888. reserved: 16;
  15889. A_UINT32 base_address_lo;
  15890. A_UINT32 base_address_hi;
  15891. } POSTPACK;
  15892. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  15893. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  15894. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  15895. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  15896. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  15897. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  15898. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  15899. do { \
  15900. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  15901. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15902. } while (0)
  15903. /**
  15904. * @brief - HTT PPDU ID format
  15905. *
  15906. * @details
  15907. * The following field definitions describe the format of the PPDU ID.
  15908. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  15909. *
  15910. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  15911. * +--------------------------------------------------------------------------
  15912. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  15913. * +--------------------------------------------------------------------------
  15914. *
  15915. * sch id :Schedule command id
  15916. * Bits [11 : 0] : monotonically increasing counter to track the
  15917. * PPDU posted to a specific transmit queue.
  15918. *
  15919. * hwq_id: Hardware Queue ID.
  15920. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  15921. *
  15922. * mac_id: MAC ID
  15923. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  15924. *
  15925. * seq_idx: Sequence index.
  15926. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  15927. * a particular TXOP.
  15928. *
  15929. * tqm_cmd: HWSCH/TQM flag.
  15930. * Bit [23] : Always set to 0.
  15931. *
  15932. * seq_cmd_type: Sequence command type.
  15933. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  15934. * Refer to enum HTT_STATS_FTYPE for values.
  15935. */
  15936. PREPACK struct htt_ppdu_id {
  15937. A_UINT32
  15938. sch_id: 12,
  15939. hwq_id: 5,
  15940. mac_id: 2,
  15941. seq_idx: 2,
  15942. reserved1: 2,
  15943. tqm_cmd: 1,
  15944. seq_cmd_type: 6,
  15945. reserved2: 2;
  15946. } POSTPACK;
  15947. #define HTT_PPDU_ID_SCH_ID_S 0
  15948. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  15949. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  15950. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  15951. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  15952. do { \
  15953. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  15954. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  15955. } while (0)
  15956. #define HTT_PPDU_ID_HWQ_ID_S 12
  15957. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  15958. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  15959. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  15960. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  15961. do { \
  15962. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  15963. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  15964. } while (0)
  15965. #define HTT_PPDU_ID_MAC_ID_S 17
  15966. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  15967. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  15968. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  15969. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  15970. do { \
  15971. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  15972. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  15973. } while (0)
  15974. #define HTT_PPDU_ID_SEQ_IDX_S 19
  15975. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  15976. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  15977. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  15978. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  15979. do { \
  15980. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  15981. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  15982. } while (0)
  15983. #define HTT_PPDU_ID_TQM_CMD_S 23
  15984. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  15985. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  15986. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  15987. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  15988. do { \
  15989. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  15990. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  15991. } while (0)
  15992. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  15993. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  15994. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  15995. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  15996. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  15997. do { \
  15998. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  15999. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  16000. } while (0)
  16001. /**
  16002. * @brief target -> RX PEER METADATA V0 format
  16003. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16004. * message from target, and will confirm to the target which peer metadata
  16005. * version to use in the wmi_init message.
  16006. *
  16007. * The following diagram shows the format of the RX PEER METADATA.
  16008. *
  16009. * |31 24|23 16|15 8|7 0|
  16010. * |-----------------------------------------------------------------------|
  16011. * | Reserved | VDEV ID | PEER ID |
  16012. * |-----------------------------------------------------------------------|
  16013. */
  16014. PREPACK struct htt_rx_peer_metadata_v0 {
  16015. A_UINT32
  16016. peer_id: 16,
  16017. vdev_id: 8,
  16018. reserved1: 8;
  16019. } POSTPACK;
  16020. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16021. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16022. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16023. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16024. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16025. do { \
  16026. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16027. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16028. } while (0)
  16029. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16030. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16031. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16032. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16033. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16034. do { \
  16035. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16036. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16037. } while (0)
  16038. /**
  16039. * @brief target -> RX PEER METADATA V1 format
  16040. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16041. * message from target, and will confirm to the target which peer metadata
  16042. * version to use in the wmi_init message.
  16043. *
  16044. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16045. *
  16046. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16047. * |-----------------------------------------------------------------------|
  16048. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  16049. * |-----------------------------------------------------------------------|
  16050. */
  16051. PREPACK struct htt_rx_peer_metadata_v1 {
  16052. A_UINT32
  16053. peer_id: 13,
  16054. ml_peer_valid: 1,
  16055. reserved1: 2,
  16056. vdev_id: 8,
  16057. lmac_id: 2,
  16058. chip_id: 3,
  16059. reserved2: 3;
  16060. } POSTPACK;
  16061. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16062. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16063. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16064. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16065. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16066. do { \
  16067. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16068. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16069. } while (0)
  16070. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16071. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16072. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16073. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16074. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16075. do { \
  16076. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16077. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16078. } while (0)
  16079. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16080. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16081. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16082. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16083. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16084. do { \
  16085. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16086. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16087. } while (0)
  16088. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16089. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16090. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16091. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16092. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16093. do { \
  16094. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16095. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16096. } while (0)
  16097. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16098. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16099. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16100. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16101. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16102. do { \
  16103. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16104. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16105. } while (0)
  16106. /*
  16107. * In some systems, the host SW wants to specify priorities between
  16108. * different MSDU / flow queues within the same peer-TID.
  16109. * The below enums are used for the host to identify to the target
  16110. * which MSDU queue's priority it wants to adjust.
  16111. */
  16112. /*
  16113. * The MSDUQ index describe index of TCL HW, where each index is
  16114. * used for queuing particular types of MSDUs.
  16115. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16116. */
  16117. enum HTT_MSDUQ_INDEX {
  16118. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16119. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16120. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16121. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16122. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16123. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16124. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16125. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16126. HTT_MSDUQ_MAX_INDEX,
  16127. };
  16128. /* MSDU qtype definition */
  16129. enum HTT_MSDU_QTYPE {
  16130. /*
  16131. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16132. * relative priority. Instead, the relative priority of CRIT_0 versus
  16133. * CRIT_1 is controlled by the FW, through the configuration parameters
  16134. * it applies to the queues.
  16135. */
  16136. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16137. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16138. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16139. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16140. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16141. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16142. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16143. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16144. /* New MSDU_QTYPE should be added above this line */
  16145. /*
  16146. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16147. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16148. * any host/target message definitions. The QTYPE_MAX value can
  16149. * only be used internally within the host or within the target.
  16150. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16151. * it must regard the unexpected value as a default qtype value,
  16152. * or ignore it.
  16153. */
  16154. HTT_MSDU_QTYPE_MAX,
  16155. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16156. };
  16157. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16158. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16159. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16160. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16161. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16162. };
  16163. /**
  16164. * @brief target -> host mlo timestamp offset indication
  16165. *
  16166. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16167. *
  16168. * @details
  16169. * The following field definitions describe the format of the HTT target
  16170. * to host mlo timestamp offset indication message.
  16171. *
  16172. *
  16173. * |31 16|15 12|11 10|9 8|7 0 |
  16174. * |----------------------------------------------------------------------|
  16175. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16176. * |----------------------------------------------------------------------|
  16177. * | Sync time stamp lo in us |
  16178. * |----------------------------------------------------------------------|
  16179. * | Sync time stamp hi in us |
  16180. * |----------------------------------------------------------------------|
  16181. * | mlo time stamp offset lo in us |
  16182. * |----------------------------------------------------------------------|
  16183. * | mlo time stamp offset hi in us |
  16184. * |----------------------------------------------------------------------|
  16185. * | mlo time stamp offset clocks in clock ticks |
  16186. * |----------------------------------------------------------------------|
  16187. * |31 26|25 16|15 0 |
  16188. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16189. * | | compensation in clks | |
  16190. * |----------------------------------------------------------------------|
  16191. * |31 22|21 0 |
  16192. * | rsvd 3 | mlo time stamp comp timer period |
  16193. * |----------------------------------------------------------------------|
  16194. * The message is interpreted as follows:
  16195. *
  16196. * dword0 - b'0:7 - msg_type: This will be set to
  16197. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16198. * value: 0x28
  16199. *
  16200. * dword0 - b'9:8 - pdev_id
  16201. *
  16202. * dword0 - b'11:10 - chip_id
  16203. *
  16204. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16205. *
  16206. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16207. *
  16208. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16209. * which last sync interrupt was received
  16210. *
  16211. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16212. * which last sync interrupt was received
  16213. *
  16214. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16215. *
  16216. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16217. *
  16218. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16219. *
  16220. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16221. *
  16222. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16223. * for sub us resolution
  16224. *
  16225. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16226. *
  16227. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16228. * is applied, in us
  16229. *
  16230. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16231. */
  16232. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16233. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16234. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16235. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16236. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16237. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16238. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16239. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16240. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16241. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16242. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16243. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16244. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16245. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16246. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16247. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16248. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16249. do { \
  16250. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16251. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16252. } while (0)
  16253. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16254. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16255. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16256. do { \
  16257. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16258. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16259. } while (0)
  16260. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16261. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16262. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16263. do { \
  16264. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16265. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16266. } while (0)
  16267. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16268. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16269. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16270. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16271. do { \
  16272. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16273. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16274. } while (0)
  16275. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16276. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16277. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16278. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16279. do { \
  16280. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16281. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16282. } while (0)
  16283. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16284. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16285. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16286. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16287. do { \
  16288. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16289. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16290. } while (0)
  16291. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16292. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16293. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16294. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16295. do { \
  16296. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16297. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16298. } while (0)
  16299. typedef struct {
  16300. A_UINT32 msg_type: 8, /* bits 7:0 */
  16301. pdev_id: 2, /* bits 9:8 */
  16302. chip_id: 2, /* bits 11:10 */
  16303. reserved1: 4, /* bits 15:12 */
  16304. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16305. A_UINT32 sync_timestamp_lo_us;
  16306. A_UINT32 sync_timestamp_hi_us;
  16307. A_UINT32 mlo_timestamp_offset_lo_us;
  16308. A_UINT32 mlo_timestamp_offset_hi_us;
  16309. A_UINT32 mlo_timestamp_offset_clks;
  16310. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16311. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16312. reserved2: 6; /* bits 31:26 */
  16313. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16314. reserved3: 10; /* bits 31:22 */
  16315. } htt_t2h_mlo_offset_ind_t;
  16316. /*
  16317. * @brief target -> host VDEV TX RX STATS
  16318. *
  16319. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16320. *
  16321. * @details
  16322. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16323. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16324. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16325. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16326. * periodically by target even in the absence of any further HTT request
  16327. * messages from host.
  16328. *
  16329. * The message is formatted as follows:
  16330. *
  16331. * |31 16|15 8|7 0|
  16332. * |---------------------------------+----------------+----------------|
  16333. * | payload_size | pdev_id | msg_type |
  16334. * |---------------------------------+----------------+----------------|
  16335. * | reserved0 |
  16336. * |-------------------------------------------------------------------|
  16337. * | reserved1 |
  16338. * |-------------------------------------------------------------------|
  16339. * | reserved2 |
  16340. * |-------------------------------------------------------------------|
  16341. * | |
  16342. * | VDEV specific Tx Rx stats info |
  16343. * | |
  16344. * |-------------------------------------------------------------------|
  16345. *
  16346. * The message is interpreted as follows:
  16347. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16348. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16349. * b'8:15 - pdev_id
  16350. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16351. * message header fields (msg_type through reserved2)
  16352. * dword1 - b'0:31 - reserved0.
  16353. * dword2 - b'0:31 - reserved1.
  16354. * dword3 - b'0:31 - reserved2.
  16355. */
  16356. typedef struct {
  16357. A_UINT32 msg_type: 8,
  16358. pdev_id: 8,
  16359. payload_size: 16;
  16360. A_UINT32 reserved0;
  16361. A_UINT32 reserved1;
  16362. A_UINT32 reserved2;
  16363. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16364. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16365. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16366. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16367. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16368. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16369. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16370. do { \
  16371. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16372. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16373. } while (0)
  16374. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16375. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16376. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16377. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16378. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16379. do { \
  16380. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16381. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16382. } while (0)
  16383. /* SOC related stats */
  16384. typedef struct {
  16385. htt_tlv_hdr_t tlv_hdr;
  16386. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16387. * This can be due to either the peer is deleted or deletion is ongoing
  16388. * */
  16389. A_UINT32 inv_peers_msdu_drop_count_lo;
  16390. A_UINT32 inv_peers_msdu_drop_count_hi;
  16391. } htt_t2h_soc_txrx_stats_common_tlv;
  16392. /* VDEV HW Tx/Rx stats */
  16393. typedef struct {
  16394. htt_tlv_hdr_t tlv_hdr;
  16395. A_UINT32 vdev_id;
  16396. /* Rx msdu byte cnt */
  16397. A_UINT32 rx_msdu_byte_cnt_lo;
  16398. A_UINT32 rx_msdu_byte_cnt_hi;
  16399. /* Rx msdu cnt */
  16400. A_UINT32 rx_msdu_cnt_lo;
  16401. A_UINT32 rx_msdu_cnt_hi;
  16402. /* tx msdu byte cnt */
  16403. A_UINT32 tx_msdu_byte_cnt_lo;
  16404. A_UINT32 tx_msdu_byte_cnt_hi;
  16405. /* tx msdu cnt */
  16406. A_UINT32 tx_msdu_cnt_lo;
  16407. A_UINT32 tx_msdu_cnt_hi;
  16408. /* tx excessive retry discarded msdu cnt */
  16409. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16410. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16411. /* TX congestion ctrl msdu drop cnt */
  16412. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16413. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16414. /* discarded tx msdus cnt coz of time to live expiry */
  16415. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16416. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16417. /* tx excessive retry discarded msdu byte cnt */
  16418. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16419. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16420. /* TX congestion ctrl msdu drop byte cnt */
  16421. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16422. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16423. /* discarded tx msdus byte cnt coz of time to live expiry */
  16424. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16425. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16426. /* TQM bypass frame cnt */
  16427. A_UINT32 tqm_bypass_frame_cnt_lo;
  16428. A_UINT32 tqm_bypass_frame_cnt_hi;
  16429. /* TQM bypass byte cnt */
  16430. A_UINT32 tqm_bypass_byte_cnt_lo;
  16431. A_UINT32 tqm_bypass_byte_cnt_hi;
  16432. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16433. /*
  16434. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16435. *
  16436. * @details
  16437. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16438. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16439. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16440. * the default MSDU queues of each of the specified TIDs for the peer
  16441. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16442. * If the default MSDU queues of a given TID within the peer are not linked
  16443. * to a service class, the svc_class_id field for that TID will have a
  16444. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16445. * queues for that TID are not mapped to any service class.
  16446. *
  16447. * |31 16|15 8|7 0|
  16448. * |------------------------------+--------------+--------------|
  16449. * | peer ID | reserved | msg type |
  16450. * |------------------------------+--------------+------+-------|
  16451. * | reserved | svc class ID | TID |
  16452. * |------------------------------------------------------------|
  16453. * ...
  16454. * |------------------------------------------------------------|
  16455. * | reserved | svc class ID | TID |
  16456. * |------------------------------------------------------------|
  16457. * Header fields:
  16458. * dword0 - b'7:0 - msg_type: This will be set to
  16459. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16460. * b'31:16 - peer ID
  16461. * dword1 - b'7:0 - TID
  16462. * b'15:8 - svc class ID
  16463. * (dword2, etc. same format as dword1)
  16464. */
  16465. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16466. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16467. A_UINT32 msg_type :8,
  16468. reserved0 :8,
  16469. peer_id :16;
  16470. struct {
  16471. A_UINT32 tid :8,
  16472. svc_class_id :8,
  16473. reserved1 :16;
  16474. } tid_reports[1/*or more*/];
  16475. } POSTPACK;
  16476. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16477. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16478. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16479. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16480. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16481. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16482. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16483. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16484. do { \
  16485. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16486. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16487. } while (0)
  16488. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16489. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16490. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16491. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16492. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16493. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16494. do { \
  16495. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16496. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16497. } while (0)
  16498. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16499. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16500. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16501. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16502. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16503. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16504. do { \
  16505. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16506. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16507. } while (0)
  16508. /*
  16509. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16510. *
  16511. * @details
  16512. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16513. * flow if the flow is seen the associated service class is conveyed to the
  16514. * target via TCL Data Command. Target on the other hand internally creates the
  16515. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16516. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16517. * the newly created MSDUQ
  16518. *
  16519. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16520. * |------------------------------+------------------------+--------------|
  16521. * | peer ID | HTT qtype | msg type |
  16522. * |---------------------------------+--------------+--+---+-------+------|
  16523. * | reserved |AST list index|FO|WC | HLOS | remap|
  16524. * | | | | | TID | TID |
  16525. * |---------------------+------------------------------------------------|
  16526. * | reserved1 | tgt_opaque_id |
  16527. * |---------------------+------------------------------------------------|
  16528. *
  16529. * Header fields:
  16530. *
  16531. * dword0 - b'7:0 - msg_type: This will be set to
  16532. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16533. * b'15:8 - HTT qtype
  16534. * b'31:16 - peer ID
  16535. *
  16536. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16537. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16538. * hlos_tid : Common to Lithium and Beryllium
  16539. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16540. * TCL Data Command : Beryllium
  16541. * b10 - flow_override (FO), as sent by host in
  16542. * TCL Data Command: Beryllium
  16543. * b11:14 - ast_list_idx
  16544. * Array index into the list of extension AST entries
  16545. * (not the actual AST 16-bit index).
  16546. * The ast_list_idx is one-based, with the following
  16547. * range of values:
  16548. * - legacy targets supporting 16 user-defined
  16549. * MSDU queues: 1-2
  16550. * - legacy targets supporting 48 user-defined
  16551. * MSDU queues: 1-6
  16552. * - new targets: 0 (peer_id is used instead)
  16553. * Note that since ast_list_idx is one-based,
  16554. * the host will need to subtract 1 to use it as an
  16555. * index into a list of extension AST entries.
  16556. * b15:31 - reserved
  16557. *
  16558. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16559. * unique MSDUQ id in firmware
  16560. * b'24:31 - reserved1
  16561. */
  16562. PREPACK struct htt_t2h_sawf_msduq_event {
  16563. A_UINT32 msg_type : 8,
  16564. htt_qtype : 8,
  16565. peer_id :16;
  16566. A_UINT32 remap_tid : 4,
  16567. hlos_tid : 4,
  16568. who_classify_info_sel : 2,
  16569. flow_override : 1,
  16570. ast_list_idx : 4,
  16571. reserved :17;
  16572. A_UINT32 tgt_opaque_id :24,
  16573. reserved1 : 8;
  16574. } POSTPACK;
  16575. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16576. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16577. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16578. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16579. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16580. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16581. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16582. do { \
  16583. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16584. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16585. } while (0)
  16586. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16587. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16588. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16589. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16590. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16591. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16592. do { \
  16593. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16594. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16595. } while (0)
  16596. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16597. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16598. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16599. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16600. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16601. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16602. do { \
  16603. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16604. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16605. } while (0)
  16606. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16607. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16608. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16609. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16610. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16611. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16612. do { \
  16613. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16614. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16615. } while (0)
  16616. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16617. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16618. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16619. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16620. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16621. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16622. do { \
  16623. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16624. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16625. } while (0)
  16626. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  16627. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  16628. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  16629. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  16630. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  16631. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  16632. do { \
  16633. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  16634. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  16635. } while (0)
  16636. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  16637. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  16638. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  16639. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  16640. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  16641. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  16642. do { \
  16643. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  16644. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  16645. } while (0)
  16646. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  16647. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  16648. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  16649. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  16650. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  16651. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  16652. do { \
  16653. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  16654. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  16655. } while (0)
  16656. /**
  16657. * @brief target -> PPDU id format indication
  16658. *
  16659. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  16660. *
  16661. * @details
  16662. * The following field definitions describe the format of the HTT target
  16663. * to host PPDU ID format indication message.
  16664. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  16665. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  16666. * seq_idx :- Sequence control index of this PPDU.
  16667. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  16668. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  16669. * tqm_cmd:-
  16670. *
  16671. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  16672. * |--------------------------------------------------+------------------------|
  16673. * | rsvd0 | msg type |
  16674. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16675. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  16676. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16677. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  16678. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16679. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  16680. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16681. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  16682. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16683. * Where: OF = bit offset, NB = number of bits, V = valid
  16684. * The message is interpreted as follows:
  16685. *
  16686. * dword0 - b'7:0 - msg_type: This will be set to
  16687. * HTT_T2H_PPDU_ID_FMT_IND
  16688. * value: 0x30
  16689. *
  16690. * dword0 - b'31:8 - reserved
  16691. *
  16692. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  16693. *
  16694. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  16695. *
  16696. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  16697. *
  16698. * dword1 - b'15:11 - reserved for future use
  16699. *
  16700. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  16701. *
  16702. * dword1 - b'21:17 - number of bits in ring_id
  16703. *
  16704. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  16705. *
  16706. * dword1 - b'31:27 - reserved for future use
  16707. *
  16708. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  16709. *
  16710. * dword2 - b'5:1 - number of bits in sequence index
  16711. *
  16712. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  16713. *
  16714. * dword2 - b'15:11 - reserved for future use
  16715. *
  16716. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  16717. *
  16718. * dword2 - b'21:17 - number of bits in link_id
  16719. *
  16720. * dword2 - b'26:22 - offset of link_id (in number of bits)
  16721. *
  16722. * dword2 - b'31:27 - reserved for future use
  16723. *
  16724. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  16725. *
  16726. * dword3 - b'5:1 - number of bits in seq_cmd_type
  16727. *
  16728. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  16729. *
  16730. * dword3 - b'15:11 - reserved for future use
  16731. *
  16732. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  16733. *
  16734. * dword3 - b'21:17 - number of bits in tqm_cmd
  16735. *
  16736. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  16737. *
  16738. * dword3 - b'31:27 - reserved for future use
  16739. *
  16740. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  16741. *
  16742. * dword4 - b'5:1 - number of bits in mac_id
  16743. *
  16744. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  16745. *
  16746. * dword4 - b'15:11 - reserved for future use
  16747. *
  16748. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  16749. *
  16750. * dword4 - b'21:17 - number of bits in crc
  16751. *
  16752. * dword4 - b'26:22 - offset of crc (in number of bits)
  16753. *
  16754. * dword4 - b'31:27 - reserved for future use
  16755. *
  16756. */
  16757. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  16758. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  16759. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  16760. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  16761. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  16762. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  16763. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  16764. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  16765. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  16766. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  16767. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  16768. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  16769. /* macros for accessing lower 16 bits in dword */
  16770. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  16771. do { \
  16772. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  16773. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  16774. } while (0)
  16775. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  16776. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  16777. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  16778. do { \
  16779. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  16780. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  16781. } while (0)
  16782. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  16783. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  16784. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  16785. do { \
  16786. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  16787. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  16788. } while (0)
  16789. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  16790. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  16791. /* macros for accessing upper 16 bits in dword */
  16792. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  16793. do { \
  16794. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  16795. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  16796. } while (0)
  16797. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  16798. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  16799. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  16800. do { \
  16801. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  16802. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  16803. } while (0)
  16804. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  16805. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  16806. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  16807. do { \
  16808. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  16809. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  16810. } while (0)
  16811. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  16812. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  16813. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  16814. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  16815. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  16816. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  16817. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  16818. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  16819. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  16820. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  16821. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  16822. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  16823. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  16824. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  16825. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  16826. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  16827. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  16828. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  16829. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  16830. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  16831. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  16832. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  16833. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  16834. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  16835. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  16836. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  16837. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  16838. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  16839. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  16840. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  16841. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  16842. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  16843. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  16844. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  16845. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  16846. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  16847. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  16848. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  16849. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  16850. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  16851. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  16852. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  16853. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  16854. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  16855. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  16856. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  16857. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  16858. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  16859. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  16860. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  16861. /* offsets in number dwords */
  16862. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  16863. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  16864. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  16865. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  16866. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  16867. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  16868. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  16869. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  16870. typedef struct {
  16871. A_UINT32 msg_type: 8, /* bits 7:0 */
  16872. rsvd0: 24;/* bits 31:8 */
  16873. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  16874. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  16875. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  16876. rsvd1: 5, /* bits 15:11 */
  16877. ring_id_valid: 1, /* bits 16:16 */
  16878. ring_id_bits: 5, /* bits 21:17 */
  16879. ring_id_offset: 5, /* bits 26:22 */
  16880. rsvd2: 5; /* bits 31:27 */
  16881. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  16882. seq_idx_bits: 5, /* bits 5:1 */
  16883. seq_idx_offset: 5, /* bits 10:6 */
  16884. rsvd3: 5, /* bits 15:11 */
  16885. link_id_valid: 1, /* bits 16:16 */
  16886. link_id_bits: 5, /* bits 21:17 */
  16887. link_id_offset: 5, /* bits 26:22 */
  16888. rsvd4: 5; /* bits 31:27 */
  16889. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  16890. seq_cmd_type_bits: 5, /* bits 5:1 */
  16891. seq_cmd_type_offset: 5, /* bits 10:6 */
  16892. rsvd5: 5, /* bits 15:11 */
  16893. tqm_cmd_valid: 1, /* bits 16:16 */
  16894. tqm_cmd_bits: 5, /* bits 21:17 */
  16895. tqm_cmd_offset: 5, /* bits 26:12 */
  16896. rsvd6: 5; /* bits 31:27 */
  16897. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  16898. mac_id_bits: 5, /* bits 5:1 */
  16899. mac_id_offset: 5, /* bits 10:6 */
  16900. rsvd8: 5, /* bits 15:11 */
  16901. crc_valid: 1, /* bits 16:16 */
  16902. crc_bits: 5, /* bits 21:17 */
  16903. crc_offset: 5, /* bits 26:12 */
  16904. rsvd9: 5; /* bits 31:27 */
  16905. } htt_t2h_ppdu_id_fmt_ind_t;
  16906. #endif