htt.h 858 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697
  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. */
  228. #define HTT_CURRENT_VERSION_MAJOR 3
  229. #define HTT_CURRENT_VERSION_MINOR 106
  230. #define HTT_NUM_TX_FRAG_DESC 1024
  231. #define HTT_WIFI_IP_VERSION(x,y) ((x) == (y))
  232. #define HTT_CHECK_SET_VAL(field, val) \
  233. A_ASSERT(!((val) & ~((field ## _M) >> (field ## _S))))
  234. /* macros to assist in sign-extending fields from HTT messages */
  235. #define HTT_SIGN_BIT_MASK(field) \
  236. ((field ## _M + (1 << field ## _S)) >> 1)
  237. #define HTT_SIGN_BIT(_val, field) \
  238. (_val & HTT_SIGN_BIT_MASK(field))
  239. #define HTT_SIGN_BIT_UNSHIFTED(_val, field) \
  240. (HTT_SIGN_BIT(_val, field) >> field ## _S)
  241. #define HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field) \
  242. (HTT_SIGN_BIT_UNSHIFTED(_val, field) - 1)
  243. #define HTT_SIGN_BIT_EXTENSION(_val, field) \
  244. (~(HTT_SIGN_BIT_UNSHIFTED(_val, field) | \
  245. HTT_SIGN_BIT_UNSHIFTED_MINUS_ONE(_val, field)))
  246. #define HTT_SIGN_BIT_EXTENSION_MASK(_val, field) \
  247. (HTT_SIGN_BIT_EXTENSION(_val, field) & ~(field ## _M >> field ## _S))
  248. /*
  249. * TEMPORARY:
  250. * Provide HTT_H2T_MSG_TYPE_MGMT_TX as an alias for
  251. * DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX until all code
  252. * that refers to HTT_H2T_MSG_TYPE_MGMT_TX has been
  253. * updated.
  254. */
  255. #define HTT_H2T_MSG_TYPE_MGMT_TX DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX
  256. /*
  257. * TEMPORARY:
  258. * Provide HTT_T2H_MSG_TYPE_RC_UPDATE_IND as an alias for
  259. * DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND until all code
  260. * that refers to HTT_T2H_MSG_TYPE_RC_UPDATE_IND has been
  261. * updated.
  262. */
  263. #define HTT_T2H_MSG_TYPE_RC_UPDATE_IND DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND
  264. /**
  265. * htt_dbg_stats_type -
  266. * bit positions for each stats type within a stats type bitmask
  267. * The bitmask contains 24 bits.
  268. */
  269. enum htt_dbg_stats_type {
  270. HTT_DBG_STATS_WAL_PDEV_TXRX = 0, /* bit 0 -> 0x1 */
  271. HTT_DBG_STATS_RX_REORDER = 1, /* bit 1 -> 0x2 */
  272. HTT_DBG_STATS_RX_RATE_INFO = 2, /* bit 2 -> 0x4 */
  273. HTT_DBG_STATS_TX_PPDU_LOG = 3, /* bit 3 -> 0x8 */
  274. HTT_DBG_STATS_TX_RATE_INFO = 4, /* bit 4 -> 0x10 */
  275. HTT_DBG_STATS_TIDQ = 5, /* bit 5 -> 0x20 */
  276. HTT_DBG_STATS_TXBF_INFO = 6, /* bit 6 -> 0x40 */
  277. HTT_DBG_STATS_SND_INFO = 7, /* bit 7 -> 0x80 */
  278. HTT_DBG_STATS_ERROR_INFO = 8, /* bit 8 -> 0x100 */
  279. HTT_DBG_STATS_TX_SELFGEN_INFO = 9, /* bit 9 -> 0x200 */
  280. HTT_DBG_STATS_TX_MU_INFO = 10, /* bit 10 -> 0x400 */
  281. HTT_DBG_STATS_SIFS_RESP_INFO = 11, /* bit 11 -> 0x800 */
  282. HTT_DBG_STATS_RX_REMOTE_RING_BUFFER_INFO = 12, /* bit 12 -> 0x1000 */
  283. HTT_DBG_STATS_RX_RATE_INFO_V2 = 13, /* bit 13 -> 0x2000 */
  284. HTT_DBG_STATS_TX_RATE_INFO_V2 = 14, /* bit 14 -> 0x4000 */
  285. HTT_DBG_STATS_TXBF_MUSU_NDPA_PKT = 15, /* bit 15 -> 0x8000 */
  286. /* bits 16-23 currently reserved */
  287. /* keep this last */
  288. HTT_DBG_NUM_STATS
  289. };
  290. /*=== HTT option selection TLVs ===
  291. * Certain HTT messages have alternatives or options.
  292. * For such cases, the host and target need to agree on which option to use.
  293. * Option specification TLVs can be appended to the VERSION_REQ and
  294. * VERSION_CONF messages to select options other than the default.
  295. * These TLVs are entirely optional - if they are not provided, there is a
  296. * well-defined default for each option. If they are provided, they can be
  297. * provided in any order. Each TLV can be present or absent independent of
  298. * the presence / absence of other TLVs.
  299. *
  300. * The HTT option selection TLVs use the following format:
  301. * |31 16|15 8|7 0|
  302. * |---------------------------------+----------------+----------------|
  303. * | value (payload) | length | tag |
  304. * |-------------------------------------------------------------------|
  305. * The value portion need not be only 2 bytes; it can be extended by any
  306. * integer number of 4-byte units. The total length of the TLV, including
  307. * the tag and length fields, must be a multiple of 4 bytes. The length
  308. * field specifies the total TLV size in 4-byte units. Thus, the typical
  309. * TLV, with a 1-byte tag field, a 1-byte length field, and a 2-byte value
  310. * field, would store 0x1 in its length field, to show that the TLV occupies
  311. * a single 4-byte unit.
  312. */
  313. /*--- TLV header format - applies to all HTT option TLVs ---*/
  314. enum HTT_OPTION_TLV_TAGS {
  315. HTT_OPTION_TLV_TAG_RESERVED0 = 0x0,
  316. HTT_OPTION_TLV_TAG_LL_BUS_ADDR_SIZE = 0x1,
  317. HTT_OPTION_TLV_TAG_HL_SUPPRESS_TX_COMPL_IND = 0x2,
  318. HTT_OPTION_TLV_TAG_MAX_TX_QUEUE_GROUPS = 0x3,
  319. HTT_OPTION_TLV_TAG_SUPPORT_TX_MSDU_DESC_EXT = 0x4,
  320. /* TCL_METADATA_VER: added to support V2 and higher of the TCL Data Cmd */
  321. HTT_OPTION_TLV_TAG_TCL_METADATA_VER = 0x5,
  322. };
  323. #define HTT_TCL_METADATA_VER_SZ 4
  324. PREPACK struct htt_option_tlv_header_t {
  325. A_UINT8 tag;
  326. A_UINT8 length;
  327. } POSTPACK;
  328. #define HTT_OPTION_TLV_TAG_M 0x000000ff
  329. #define HTT_OPTION_TLV_TAG_S 0
  330. #define HTT_OPTION_TLV_LENGTH_M 0x0000ff00
  331. #define HTT_OPTION_TLV_LENGTH_S 8
  332. /*
  333. * value0 - 16 bit value field stored in word0
  334. * The TLV's value field may be longer than 2 bytes, in which case
  335. * the remainder of the value is stored in word1, word2, etc.
  336. */
  337. #define HTT_OPTION_TLV_VALUE0_M 0xffff0000
  338. #define HTT_OPTION_TLV_VALUE0_S 16
  339. #define HTT_OPTION_TLV_TAG_SET(word, tag) \
  340. do { \
  341. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_TAG, tag); \
  342. (word) |= ((tag) << HTT_OPTION_TLV_TAG_S); \
  343. } while (0)
  344. #define HTT_OPTION_TLV_TAG_GET(word) \
  345. (((word) & HTT_OPTION_TLV_TAG_M) >> HTT_OPTION_TLV_TAG_S)
  346. #define HTT_OPTION_TLV_LENGTH_SET(word, tag) \
  347. do { \
  348. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_LENGTH, tag); \
  349. (word) |= ((tag) << HTT_OPTION_TLV_LENGTH_S); \
  350. } while (0)
  351. #define HTT_OPTION_TLV_LENGTH_GET(word) \
  352. (((word) & HTT_OPTION_TLV_LENGTH_M) >> HTT_OPTION_TLV_LENGTH_S)
  353. #define HTT_OPTION_TLV_VALUE0_SET(word, tag) \
  354. do { \
  355. HTT_CHECK_SET_VAL(HTT_OPTION_TLV_VALUE0, tag); \
  356. (word) |= ((tag) << HTT_OPTION_TLV_VALUE0_S); \
  357. } while (0)
  358. #define HTT_OPTION_TLV_VALUE0_GET(word) \
  359. (((word) & HTT_OPTION_TLV_VALUE0_M) >> HTT_OPTION_TLV_VALUE0_S)
  360. /*--- format of specific HTT option TLVs ---*/
  361. /*
  362. * HTT option TLV for specifying LL bus address size
  363. * Some chips require bus addresses used by the target to access buffers
  364. * within the host's memory to be 32 bits; others require bus addresses
  365. * used by the target to access buffers within the host's memory to be
  366. * 64 bits.
  367. * The LL_BUS_ADDR_SIZE TLV can be sent from the target to the host as
  368. * a suffix to the VERSION_CONF message to specify which bus address format
  369. * the target requires.
  370. * If this LL_BUS_ADDR_SIZE TLV is not sent by the target, the host should
  371. * default to providing bus addresses to the target in 32-bit format.
  372. */
  373. enum HTT_OPTION_TLV_LL_BUS_ADDR_SIZE_VALUES {
  374. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE32 = 0x0,
  375. HTT_OPTION_TLV_LL_BUS_ADDR_SIZE64 = 0x1,
  376. };
  377. PREPACK struct htt_option_tlv_ll_bus_addr_size_t {
  378. struct htt_option_tlv_header_t hdr;
  379. A_UINT16 ll_bus_addr_size; /* LL_BUS_ADDR_SIZE_VALUES enum */
  380. } POSTPACK;
  381. /*
  382. * HTT option TLV for specifying whether HL systems should indicate
  383. * over-the-air tx completion for individual frames, or should instead
  384. * send a bulk TX_CREDIT_UPDATE_IND except when the host explicitly
  385. * requests an OTA tx completion for a particular tx frame.
  386. * This option does not apply to LL systems, where the TX_COMPL_IND
  387. * is mandatory.
  388. * This option is primarily intended for HL systems in which the tx frame
  389. * downloads over the host --> target bus are as slow as or slower than
  390. * the transmissions over the WLAN PHY. For cases where the bus is faster
  391. * than the WLAN PHY, the target will transmit relatively large A-MPDUs,
  392. * and consquently will send one TX_COMPL_IND message that covers several
  393. * tx frames. For cases where the WLAN PHY is faster than the bus,
  394. * the target will end up transmitting very short A-MPDUs, and consequently
  395. * sending many TX_COMPL_IND messages, which each cover a very small number
  396. * of tx frames.
  397. * The HL_SUPPRESS_TX_COMPL_IND TLV can be sent by the host to the target as
  398. * a suffix to the VERSION_REQ message to request whether the host desires to
  399. * use TX_CREDIT_UPDATE_IND rather than TX_COMPL_IND. The target can then
  400. * send a HTT_SUPPRESS_TX_COMPL_IND TLV to the host as a suffix to the
  401. * VERSION_CONF message to confirm whether TX_CREDIT_UPDATE_IND will be used
  402. * rather than TX_COMPL_IND. TX_CREDIT_UPDATE_IND shall only be used if the
  403. * host sends a HL_SUPPRESS_TX_COMPL_IND TLV requesting use of
  404. * TX_CREDIT_UPDATE_IND, and the target sends a HL_SUPPRESS_TX_COMPLE_IND TLV
  405. * back to the host confirming use of TX_CREDIT_UPDATE_IND.
  406. * Lack of a HL_SUPPRESS_TX_COMPL_IND TLV from either host --> target or
  407. * target --> host is equivalent to a HL_SUPPRESS_TX_COMPL_IND that
  408. * explicitly specifies HL_ALLOW_TX_COMPL_IND in the value payload of the
  409. * TLV.
  410. */
  411. enum HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND_VALUES {
  412. HTT_OPTION_TLV_HL_ALLOW_TX_COMPL_IND = 0x0,
  413. HTT_OPTION_TLV_HL_SUPPRESS_TX_COMPL_IND = 0x1,
  414. };
  415. PREPACK struct htt_option_tlv_hl_suppress_tx_compl_ind_t {
  416. struct htt_option_tlv_header_t hdr;
  417. A_UINT16 hl_suppress_tx_compl_ind; /* HL_SUPPRESS_TX_COMPL_IND enum */
  418. } POSTPACK;
  419. /*
  420. * HTT option TLV for specifying how many tx queue groups the target
  421. * may establish.
  422. * This TLV specifies the maximum value the target may send in the
  423. * txq_group_id field of any TXQ_GROUP information elements sent by
  424. * the target to the host. This allows the host to pre-allocate an
  425. * appropriate number of tx queue group structs.
  426. *
  427. * The MAX_TX_QUEUE_GROUPS_TLV can be sent from the host to the target as
  428. * a suffix to the VERSION_REQ message to specify whether the host supports
  429. * tx queue groups at all, and if so if there is any limit on the number of
  430. * tx queue groups that the host supports.
  431. * The MAX_TX_QUEUE_GROUPS TLV can be sent from the target to the host as
  432. * a suffix to the VERSION_CONF message. If the host has specified in the
  433. * VER_REQ message a limit on the number of tx queue groups the host can
  434. * supprt, the target shall limit its specification of the maximum tx groups
  435. * to be no larger than this host-specified limit.
  436. *
  437. * If the target does not provide a MAX_TX_QUEUE_GROUPS TLV, then the host
  438. * shall preallocate 4 tx queue group structs, and the target shall not
  439. * specify a txq_group_id larger than 3.
  440. */
  441. enum HTT_OPTION_TLV_MAX_TX_QUEUE_GROUPS_VALUES {
  442. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNSUPPORTED = 0,
  443. /*
  444. * values 1 through N specify the max number of tx queue groups
  445. * the sender supports
  446. */
  447. HTT_OPTION_TLV_TX_QUEUE_GROUPS_UNLIMITED = 0xffff,
  448. };
  449. /* TEMPORARY backwards-compatibility alias for a typo fix -
  450. * The htt_option_tlv_mac_tx_queue_groups_t typo has been corrected
  451. * to htt_option_tlv_max_tx_queue_groups_t, but an alias is provided
  452. * to support the old name (with the typo) until all references to the
  453. * old name are replaced with the new name.
  454. */
  455. #define htt_option_tlv_mac_tx_queue_groups_t htt_option_tlv_max_tx_queue_groups_t
  456. PREPACK struct htt_option_tlv_max_tx_queue_groups_t {
  457. struct htt_option_tlv_header_t hdr;
  458. A_UINT16 max_tx_queue_groups; /* max txq_group_id + 1 */
  459. } POSTPACK;
  460. /*
  461. * HTT option TLV for specifying whether the target supports an extended
  462. * version of the HTT tx descriptor. If the target provides this TLV
  463. * and specifies in the TLV that the target supports an extended version
  464. * of the HTT tx descriptor, the target must check the "extension" bit in
  465. * the HTT tx descriptor, and if the extension bit is set, to expect a
  466. * HTT tx MSDU extension descriptor immediately following the HTT tx MSDU
  467. * descriptor. Furthermore, the target must provide room for the HTT
  468. * tx MSDU extension descriptor in the target's TX_FRM buffer.
  469. * This option is intended for systems where the host needs to explicitly
  470. * control the transmission parameters such as tx power for individual
  471. * tx frames.
  472. * The SUPPORT_TX_MSDU_DESC_EXT TLB can be sent by the target to the host
  473. * as a suffix to the VERSION_CONF message to explicitly specify whether
  474. * the target supports the HTT tx MSDU extension descriptor.
  475. * Lack of a SUPPORT_TX_MSDU_DESC_EXT from the target shall be interpreted
  476. * by the host as lack of target support for the HTT tx MSDU extension
  477. * descriptor; the host shall provide HTT tx MSDU extension descriptors in
  478. * the HTT_H2T TX_FRM messages only if the target indicates it supports
  479. * the HTT tx MSDU extension descriptor.
  480. * The host is not required to provide the HTT tx MSDU extension descriptor
  481. * just because the target supports it; the target must check the
  482. * "extension" bit in the HTT tx MSDU descriptor to determine whether an
  483. * extension descriptor is present.
  484. */
  485. enum HTT_OPTION_TLV_SUPPORT_TX_MSDU_DESC_EXT_VALUES {
  486. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_NO_SUPPORT = 0x0,
  487. HTT_OPTION_TLV_TX_MSDU_DESC_EXT_SUPPORT = 0x1,
  488. };
  489. PREPACK struct htt_option_tlv_support_tx_msdu_desc_ext_t {
  490. struct htt_option_tlv_header_t hdr;
  491. A_UINT16 tx_msdu_desc_ext_support; /* SUPPORT_TX_MSDU_DESC_EXT enum */
  492. } POSTPACK;
  493. /*
  494. * For the tcl data command V2 and higher support added a new
  495. * version tag HTT_OPTION_TLV_TAG_TCL_METADATA_VER.
  496. * This will be used as a TLV in HTT_H2T_MSG_TYPE_VERSION_REQ and
  497. * HTT_T2H_MSG_TYPE_VERSION_CONF.
  498. * HTT option TLV for specifying which version of the TCL metadata struct
  499. * should be used:
  500. * V1 -> use htt_tx_tcl_metadata struct
  501. * V2 -> use htt_tx_tcl_metadata_v2 struct
  502. * Old FW will only support V1.
  503. * New FW will support V2. New FW will still support V1, at least during
  504. * a transition period.
  505. * Similarly, old host will only support V1, and new host will support V1 + V2.
  506. *
  507. * The host can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  508. * HTT_H2T_MSG_TYPE_VERSION_REQ to indicate to the target which version(s)
  509. * of TCL metadata the host supports. If the host doesn't provide a
  510. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_REQ message, it
  511. * is implicitly understood that the host only supports V1.
  512. * The target can provide a HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the
  513. * HTT_T2H_MSG_TYPE_VERSION_CONF to indicate which version of TCL metadata
  514. * the host shall use. The target shall only select one of the versions
  515. * supported by the host. If the target doesn't provide a
  516. * HTT_OPTION_TLV_TAG_TCL_METADATA_VER in the VERSION_CONF message, it
  517. * is implicitly understood that the V1 TCL metadata shall be used.
  518. */
  519. enum HTT_OPTION_TLV_TCL_METADATA_VER_VALUES {
  520. HTT_OPTION_TLV_TCL_METADATA_V1 = 1,
  521. HTT_OPTION_TLV_TCL_METADATA_V2 = 2,
  522. };
  523. PREPACK struct htt_option_tlv_tcl_metadata_ver_t {
  524. struct htt_option_tlv_header_t hdr;
  525. A_UINT16 tcl_metadata_ver; /* TCL_METADATA_VER_VALUES enum */
  526. } POSTPACK;
  527. #define HTT_OPTION_TLV_TCL_METADATA_VER_SET(word, value) \
  528. HTT_OPTION_TLV_VALUE0_SET(word, value)
  529. #define HTT_OPTION_TLV_TCL_METADATA_VER_GET(word) \
  530. HTT_OPTION_TLV_VALUE0_GET(word)
  531. typedef struct {
  532. union {
  533. /* BIT [11 : 0] :- tag
  534. * BIT [23 : 12] :- length
  535. * BIT [31 : 24] :- reserved
  536. */
  537. A_UINT32 tag__length;
  538. /*
  539. * The following struct is not endian-portable.
  540. * It is suitable for use within the target, which is known to be
  541. * little-endian.
  542. * The host should use the above endian-portable macros to access
  543. * the tag and length bitfields in an endian-neutral manner.
  544. */
  545. struct {
  546. A_UINT32 tag : 12, /* BIT [11 : 0] */
  547. length : 12, /* BIT [23 : 12] */
  548. reserved : 8; /* BIT [31 : 24] */
  549. };
  550. };
  551. } htt_tlv_hdr_t;
  552. /** HTT stats TLV tag values */
  553. typedef enum {
  554. HTT_STATS_TX_PDEV_CMN_TAG = 0, /* htt_tx_pdev_stats_cmn_tlv */
  555. HTT_STATS_TX_PDEV_UNDERRUN_TAG = 1, /* htt_tx_pdev_stats_urrn_tlv_v */
  556. HTT_STATS_TX_PDEV_SIFS_TAG = 2, /* htt_tx_pdev_stats_sifs_tlv_v */
  557. HTT_STATS_TX_PDEV_FLUSH_TAG = 3, /* htt_tx_pdev_stats_flush_tlv_v */
  558. HTT_STATS_TX_PDEV_PHY_ERR_TAG = 4, /* htt_tx_pdev_stats_phy_err_tlv_v */
  559. HTT_STATS_STRING_TAG = 5, /* htt_stats_string_tlv */
  560. HTT_STATS_TX_HWQ_CMN_TAG = 6, /* htt_tx_hwq_stats_cmn_tlv */
  561. HTT_STATS_TX_HWQ_DIFS_LATENCY_TAG = 7, /* htt_tx_hwq_difs_latency_stats_tlv_v */
  562. HTT_STATS_TX_HWQ_CMD_RESULT_TAG = 8, /* htt_tx_hwq_cmd_result_stats_tlv_v */
  563. HTT_STATS_TX_HWQ_CMD_STALL_TAG = 9, /* htt_tx_hwq_cmd_stall_stats_tlv_v */
  564. HTT_STATS_TX_HWQ_FES_STATUS_TAG = 10, /* htt_tx_hwq_fes_result_stats_tlv_v */
  565. HTT_STATS_TX_TQM_GEN_MPDU_TAG = 11, /* htt_tx_tqm_gen_mpdu_stats_tlv_v */
  566. HTT_STATS_TX_TQM_LIST_MPDU_TAG = 12, /* htt_tx_tqm_list_mpdu_stats_tlv_v */
  567. HTT_STATS_TX_TQM_LIST_MPDU_CNT_TAG = 13, /* htt_tx_tqm_list_mpdu_cnt_tlv_v */
  568. HTT_STATS_TX_TQM_CMN_TAG = 14, /* htt_tx_tqm_cmn_stats_tlv */
  569. HTT_STATS_TX_TQM_PDEV_TAG = 15, /* htt_tx_tqm_pdev_stats_tlv_v */
  570. HTT_STATS_TX_TQM_CMDQ_STATUS_TAG = 16, /* htt_tx_tqm_cmdq_status_tlv */
  571. HTT_STATS_TX_DE_EAPOL_PACKETS_TAG = 17, /* htt_tx_de_eapol_packets_stats_tlv */
  572. HTT_STATS_TX_DE_CLASSIFY_FAILED_TAG = 18, /* htt_tx_de_classify_failed_stats_tlv */
  573. HTT_STATS_TX_DE_CLASSIFY_STATS_TAG = 19, /* htt_tx_de_classify_stats_tlv */
  574. HTT_STATS_TX_DE_CLASSIFY_STATUS_TAG = 20, /* htt_tx_de_classify_status_stats_tlv */
  575. HTT_STATS_TX_DE_ENQUEUE_PACKETS_TAG = 21, /* htt_tx_de_enqueue_packets_stats_tlv */
  576. HTT_STATS_TX_DE_ENQUEUE_DISCARD_TAG = 22, /* htt_tx_de_enqueue_discard_stats_tlv */
  577. HTT_STATS_TX_DE_CMN_TAG = 23, /* htt_tx_de_cmn_stats_tlv */
  578. HTT_STATS_RING_IF_TAG = 24, /* htt_ring_if_stats_tlv */
  579. HTT_STATS_TX_PDEV_MU_MIMO_STATS_TAG = 25, /* htt_tx_pdev_mu_mimo_sch_stats_tlv */
  580. HTT_STATS_SFM_CMN_TAG = 26, /* htt_sfm_cmn_tlv */
  581. HTT_STATS_SRING_STATS_TAG = 27, /* htt_sring_stats_tlv */
  582. HTT_STATS_RX_PDEV_FW_STATS_TAG = 28, /* htt_rx_pdev_fw_stats_tlv */
  583. HTT_STATS_RX_PDEV_FW_RING_MPDU_ERR_TAG = 29, /* htt_rx_pdev_fw_ring_mpdu_err_tlv_v */
  584. HTT_STATS_RX_PDEV_FW_MPDU_DROP_TAG = 30, /* htt_rx_pdev_fw_mpdu_drop_tlv_v */
  585. HTT_STATS_RX_SOC_FW_STATS_TAG = 31, /* htt_rx_soc_fw_stats_tlv */
  586. HTT_STATS_RX_SOC_FW_REFILL_RING_EMPTY_TAG = 32, /* htt_rx_soc_fw_refill_ring_empty_tlv_v */
  587. HTT_STATS_RX_SOC_FW_REFILL_RING_NUM_REFILL_TAG = 33, /* htt_rx_soc_fw_refill_ring_num_refill_tlv_v */
  588. HTT_STATS_TX_PDEV_RATE_STATS_TAG = 34, /* htt_tx_pdev_rate_stats_tlv */
  589. HTT_STATS_RX_PDEV_RATE_STATS_TAG = 35, /* htt_rx_pdev_rate_stats_tlv */
  590. HTT_STATS_TX_PDEV_SCHEDULER_TXQ_STATS_TAG = 36, /* htt_tx_pdev_stats_sched_per_txq_tlv */
  591. HTT_STATS_TX_SCHED_CMN_TAG = 37, /* htt_stats_tx_sched_cmn_tlv */
  592. HTT_STATS_TX_PDEV_MUMIMO_MPDU_STATS_TAG = 38, /* htt_tx_pdev_mu_mimo_mpdu_stats_tlv */
  593. HTT_STATS_SCHED_TXQ_CMD_POSTED_TAG = 39, /* htt_sched_txq_cmd_posted_tlv_v */
  594. HTT_STATS_RING_IF_CMN_TAG = 40, /* htt_ring_if_cmn_tlv */
  595. HTT_STATS_SFM_CLIENT_USER_TAG = 41, /* htt_sfm_client_user_tlv_v */
  596. HTT_STATS_SFM_CLIENT_TAG = 42, /* htt_sfm_client_tlv */
  597. HTT_STATS_TX_TQM_ERROR_STATS_TAG = 43, /* htt_tx_tqm_error_stats_tlv */
  598. HTT_STATS_SCHED_TXQ_CMD_REAPED_TAG = 44, /* htt_sched_txq_cmd_reaped_tlv_v */
  599. HTT_STATS_SRING_CMN_TAG = 45, /* htt_sring_cmn_tlv */
  600. HTT_STATS_TX_SELFGEN_AC_ERR_STATS_TAG = 46, /* htt_tx_selfgen_ac_err_stats_tlv */
  601. HTT_STATS_TX_SELFGEN_CMN_STATS_TAG = 47, /* htt_tx_selfgen_cmn_stats_tlv */
  602. HTT_STATS_TX_SELFGEN_AC_STATS_TAG = 48, /* htt_tx_selfgen_ac_stats_tlv */
  603. HTT_STATS_TX_SELFGEN_AX_STATS_TAG = 49, /* htt_tx_selfgen_ax_stats_tlv */
  604. HTT_STATS_TX_SELFGEN_AX_ERR_STATS_TAG = 50, /* htt_tx_selfgen_ax_err_stats_tlv */
  605. HTT_STATS_TX_HWQ_MUMIMO_SCH_STATS_TAG = 51, /* htt_tx_hwq_mu_mimo_sch_stats_tlv */
  606. HTT_STATS_TX_HWQ_MUMIMO_MPDU_STATS_TAG = 52, /* htt_tx_hwq_mu_mimo_mpdu_stats_tlv */
  607. HTT_STATS_TX_HWQ_MUMIMO_CMN_STATS_TAG = 53, /* htt_tx_hwq_mu_mimo_cmn_stats_tlv */
  608. HTT_STATS_HW_INTR_MISC_TAG = 54, /* htt_hw_stats_intr_misc_tlv */
  609. HTT_STATS_HW_WD_TIMEOUT_TAG = 55, /* htt_hw_stats_wd_timeout_tlv */
  610. HTT_STATS_HW_PDEV_ERRS_TAG = 56, /* htt_hw_stats_pdev_errs_tlv */
  611. HTT_STATS_COUNTER_NAME_TAG = 57, /* htt_counter_tlv */
  612. HTT_STATS_TX_TID_DETAILS_TAG = 58, /* htt_tx_tid_stats_tlv */
  613. HTT_STATS_RX_TID_DETAILS_TAG = 59, /* htt_rx_tid_stats_tlv */
  614. HTT_STATS_PEER_STATS_CMN_TAG = 60, /* htt_peer_stats_cmn_tlv */
  615. HTT_STATS_PEER_DETAILS_TAG = 61, /* htt_peer_details_tlv */
  616. HTT_STATS_PEER_TX_RATE_STATS_TAG = 62, /* htt_tx_peer_rate_stats_tlv */
  617. HTT_STATS_PEER_RX_RATE_STATS_TAG = 63, /* htt_rx_peer_rate_stats_tlv */
  618. HTT_STATS_PEER_MSDU_FLOWQ_TAG = 64, /* htt_msdu_flow_stats_tlv */
  619. HTT_STATS_TX_DE_COMPL_STATS_TAG = 65, /* htt_tx_de_compl_stats_tlv */
  620. HTT_STATS_WHAL_TX_TAG = 66, /* htt_hw_stats_whal_tx_tlv */
  621. HTT_STATS_TX_PDEV_SIFS_HIST_TAG = 67, /* htt_tx_pdev_stats_sifs_hist_tlv_v */
  622. HTT_STATS_RX_PDEV_FW_STATS_PHY_ERR_TAG = 68, /* htt_rx_pdev_fw_stats_phy_err_tlv */
  623. HTT_STATS_TX_TID_DETAILS_V1_TAG = 69, /* htt_tx_tid_stats_v1_tlv */
  624. HTT_STATS_PDEV_CCA_1SEC_HIST_TAG = 70, /* htt_pdev_cca_stats_hist_tlv (for 1 sec interval stats) */
  625. HTT_STATS_PDEV_CCA_100MSEC_HIST_TAG = 71, /* htt_pdev_cca_stats_hist_tlv (for 100 msec interval stats) */
  626. HTT_STATS_PDEV_CCA_STAT_CUMULATIVE_TAG = 72, /* htt_pdev_stats_cca_stats_tlv */
  627. HTT_STATS_PDEV_CCA_COUNTERS_TAG = 73, /* htt_pdev_stats_cca_counters_tlv */
  628. HTT_STATS_TX_PDEV_MPDU_STATS_TAG = 74, /* htt_tx_pdev_mpdu_stats_tlv */
  629. HTT_STATS_PDEV_TWT_SESSIONS_TAG = 75, /* htt_pdev_stats_twt_sessions_tlv */
  630. HTT_STATS_PDEV_TWT_SESSION_TAG = 76, /* htt_pdev_stats_twt_session_tlv */
  631. HTT_STATS_RX_REFILL_RXDMA_ERR_TAG = 77, /* htt_rx_soc_fw_refill_ring_num_rxdma_err_tlv_v */
  632. HTT_STATS_RX_REFILL_REO_ERR_TAG = 78, /* htt_rx_soc_fw_refill_ring_num_reo_err_tlv_v */
  633. HTT_STATS_RX_REO_RESOURCE_STATS_TAG = 79, /* htt_rx_reo_debug_stats_tlv_v */
  634. HTT_STATS_TX_SOUNDING_STATS_TAG = 80, /* htt_tx_sounding_stats_tlv */
  635. HTT_STATS_TX_PDEV_TX_PPDU_STATS_TAG = 81, /* htt_tx_pdev_stats_tx_ppdu_stats_tlv_v */
  636. HTT_STATS_TX_PDEV_TRIED_MPDU_CNT_HIST_TAG = 82, /* htt_tx_pdev_stats_tried_mpdu_cnt_hist_tlv_v */
  637. HTT_STATS_TX_HWQ_TRIED_MPDU_CNT_HIST_TAG = 83, /* htt_tx_hwq_tried_mpdu_cnt_hist_tlv_v */
  638. HTT_STATS_TX_HWQ_TXOP_USED_CNT_HIST_TAG = 84, /* htt_tx_hwq_txop_used_cnt_hist_tlv_v */
  639. HTT_STATS_TX_DE_FW2WBM_RING_FULL_HIST_TAG = 85, /* htt_tx_de_fw2wbm_ring_full_hist_tlv */
  640. HTT_STATS_SCHED_TXQ_SCHED_ORDER_SU_TAG = 86, /* htt_sched_txq_sched_order_su_tlv */
  641. HTT_STATS_SCHED_TXQ_SCHED_INELIGIBILITY_TAG = 87, /* htt_sched_txq_sched_eligibility_tlv */
  642. HTT_STATS_PDEV_OBSS_PD_TAG = 88, /* htt_pdev_obss_pd_stats_tlv */
  643. HTT_STATS_HW_WAR_TAG = 89, /* htt_hw_war_stats_tlv */
  644. HTT_STATS_RING_BACKPRESSURE_STATS_TAG = 90, /* htt_ring_backpressure_stats_tlv */
  645. HTT_STATS_LATENCY_PROF_STATS_TAG = 91, /* htt_latency_prof_stats_tlv */
  646. HTT_STATS_LATENCY_CTX_TAG = 92, /* htt_latency_prof_ctx_tlv */
  647. HTT_STATS_LATENCY_CNT_TAG = 93, /* htt_latency_prof_cnt_tlv */
  648. HTT_STATS_RX_PDEV_UL_TRIG_STATS_TAG = 94, /* htt_rx_pdev_ul_trigger_stats_tlv */
  649. HTT_STATS_RX_PDEV_UL_OFDMA_USER_STATS_TAG = 95, /* htt_rx_pdev_ul_ofdma_user_stats_tlv */
  650. HTT_STATS_RX_PDEV_UL_MIMO_USER_STATS_TAG = 96, /* htt_rx_pdev_ul_mimo_user_stats_tlv */
  651. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_STATS_TAG = 97, /* htt_rx_pdev_ul_mumimo_trig_stats_tlv */
  652. HTT_STATS_RX_FSE_STATS_TAG = 98, /* htt_rx_fse_stats_tlv */
  653. HTT_STATS_PEER_SCHED_STATS_TAG = 99, /* htt_peer_sched_stats_tlv */
  654. HTT_STATS_SCHED_TXQ_SUPERCYCLE_TRIGGER_TAG = 100, /* htt_sched_txq_supercycle_triggers_tlv_v */
  655. HTT_STATS_PEER_CTRL_PATH_TXRX_STATS_TAG = 101, /* htt_peer_ctrl_path_txrx_stats_tlv */
  656. HTT_STATS_PDEV_CTRL_PATH_TX_STATS_TAG = 102, /* htt_pdev_ctrl_path_tx_stats_tlv */
  657. HTT_STATS_RX_PDEV_RATE_EXT_STATS_TAG = 103, /* htt_rx_pdev_rate_ext_stats_tlv */
  658. HTT_STATS_TX_PDEV_DL_MU_MIMO_STATS_TAG = 104, /* htt_tx_pdev_dl_mu_mimo_sch_stats_tlv */
  659. HTT_STATS_TX_PDEV_UL_MU_MIMO_STATS_TAG = 105, /* htt_tx_pdev_ul_mu_mimo_sch_stats_tlv */
  660. HTT_STATS_TX_PDEV_DL_MU_OFDMA_STATS_TAG = 106, /* htt_tx_pdev_dl_mu_ofdma_sch_stats_tlv */
  661. HTT_STATS_TX_PDEV_UL_MU_OFDMA_STATS_TAG = 107, /* htt_tx_pdev_ul_mu_ofdma_sch_stats_tlv */
  662. HTT_STATS_PDEV_TX_RATE_TXBF_STATS_TAG = 108, /* htt_tx_peer_rate_txbf_stats_tlv */
  663. HTT_STATS_UNSUPPORTED_ERROR_STATS_TAG = 109, /* htt_stats_error_tlv_v */
  664. HTT_STATS_UNAVAILABLE_ERROR_STATS_TAG = 110, /* htt_stats_error_tlv_v */
  665. HTT_STATS_TX_SELFGEN_AC_SCHED_STATUS_STATS_TAG = 111, /* htt_tx_selfgen_ac_sched_status_stats_tlv */
  666. HTT_STATS_TX_SELFGEN_AX_SCHED_STATUS_STATS_TAG = 112, /* htt_tx_selfgen_ax_sched_status_stats_tlv */
  667. HTT_STATS_TXBF_OFDMA_NDPA_STATS_TAG = 113, /* htt_txbf_ofdma_ndpa_stats_tlv - DEPRECATED */
  668. HTT_STATS_TXBF_OFDMA_NDP_STATS_TAG = 114, /* htt_txbf_ofdma_ndp_stats_tlv - DEPRECATED */
  669. HTT_STATS_TXBF_OFDMA_BRP_STATS_TAG = 115, /* htt_txbf_ofdma_brp_stats_tlv - DEPRECATED */
  670. HTT_STATS_TXBF_OFDMA_STEER_STATS_TAG = 116, /* htt_txbf_ofdma_steer_stats_tlv - DEPRECATED */
  671. HTT_STATS_STA_UL_OFDMA_STATS_TAG = 117, /* htt_sta_ul_ofdma_stats_tlv */
  672. HTT_STATS_VDEV_RTT_RESP_STATS_TAG = 118, /* htt_vdev_rtt_resp_stats_tlv */
  673. HTT_STATS_PKTLOG_AND_HTT_RING_STATS_TAG = 119, /* htt_pktlog_and_htt_ring_stats_tlv */
  674. HTT_STATS_DLPAGER_STATS_TAG = 120, /* htt_dlpager_stats_tlv */
  675. HTT_STATS_PHY_COUNTERS_TAG = 121, /* htt_phy_counters_tlv */
  676. HTT_STATS_PHY_STATS_TAG = 122, /* htt_phy_stats_tlv */
  677. HTT_STATS_PHY_RESET_COUNTERS_TAG = 123, /* htt_phy_reset_counters_tlv */
  678. HTT_STATS_PHY_RESET_STATS_TAG = 124, /* htt_phy_reset_stats_tlv */
  679. HTT_STATS_SOC_TXRX_STATS_COMMON_TAG = 125, /* htt_t2h_soc_txrx_stats_common_tlv */
  680. HTT_STATS_VDEV_TXRX_STATS_HW_STATS_TAG = 126, /* htt_t2h_vdev_txrx_stats_hw_stats_tlv */
  681. HTT_STATS_VDEV_RTT_INIT_STATS_TAG = 127, /* htt_vdev_rtt_init_stats_tlv */
  682. HTT_STATS_PER_RATE_STATS_TAG = 128, /* htt_tx_rate_stats_per_tlv */
  683. HTT_STATS_MU_PPDU_DIST_TAG = 129, /* htt_pdev_mu_ppdu_dist_tlv */
  684. HTT_STATS_TX_PDEV_MUMIMO_GRP_STATS_TAG = 130, /* htt_tx_pdev_mumimo_grp_stats_tlv */
  685. HTT_STATS_TX_PDEV_BE_RATE_STATS_TAG = 131, /* htt_tx_pdev_rate_stats_be_tlv */
  686. HTT_STATS_AST_ENTRY_TAG = 132, /* htt_ast_entry_tlv */
  687. HTT_STATS_TX_PDEV_BE_DL_MU_OFDMA_STATS_TAG = 133, /* htt_tx_pdev_dl_be_mu_ofdma_sch_stats_tlv */
  688. HTT_STATS_TX_PDEV_BE_UL_MU_OFDMA_STATS_TAG = 134, /* htt_tx_pdev_ul_be_mu_ofdma_sch_stats_tlv */
  689. HTT_STATS_TX_PDEV_RATE_STATS_BE_OFDMA_TAG = 135, /* htt_tx_pdev_rate_stats_be_ofdma_tlv */
  690. HTT_STATS_RX_PDEV_UL_MUMIMO_TRIG_BE_STATS_TAG = 136, /* htt_rx_pdev_ul_mumimo_trig_be_stats_tlv */
  691. HTT_STATS_TX_SELFGEN_BE_ERR_STATS_TAG = 137, /* htt_tx_selfgen_be_err_stats_tlv */
  692. HTT_STATS_TX_SELFGEN_BE_STATS_TAG = 138, /* htt_tx_selfgen_be_stats_tlv */
  693. HTT_STATS_TX_SELFGEN_BE_SCHED_STATUS_STATS_TAG = 139, /* htt_tx_selfgen_be_sched_status_stats_tlv */
  694. HTT_STATS_TX_PDEV_BE_UL_MU_MIMO_STATS_TAG = 140, /* htt_tx_pdev_be_ul_mu_mimo_sch_stats_tlv */
  695. HTT_STATS_RX_PDEV_BE_UL_MIMO_USER_STATS_TAG = 141, /* htt_rx_pdev_be_ul_mimo_user_stats_tlv */
  696. HTT_STATS_RX_RING_STATS_TAG = 142, /* htt_rx_fw_ring_stats_tlv_v */
  697. HTT_STATS_RX_PDEV_BE_UL_TRIG_STATS_TAG = 143, /* htt_rx_pdev_be_ul_trigger_stats_tlv */
  698. HTT_STATS_TX_PDEV_SAWF_RATE_STATS_TAG = 144, /* htt_tx_pdev_rate_stats_sawf_tlv */
  699. HTT_STATS_STRM_GEN_MPDUS_TAG = 145, /* htt_stats_strm_gen_mpdus_tlv_t */
  700. HTT_STATS_STRM_GEN_MPDUS_DETAILS_TAG = 146, /* htt_stats_strm_gen_mpdus_details_tlv_t */
  701. HTT_STATS_TXBF_OFDMA_AX_NDPA_STATS_TAG = 147, /* htt_txbf_ofdma_ax_ndpa_stats_tlv */
  702. HTT_STATS_TXBF_OFDMA_AX_NDP_STATS_TAG = 148, /* htt_txbf_ofdma_ax_ndp_stats_tlv */
  703. HTT_STATS_TXBF_OFDMA_AX_BRP_STATS_TAG = 149, /* htt_txbf_ofdma_ax_brp_stats_tlv */
  704. HTT_STATS_TXBF_OFDMA_AX_STEER_STATS_TAG = 150, /* htt_txbf_ofdma_ax_steer_stats_tlv */
  705. HTT_STATS_TXBF_OFDMA_BE_NDPA_STATS_TAG = 151, /* htt_txbf_ofdma_be_ndpa_stats_tlv */
  706. HTT_STATS_TXBF_OFDMA_BE_NDP_STATS_TAG = 152, /* htt_txbf_ofdma_be_ndp_stats_tlv */
  707. HTT_STATS_TXBF_OFDMA_BE_BRP_STATS_TAG = 153, /* htt_txbf_ofdma_be_brp_stats_tlv */
  708. HTT_STATS_TXBF_OFDMA_BE_STEER_STATS_TAG = 154, /* htt_txbf_ofdma_be_steer_stats_tlv */
  709. HTT_STATS_DMAC_RESET_STATS_TAG = 155, /* htt_dmac_reset_stats_tlv */
  710. HTT_STATS_RX_PDEV_BE_UL_OFDMA_USER_STATS_TAG = 156, /* htt_rx_pdev_be_ul_ofdma_user_stats_tlv */
  711. HTT_STATS_PHY_TPC_STATS_TAG = 157, /* htt_phy_tpc_stats_tlv */
  712. HTT_STATS_MAX_TAG,
  713. } htt_stats_tlv_tag_t;
  714. /* retain deprecated enum name as an alias for the current enum name */
  715. typedef htt_stats_tlv_tag_t htt_tlv_tag_t;
  716. #define HTT_STATS_TLV_TAG_M 0x00000fff
  717. #define HTT_STATS_TLV_TAG_S 0
  718. #define HTT_STATS_TLV_LENGTH_M 0x00fff000
  719. #define HTT_STATS_TLV_LENGTH_S 12
  720. #define HTT_STATS_TLV_TAG_GET(_var) \
  721. (((_var) & HTT_STATS_TLV_TAG_M) >> \
  722. HTT_STATS_TLV_TAG_S)
  723. #define HTT_STATS_TLV_TAG_SET(_var, _val) \
  724. do { \
  725. HTT_CHECK_SET_VAL(HTT_STATS_TLV_TAG, _val); \
  726. ((_var) |= ((_val) << HTT_STATS_TLV_TAG_S)); \
  727. } while (0)
  728. #define HTT_STATS_TLV_LENGTH_GET(_var) \
  729. (((_var) & HTT_STATS_TLV_LENGTH_M) >> \
  730. HTT_STATS_TLV_LENGTH_S)
  731. #define HTT_STATS_TLV_LENGTH_SET(_var, _val) \
  732. do { \
  733. HTT_CHECK_SET_VAL(HTT_STATS_TLV_LENGTH, _val); \
  734. ((_var) |= ((_val) << HTT_STATS_TLV_LENGTH_S)); \
  735. } while (0)
  736. /*=== host -> target messages ===============================================*/
  737. enum htt_h2t_msg_type {
  738. HTT_H2T_MSG_TYPE_VERSION_REQ = 0x0,
  739. HTT_H2T_MSG_TYPE_TX_FRM = 0x1,
  740. HTT_H2T_MSG_TYPE_RX_RING_CFG = 0x2,
  741. HTT_H2T_MSG_TYPE_STATS_REQ = 0x3,
  742. HTT_H2T_MSG_TYPE_SYNC = 0x4,
  743. HTT_H2T_MSG_TYPE_AGGR_CFG = 0x5,
  744. HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG = 0x6,
  745. DEPRECATED_HTT_H2T_MSG_TYPE_MGMT_TX = 0x7, /* no longer used */
  746. HTT_H2T_MSG_TYPE_WDI_IPA_CFG = 0x8,
  747. HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ = 0x9,
  748. HTT_H2T_MSG_TYPE_AGGR_CFG_EX = 0xa, /* per vdev amsdu subfrm limit */
  749. HTT_H2T_MSG_TYPE_SRING_SETUP = 0xb,
  750. HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG = 0xc,
  751. HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY = 0xd,
  752. HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY = 0xe,
  753. HTT_H2T_MSG_TYPE_RFS_CONFIG = 0xf,
  754. HTT_H2T_MSG_TYPE_EXT_STATS_REQ = 0x10,
  755. HTT_H2T_MSG_TYPE_PPDU_STATS_CFG = 0x11,
  756. HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG = 0x12,
  757. HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG = 0x13,
  758. HTT_H2T_MSG_TYPE_CHAN_CALDATA = 0x14,
  759. HTT_H2T_MSG_TYPE_RX_FISA_CFG = 0x15,
  760. HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG = 0x16,
  761. HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE = 0x17,
  762. HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE = 0x18,
  763. HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG = 0x19,
  764. HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG = 0x1a,
  765. HTT_H2T_MSG_TYPE_TX_MONITOR_CFG = 0x1b,
  766. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ = 0x1c,
  767. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ = 0x1d,
  768. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ = 0x1e,
  769. HTT_H2T_MSG_TYPE_MSI_SETUP = 0x1f,
  770. HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ = 0x20,
  771. /* keep this last */
  772. HTT_H2T_NUM_MSGS
  773. };
  774. /*
  775. * HTT host to target message type -
  776. * stored in bits 7:0 of the first word of the message
  777. */
  778. #define HTT_H2T_MSG_TYPE_M 0xff
  779. #define HTT_H2T_MSG_TYPE_S 0
  780. #define HTT_H2T_MSG_TYPE_SET(word, msg_type) \
  781. do { \
  782. HTT_CHECK_SET_VAL(HTT_H2T_MSG_TYPE, msg_type); \
  783. (word) |= ((msg_type) << HTT_H2T_MSG_TYPE_S); \
  784. } while (0)
  785. #define HTT_H2T_MSG_TYPE_GET(word) \
  786. (((word) & HTT_H2T_MSG_TYPE_M) >> HTT_H2T_MSG_TYPE_S)
  787. /**
  788. * @brief host -> target version number request message definition
  789. *
  790. * MSG_TYPE => HTT_H2T_MSG_TYPE_VERSION_REQ
  791. *
  792. *
  793. * |31 24|23 16|15 8|7 0|
  794. * |----------------+----------------+----------------+----------------|
  795. * | reserved | msg type |
  796. * |-------------------------------------------------------------------|
  797. * : option request TLV (optional) |
  798. * :...................................................................:
  799. *
  800. * The VER_REQ message may consist of a single 4-byte word, or may be
  801. * extended with TLVs that specify which HTT options the host is requesting
  802. * from the target.
  803. * The following option TLVs may be appended to the VER_REQ message:
  804. * - HL_SUPPRESS_TX_COMPL_IND
  805. * - HL_MAX_TX_QUEUE_GROUPS
  806. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  807. * may be appended to the VER_REQ message (but only one TLV of each type).
  808. *
  809. * Header fields:
  810. * - MSG_TYPE
  811. * Bits 7:0
  812. * Purpose: identifies this as a version number request message
  813. * Value: 0x0 (HTT_H2T_MSG_TYPE_VERSION_REQ)
  814. */
  815. #define HTT_VER_REQ_BYTES 4
  816. /* TBDXXX: figure out a reasonable number */
  817. #define HTT_HL_DATA_SVC_PIPE_DEPTH 24
  818. #define HTT_LL_DATA_SVC_PIPE_DEPTH 64
  819. /**
  820. * @brief HTT tx MSDU descriptor
  821. *
  822. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_FRM
  823. *
  824. * @details
  825. * The HTT tx MSDU descriptor is created by the host HTT SW for each
  826. * tx MSDU. The HTT tx MSDU descriptor contains the information that
  827. * the target firmware needs for the FW's tx processing, particularly
  828. * for creating the HW msdu descriptor.
  829. * The same HTT tx descriptor is used for HL and LL systems, though
  830. * a few fields within the tx descriptor are used only by LL or
  831. * only by HL.
  832. * The HTT tx descriptor is defined in two manners: by a struct with
  833. * bitfields, and by a series of [dword offset, bit mask, bit shift]
  834. * definitions.
  835. * The target should use the struct def, for simplicitly and clarity,
  836. * but the host shall use the bit-mast + bit-shift defs, to be endian-
  837. * neutral. Specifically, the host shall use the get/set macros built
  838. * around the mask + shift defs.
  839. */
  840. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_S 0
  841. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_80211_HDR_M 0x1
  842. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_S 1
  843. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_AGGR_M 0x2
  844. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_S 2
  845. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_ENCRYPT_M 0x4
  846. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_S 3
  847. #define HTT_TX_MSDU_DESC_RAW_SUBTYPE_NO_CLASSIFY_M 0x8
  848. #define HTT_TX_VDEV_ID_WORD 0
  849. #define HTT_TX_VDEV_ID_MASK 0x3f
  850. #define HTT_TX_VDEV_ID_SHIFT 16
  851. #define HTT_TX_L3_CKSUM_OFFLOAD 1
  852. #define HTT_TX_L4_CKSUM_OFFLOAD 2
  853. #define HTT_TX_MSDU_LEN_DWORD 1
  854. #define HTT_TX_MSDU_LEN_MASK 0xffff;
  855. /*
  856. * HTT_VAR_PADDR macros
  857. * Allow physical / bus addresses to be either a single 32-bit value,
  858. * or a 64-bit value, stored as a little-endian lo,hi pair of 32-bit parts
  859. */
  860. #define HTT_VAR_PADDR32(var_name) \
  861. A_UINT32 var_name
  862. #define HTT_VAR_PADDR64_LE(var_name) \
  863. struct { \
  864. /* little-endian: lo precedes hi */ \
  865. A_UINT32 lo; \
  866. A_UINT32 hi; \
  867. } var_name
  868. /*
  869. * TEMPLATE_HTT_TX_MSDU_DESC_T:
  870. * This macro defines a htt_tx_msdu_descXXX_t in which any physical
  871. * addresses are stored in a XXX-bit field.
  872. * This macro is used to define both htt_tx_msdu_desc32_t and
  873. * htt_tx_msdu_desc64_t structs.
  874. */
  875. #define TEMPLATE_HTT_TX_MSDU_DESC_T(_paddr_bits_, _paddr__frags_desc_ptr_) \
  876. PREPACK struct htt_tx_msdu_desc ## _paddr_bits_ ## _t \
  877. { \
  878. /* DWORD 0: flags and meta-data */ \
  879. A_UINT32 \
  880. msg_type: 8, /* HTT_H2T_MSG_TYPE_TX_FRM */ \
  881. \
  882. /* pkt_subtype - \
  883. * Detailed specification of the tx frame contents, extending the \
  884. * general specification provided by pkt_type. \
  885. * FIX THIS: ADD COMPLETE SPECS FOR THIS FIELDS VALUE, e.g. \
  886. * pkt_type | pkt_subtype \
  887. * ============================================================== \
  888. * 802.3 | bit 0:3 - Reserved \
  889. * | bit 4: 0x0 - Copy-Engine Classification Results \
  890. * | not appended to the HTT message \
  891. * | 0x1 - Copy-Engine Classification Results \
  892. * | appended to the HTT message in the \
  893. * | format: \
  894. * | [HTT tx desc, frame header, \
  895. * | CE classification results] \
  896. * | The CE classification results begin \
  897. * | at the next 4-byte boundary after \
  898. * | the frame header. \
  899. * ------------+------------------------------------------------- \
  900. * Eth2 | bit 0:3 - Reserved \
  901. * | bit 4: 0x0 - Copy-Engine Classification Results \
  902. * | not appended to the HTT message \
  903. * | 0x1 - Copy-Engine Classification Results \
  904. * | appended to the HTT message. \
  905. * | See the above specification of the \
  906. * | CE classification results location. \
  907. * ------------+------------------------------------------------- \
  908. * native WiFi | bit 0:3 - Reserved \
  909. * | bit 4: 0x0 - Copy-Engine Classification Results \
  910. * | not appended to the HTT message \
  911. * | 0x1 - Copy-Engine Classification Results \
  912. * | appended to the HTT message. \
  913. * | See the above specification of the \
  914. * | CE classification results location. \
  915. * ------------+------------------------------------------------- \
  916. * mgmt | 0x0 - 802.11 MAC header absent \
  917. * | 0x1 - 802.11 MAC header present \
  918. * ------------+------------------------------------------------- \
  919. * raw | bit 0: 0x0 - 802.11 MAC header absent \
  920. * | 0x1 - 802.11 MAC header present \
  921. * | bit 1: 0x0 - allow aggregation \
  922. * | 0x1 - don't allow aggregation \
  923. * | bit 2: 0x0 - perform encryption \
  924. * | 0x1 - don't perform encryption \
  925. * | bit 3: 0x0 - perform tx classification / queuing \
  926. * | 0x1 - don't perform tx classification; \
  927. * | insert the frame into the "misc" \
  928. * | tx queue \
  929. * | bit 4: 0x0 - Copy-Engine Classification Results \
  930. * | not appended to the HTT message \
  931. * | 0x1 - Copy-Engine Classification Results \
  932. * | appended to the HTT message. \
  933. * | See the above specification of the \
  934. * | CE classification results location. \
  935. */ \
  936. pkt_subtype: 5, \
  937. \
  938. /* pkt_type - \
  939. * General specification of the tx frame contents. \
  940. * The htt_pkt_type enum should be used to specify and check the \
  941. * value of this field. \
  942. */ \
  943. pkt_type: 3, \
  944. \
  945. /* vdev_id - \
  946. * ID for the vdev that is sending this tx frame. \
  947. * For certain non-standard packet types, e.g. pkt_type == raw \
  948. * and (pkt_subtype >> 3) == 1, this field is not relevant/valid. \
  949. * This field is used primarily for determining where to queue \
  950. * broadcast and multicast frames. \
  951. */ \
  952. vdev_id: 6, \
  953. /* ext_tid - \
  954. * The extended traffic ID. \
  955. * If the TID is unknown, the extended TID is set to \
  956. * HTT_TX_EXT_TID_INVALID. \
  957. * If the tx frame is QoS data, then the extended TID has the 0-15 \
  958. * value of the QoS TID. \
  959. * If the tx frame is non-QoS data, then the extended TID is set to \
  960. * HTT_TX_EXT_TID_NON_QOS. \
  961. * If the tx frame is multicast or broadcast, then the extended TID \
  962. * is set to HTT_TX_EXT_TID_MCAST_BCAST. \
  963. */ \
  964. ext_tid: 5, \
  965. \
  966. /* postponed - \
  967. * This flag indicates whether the tx frame has been downloaded to \
  968. * the target before but discarded by the target, and now is being \
  969. * downloaded again; or if this is a new frame that is being \
  970. * downloaded for the first time. \
  971. * This flag allows the target to determine the correct order for \
  972. * transmitting new vs. old frames. \
  973. * value: 0 -> new frame, 1 -> re-send of a previously sent frame \
  974. * This flag only applies to HL systems, since in LL systems, \
  975. * the tx flow control is handled entirely within the target. \
  976. */ \
  977. postponed: 1, \
  978. \
  979. /* extension - \
  980. * This flag indicates whether a HTT tx MSDU extension descriptor \
  981. * (htt_tx_msdu_desc_ext_t) follows this HTT tx MSDU descriptor. \
  982. * \
  983. * 0x0 - no extension MSDU descriptor is present \
  984. * 0x1 - an extension MSDU descriptor immediately follows the \
  985. * regular MSDU descriptor \
  986. */ \
  987. extension: 1, \
  988. \
  989. /* cksum_offload - \
  990. * This flag indicates whether checksum offload is enabled or not \
  991. * for this frame. Target FW use this flag to turn on HW checksumming \
  992. * 0x0 - No checksum offload \
  993. * 0x1 - L3 header checksum only \
  994. * 0x2 - L4 checksum only \
  995. * 0x3 - L3 header checksum + L4 checksum \
  996. */ \
  997. cksum_offload: 2, \
  998. \
  999. /* tx_comp_req - \
  1000. * This flag indicates whether Tx Completion \
  1001. * from fw is required or not. \
  1002. * This flag is only relevant if tx completion is not \
  1003. * universally enabled. \
  1004. * For all LL systems, tx completion is mandatory, \
  1005. * so this flag will be irrelevant. \
  1006. * For HL systems tx completion is optional, but HL systems in which \
  1007. * the bus throughput exceeds the WLAN throughput will \
  1008. * probably want to always use tx completion, and thus \
  1009. * would not check this flag. \
  1010. * This flag is required when tx completions are not used universally, \
  1011. * but are still required for certain tx frames for which \
  1012. * an OTA delivery acknowledgment is needed by the host. \
  1013. * In practice, this would be for HL systems in which the \
  1014. * bus throughput is less than the WLAN throughput. \
  1015. * \
  1016. * 0x0 - Tx Completion Indication from Fw not required \
  1017. * 0x1 - Tx Completion Indication from Fw is required \
  1018. */ \
  1019. tx_compl_req: 1; \
  1020. \
  1021. \
  1022. /* DWORD 1: MSDU length and ID */ \
  1023. A_UINT32 \
  1024. len: 16, /* MSDU length, in bytes */ \
  1025. id: 16; /* MSDU ID used to identify the MSDU to the host, \
  1026. * and this id is used to calculate fragmentation \
  1027. * descriptor pointer inside the target based on \
  1028. * the base address, configured inside the target. \
  1029. */ \
  1030. \
  1031. /* DWORD 2 (or 2-3): fragmentation descriptor bus address */ \
  1032. /* frags_desc_ptr - \
  1033. * The fragmentation descriptor pointer tells the HW's MAC DMA \
  1034. * where the tx frame's fragments reside in memory. \
  1035. * This field only applies to LL systems, since in HL systems the \
  1036. * (degenerate single-fragment) fragmentation descriptor is created \
  1037. * within the target. \
  1038. */ \
  1039. _paddr__frags_desc_ptr_; \
  1040. \
  1041. /* DWORD 3 (or 4): peerid, chanfreq */ \
  1042. /* \
  1043. * Peer ID : Target can use this value to know which peer-id packet \
  1044. * destined to. \
  1045. * It's intended to be specified by host in case of NAWDS. \
  1046. */ \
  1047. A_UINT16 peerid; \
  1048. \
  1049. /* \
  1050. * Channel frequency: This identifies the desired channel \
  1051. * frequency (in mhz) for tx frames. This is used by FW to help \
  1052. * determine when it is safe to transmit or drop frames for \
  1053. * off-channel operation. \
  1054. * The default value of zero indicates to FW that the corresponding \
  1055. * VDEV's home channel (if there is one) is the desired channel \
  1056. * frequency. \
  1057. */ \
  1058. A_UINT16 chanfreq; \
  1059. \
  1060. /* Reason reserved is commented is increasing the htt structure size \
  1061. * leads to some wierd issues. Contact Raj/Kyeyoon for more info \
  1062. * A_UINT32 reserved_dword3_bits0_31; \
  1063. */ \
  1064. } POSTPACK
  1065. /* define a htt_tx_msdu_desc32_t type */
  1066. TEMPLATE_HTT_TX_MSDU_DESC_T(32, HTT_VAR_PADDR32(frags_desc_ptr));
  1067. /* define a htt_tx_msdu_desc64_t type */
  1068. TEMPLATE_HTT_TX_MSDU_DESC_T(64, HTT_VAR_PADDR64_LE(frags_desc_ptr));
  1069. /*
  1070. * Make htt_tx_msdu_desc_t be an alias for either
  1071. * htt_tx_msdu_desc32_t or htt_tx_msdu_desc64_t
  1072. */
  1073. #if HTT_PADDR64
  1074. #define htt_tx_msdu_desc_t htt_tx_msdu_desc64_t
  1075. #else
  1076. #define htt_tx_msdu_desc_t htt_tx_msdu_desc32_t
  1077. #endif
  1078. /* decriptor information for Management frame*/
  1079. /*
  1080. * THIS htt_mgmt_tx_desc_t STRUCT IS DEPRECATED - DON'T USE IT.
  1081. * BOTH MANAGEMENT AND DATA FRAMES SHOULD USE htt_tx_msdu_desc_t.
  1082. */
  1083. #define HTT_MGMT_FRM_HDR_DOWNLOAD_LEN 32
  1084. extern A_UINT32 mgmt_hdr_len;
  1085. PREPACK struct htt_mgmt_tx_desc_t {
  1086. A_UINT32 msg_type;
  1087. #if HTT_PADDR64
  1088. A_UINT64 frag_paddr; /* DMAble address of the data */
  1089. #else
  1090. A_UINT32 frag_paddr; /* DMAble address of the data */
  1091. #endif
  1092. A_UINT32 desc_id; /* returned to host during completion
  1093. * to free the meory*/
  1094. A_UINT32 len; /* Fragment length */
  1095. A_UINT32 vdev_id; /* virtual device ID*/
  1096. A_UINT8 hdr[HTT_MGMT_FRM_HDR_DOWNLOAD_LEN]; /* frm header */
  1097. } POSTPACK;
  1098. PREPACK struct htt_mgmt_tx_compl_ind {
  1099. A_UINT32 desc_id;
  1100. A_UINT32 status;
  1101. } POSTPACK;
  1102. /*
  1103. * This SDU header size comes from the summation of the following:
  1104. * 1. Max of:
  1105. * a. Native WiFi header, for native WiFi frames: 24 bytes
  1106. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4)
  1107. * b. 802.11 header, for raw frames: 36 bytes
  1108. * (frame control, duration / ID, addr1, addr2, addr3, seq ctrl, addr4,
  1109. * QoS header, HT header)
  1110. * c. 802.3 header, for ethernet frames: 14 bytes
  1111. * (destination address, source address, ethertype / length)
  1112. * 2. Max of:
  1113. * a. IPv4 header, up through the DiffServ Code Point: 2 bytes
  1114. * b. IPv6 header, up through the Traffic Class: 2 bytes
  1115. * 3. 802.1Q VLAN header: 4 bytes
  1116. * 4. LLC/SNAP header: 8 bytes
  1117. */
  1118. #define HTT_TX_HDR_SIZE_NATIVE_WIFI 30
  1119. #define HTT_TX_HDR_SIZE_802_11_RAW 36
  1120. #define HTT_TX_HDR_SIZE_ETHERNET 14
  1121. #define HTT_TX_HDR_SIZE_OUTER_HDR_MAX HTT_TX_HDR_SIZE_802_11_RAW
  1122. A_COMPILE_TIME_ASSERT(
  1123. htt_encap_hdr_size_max_check_nwifi,
  1124. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_NATIVE_WIFI);
  1125. A_COMPILE_TIME_ASSERT(
  1126. htt_encap_hdr_size_max_check_enet,
  1127. HTT_TX_HDR_SIZE_OUTER_HDR_MAX >= HTT_TX_HDR_SIZE_ETHERNET);
  1128. #define HTT_HL_TX_HDR_SIZE_IP 1600 /* also include payload */
  1129. #define HTT_LL_TX_HDR_SIZE_IP 16 /* up to the end of UDP header for IPv4 case */
  1130. #define HTT_TX_HDR_SIZE_802_1Q 4
  1131. #define HTT_TX_HDR_SIZE_LLC_SNAP 8
  1132. #define HTT_COMMON_TX_FRM_HDR_LEN \
  1133. (HTT_TX_HDR_SIZE_OUTER_HDR_MAX + \
  1134. HTT_TX_HDR_SIZE_802_1Q + \
  1135. HTT_TX_HDR_SIZE_LLC_SNAP)
  1136. #define HTT_HL_TX_FRM_HDR_LEN \
  1137. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_HL_TX_HDR_SIZE_IP)
  1138. #define HTT_LL_TX_FRM_HDR_LEN \
  1139. (HTT_COMMON_TX_FRM_HDR_LEN + HTT_LL_TX_HDR_SIZE_IP)
  1140. #define HTT_TX_DESC_LEN sizeof(struct htt_tx_msdu_desc_t)
  1141. /* dword 0 */
  1142. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_BYTES 0
  1143. #define HTT_TX_DESC_PKT_SUBTYPE_OFFSET_DWORD 0
  1144. #define HTT_TX_DESC_PKT_SUBTYPE_M 0x00001f00
  1145. #define HTT_TX_DESC_PKT_SUBTYPE_S 8
  1146. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_BYTES 0
  1147. #define HTT_TX_DESC_NO_ENCRYPT_OFFSET_DWORD 0
  1148. #define HTT_TX_DESC_NO_ENCRYPT_M 0x00000400
  1149. #define HTT_TX_DESC_NO_ENCRYPT_S 10
  1150. #define HTT_TX_DESC_PKT_TYPE_OFFSET_BYTES 0
  1151. #define HTT_TX_DESC_PKT_TYPE_OFFSET_DWORD 0
  1152. #define HTT_TX_DESC_PKT_TYPE_M 0x0000e000
  1153. #define HTT_TX_DESC_PKT_TYPE_S 13
  1154. #define HTT_TX_DESC_VDEV_ID_OFFSET_BYTES 0
  1155. #define HTT_TX_DESC_VDEV_ID_OFFSET_DWORD 0
  1156. #define HTT_TX_DESC_VDEV_ID_M 0x003f0000
  1157. #define HTT_TX_DESC_VDEV_ID_S 16
  1158. #define HTT_TX_DESC_EXT_TID_OFFSET_BYTES 0
  1159. #define HTT_TX_DESC_EXT_TID_OFFSET_DWORD 0
  1160. #define HTT_TX_DESC_EXT_TID_M 0x07c00000
  1161. #define HTT_TX_DESC_EXT_TID_S 22
  1162. #define HTT_TX_DESC_POSTPONED_OFFSET_BYTES 0
  1163. #define HTT_TX_DESC_POSTPONED_OFFSET_DWORD 0
  1164. #define HTT_TX_DESC_POSTPONED_M 0x08000000
  1165. #define HTT_TX_DESC_POSTPONED_S 27
  1166. #define HTT_TX_DESC_EXTENSION_OFFSET_BYTE 0
  1167. #define HTT_TX_DESC_EXTENSION_OFFSET_DWORD 0
  1168. #define HTT_TX_DESC_EXTENSION_M 0x10000000
  1169. #define HTT_TX_DESC_EXTENSION_S 28
  1170. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_BYTES 0
  1171. #define HTT_TX_DESC_CKSUM_OFFLOAD_OFFSET_DWORD 0
  1172. #define HTT_TX_DESC_CKSUM_OFFLOAD_M 0x60000000
  1173. #define HTT_TX_DESC_CKSUM_OFFLOAD_S 29
  1174. #define HTT_TX_DESC_TX_COMP_OFFSET_BYTES 0
  1175. #define HTT_TX_DESC_TX_COMP_OFFSET_DWORD 0
  1176. #define HTT_TX_DESC_TX_COMP_M 0x80000000
  1177. #define HTT_TX_DESC_TX_COMP_S 31
  1178. /* dword 1 */
  1179. #define HTT_TX_DESC_FRM_LEN_OFFSET_BYTES 4
  1180. #define HTT_TX_DESC_FRM_LEN_OFFSET_DWORD 1
  1181. #define HTT_TX_DESC_FRM_LEN_M 0x0000ffff
  1182. #define HTT_TX_DESC_FRM_LEN_S 0
  1183. #define HTT_TX_DESC_FRM_ID_OFFSET_BYTES 4
  1184. #define HTT_TX_DESC_FRM_ID_OFFSET_DWORD 1
  1185. #define HTT_TX_DESC_FRM_ID_M 0xffff0000
  1186. #define HTT_TX_DESC_FRM_ID_S 16
  1187. /* dword 2 */
  1188. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_BYTES 8
  1189. #define HTT_TX_DESC_FRAGS_DESC_PADDR_OFFSET_DWORD 2
  1190. /* for systems using 64-bit format for bus addresses */
  1191. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_M 0xffffffff
  1192. #define HTT_TX_DESC_FRAGS_DESC_PADDR_HI_S 0
  1193. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_M 0xffffffff
  1194. #define HTT_TX_DESC_FRAGS_DESC_PADDR_LO_S 0
  1195. /* for systems using 32-bit format for bus addresses */
  1196. #define HTT_TX_DESC_FRAGS_DESC_PADDR_M 0xffffffff
  1197. #define HTT_TX_DESC_FRAGS_DESC_PADDR_S 0
  1198. /* dword 3 */
  1199. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 16
  1200. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 12
  1201. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64 \
  1202. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64 >> 2)
  1203. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32 \
  1204. (HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32 >> 2)
  1205. #if HTT_PADDR64
  1206. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_64
  1207. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_64
  1208. #else
  1209. #define HTT_TX_DESC_PEER_ID_OFFSET_BYTES HTT_TX_DESC_PEER_ID_OFFSET_BYTES_32
  1210. #define HTT_TX_DESC_PEER_ID_OFFSET_DWORD HTT_TX_DESC_PEER_ID_OFFSET_DWORD_32
  1211. #endif
  1212. #define HTT_TX_DESC_PEER_ID_M 0x0000ffff
  1213. #define HTT_TX_DESC_PEER_ID_S 0
  1214. /*
  1215. * TEMPORARY:
  1216. * The original definitions for the PEER_ID fields contained typos
  1217. * (with _DESC_PADDR appended to this PEER_ID field name).
  1218. * Retain deprecated original names for PEER_ID fields until all code that
  1219. * refers to them has been updated.
  1220. */
  1221. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_BYTES \
  1222. HTT_TX_DESC_PEER_ID_OFFSET_BYTES
  1223. #define HTT_TX_DESC_PEERID_DESC_PADDR_OFFSET_DWORD \
  1224. HTT_TX_DESC_PEER_ID_OFFSET_DWORD
  1225. #define HTT_TX_DESC_PEERID_DESC_PADDR_M \
  1226. HTT_TX_DESC_PEER_ID_M
  1227. #define HTT_TX_DESC_PEERID_DESC_PADDR_S \
  1228. HTT_TX_DESC_PEER_ID_S
  1229. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 16 /* to dword with chan freq */
  1230. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 12 /* to dword with chan freq */
  1231. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64 \
  1232. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64 >> 2)
  1233. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32 \
  1234. (HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32 >> 2)
  1235. #if HTT_PADDR64
  1236. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_64
  1237. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_64
  1238. #else
  1239. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES HTT_TX_DESC_CHAN_FREQ_OFFSET_BYTES_32
  1240. #define HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD HTT_TX_DESC_CHAN_FREQ_OFFSET_DWORD_32
  1241. #endif
  1242. #define HTT_TX_DESC_CHAN_FREQ_M 0xffff0000
  1243. #define HTT_TX_DESC_CHAN_FREQ_S 16
  1244. #define HTT_TX_DESC_PKT_SUBTYPE_GET(_var) \
  1245. (((_var) & HTT_TX_DESC_PKT_SUBTYPE_M) >> HTT_TX_DESC_PKT_SUBTYPE_S)
  1246. #define HTT_TX_DESC_PKT_SUBTYPE_SET(_var, _val) \
  1247. do { \
  1248. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_SUBTYPE, _val); \
  1249. ((_var) |= ((_val) << HTT_TX_DESC_PKT_SUBTYPE_S)); \
  1250. } while (0)
  1251. #define HTT_TX_DESC_NO_ENCRYPT_GET(_var) \
  1252. (((_var) & HTT_TX_DESC_NO_ENCRYPT_M) >> HTT_TX_DESC_NO_ENCRYPT_S)
  1253. #define HTT_TX_DESC_NO_ENCRYPT_SET(_var, _val) \
  1254. do { \
  1255. HTT_CHECK_SET_VAL(HTT_TX_DESC_NO_ENCRYPT, _val); \
  1256. ((_var) |= ((_val) << HTT_TX_DESC_NO_ENCRYPT_S)); \
  1257. } while (0)
  1258. #define HTT_TX_DESC_PKT_TYPE_GET(_var) \
  1259. (((_var) & HTT_TX_DESC_PKT_TYPE_M) >> HTT_TX_DESC_PKT_TYPE_S)
  1260. #define HTT_TX_DESC_PKT_TYPE_SET(_var, _val) \
  1261. do { \
  1262. HTT_CHECK_SET_VAL(HTT_TX_DESC_PKT_TYPE, _val); \
  1263. ((_var) |= ((_val) << HTT_TX_DESC_PKT_TYPE_S)); \
  1264. } while (0)
  1265. #define HTT_TX_DESC_VDEV_ID_GET(_var) \
  1266. (((_var) & HTT_TX_DESC_VDEV_ID_M) >> HTT_TX_DESC_VDEV_ID_S)
  1267. #define HTT_TX_DESC_VDEV_ID_SET(_var, _val) \
  1268. do { \
  1269. HTT_CHECK_SET_VAL(HTT_TX_DESC_VDEV_ID, _val); \
  1270. ((_var) |= ((_val) << HTT_TX_DESC_VDEV_ID_S)); \
  1271. } while (0)
  1272. #define HTT_TX_DESC_EXT_TID_GET(_var) \
  1273. (((_var) & HTT_TX_DESC_EXT_TID_M) >> HTT_TX_DESC_EXT_TID_S)
  1274. #define HTT_TX_DESC_EXT_TID_SET(_var, _val) \
  1275. do { \
  1276. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXT_TID, _val); \
  1277. ((_var) |= ((_val) << HTT_TX_DESC_EXT_TID_S)); \
  1278. } while (0)
  1279. #define HTT_TX_DESC_POSTPONED_GET(_var) \
  1280. (((_var) & HTT_TX_DESC_POSTPONED_M) >> HTT_TX_DESC_POSTPONED_S)
  1281. #define HTT_TX_DESC_POSTPONED_SET(_var, _val) \
  1282. do { \
  1283. HTT_CHECK_SET_VAL(HTT_TX_DESC_POSTPONED, _val); \
  1284. ((_var) |= ((_val) << HTT_TX_DESC_POSTPONED_S)); \
  1285. } while (0)
  1286. #define HTT_TX_DESC_EXTENSION_GET(_var) \
  1287. (((_var) & HTT_TX_DESC_EXTENSION_M) >> HTT_TX_DESC_EXTENSION_S)
  1288. #define HTT_TX_DESC_EXTENSION_SET(_var, _val) \
  1289. do { \
  1290. HTT_CHECK_SET_VAL(HTT_TX_DESC_EXTENSION, _val); \
  1291. ((_var) |= ((_val) << HTT_TX_DESC_EXTENSION_S)); \
  1292. } while (0)
  1293. #define HTT_TX_DESC_FRM_LEN_GET(_var) \
  1294. (((_var) & HTT_TX_DESC_FRM_LEN_M) >> HTT_TX_DESC_FRM_LEN_S)
  1295. #define HTT_TX_DESC_FRM_LEN_SET(_var, _val) \
  1296. do { \
  1297. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_LEN, _val); \
  1298. ((_var) |= ((_val) << HTT_TX_DESC_FRM_LEN_S)); \
  1299. } while (0)
  1300. #define HTT_TX_DESC_FRM_ID_GET(_var) \
  1301. (((_var) & HTT_TX_DESC_FRM_ID_M) >> HTT_TX_DESC_FRM_ID_S)
  1302. #define HTT_TX_DESC_FRM_ID_SET(_var, _val) \
  1303. do { \
  1304. HTT_CHECK_SET_VAL(HTT_TX_DESC_FRM_ID, _val); \
  1305. ((_var) |= ((_val) << HTT_TX_DESC_FRM_ID_S)); \
  1306. } while (0)
  1307. #define HTT_TX_DESC_CKSUM_OFFLOAD_GET(_var) \
  1308. (((_var) & HTT_TX_DESC_CKSUM_OFFLOAD_M) >> HTT_TX_DESC_CKSUM_OFFLOAD_S)
  1309. #define HTT_TX_DESC_CKSUM_OFFLOAD_SET(_var, _val) \
  1310. do { \
  1311. HTT_CHECK_SET_VAL(HTT_TX_DESC_CKSUM_OFFLOAD, _val); \
  1312. ((_var) |= ((_val) << HTT_TX_DESC_CKSUM_OFFLOAD_S)); \
  1313. } while (0)
  1314. #define HTT_TX_DESC_TX_COMP_GET(_var) \
  1315. (((_var) & HTT_TX_DESC_TX_COMP_M) >> HTT_TX_DESC_TX_COMP_S)
  1316. #define HTT_TX_DESC_TX_COMP_SET(_var, _val) \
  1317. do { \
  1318. HTT_CHECK_SET_VAL(HTT_TX_DESC_TX_COMP, _val); \
  1319. ((_var) |= ((_val) << HTT_TX_DESC_TX_COMP_S)); \
  1320. } while (0)
  1321. #define HTT_TX_DESC_PEER_ID_GET(_var) \
  1322. (((_var) & HTT_TX_DESC_PEER_ID_M) >> HTT_TX_DESC_PEER_ID_S)
  1323. #define HTT_TX_DESC_PEER_ID_SET(_var, _val) \
  1324. do { \
  1325. HTT_CHECK_SET_VAL(HTT_TX_DESC_PEER_ID, _val); \
  1326. ((_var) |= ((_val) << HTT_TX_DESC_PEER_ID_S)); \
  1327. } while (0)
  1328. #define HTT_TX_DESC_CHAN_FREQ_GET(_var) \
  1329. (((_var) & HTT_TX_DESC_CHAN_FREQ_M) >> HTT_TX_DESC_CHAN_FREQ_S)
  1330. #define HTT_TX_DESC_CHAN_FREQ_SET(_var, _val) \
  1331. do { \
  1332. HTT_CHECK_SET_VAL(HTT_TX_DESC_CHAN_FREQ, _val); \
  1333. ((_var) |= ((_val) << HTT_TX_DESC_CHAN_FREQ_S)); \
  1334. } while (0)
  1335. /* enums used in the HTT tx MSDU extension descriptor */
  1336. enum {
  1337. htt_tx_guard_interval_regular = 0,
  1338. htt_tx_guard_interval_short = 1,
  1339. };
  1340. enum {
  1341. htt_tx_preamble_type_ofdm = 0,
  1342. htt_tx_preamble_type_cck = 1,
  1343. htt_tx_preamble_type_ht = 2,
  1344. htt_tx_preamble_type_vht = 3,
  1345. };
  1346. enum {
  1347. htt_tx_bandwidth_5MHz = 0,
  1348. htt_tx_bandwidth_10MHz = 1,
  1349. htt_tx_bandwidth_20MHz = 2,
  1350. htt_tx_bandwidth_40MHz = 3,
  1351. htt_tx_bandwidth_80MHz = 4,
  1352. htt_tx_bandwidth_160MHz = 5, /* includes 80+80 */
  1353. };
  1354. /**
  1355. * @brief HTT tx MSDU extension descriptor
  1356. * @details
  1357. * If the target supports HTT tx MSDU extension descriptors, the host has
  1358. * the option of appending the following struct following the regular
  1359. * HTT tx MSDU descriptor (and setting the "extension" flag in the regular
  1360. * HTT tx MSDU descriptor, to show that the extension descriptor is present).
  1361. * The HTT tx MSDU extension descriptors allows the host to provide detailed
  1362. * tx specs for each frame.
  1363. */
  1364. PREPACK struct htt_tx_msdu_desc_ext_t {
  1365. /* DWORD 0: flags */
  1366. A_UINT32
  1367. valid_pwr: 1, /* bit 0: if set, tx pwr spec is valid */
  1368. valid_mcs_mask: 1, /* bit 1: if set, tx MCS mask spec is valid */
  1369. valid_nss_mask: 1, /* bit 2: if set, tx Nss mask spec is valid */
  1370. valid_guard_interval: 1, /* bit 3: if set, tx guard intv spec is valid*/
  1371. valid_preamble_type_mask: 1, /* 4: if set, tx preamble mask is valid */
  1372. valid_chainmask: 1, /* bit 5: if set, tx chainmask spec is valid */
  1373. valid_retries: 1, /* bit 6: if set, tx retries spec is valid */
  1374. valid_bandwidth: 1, /* bit 7: if set, tx bandwidth spec is valid */
  1375. valid_expire_tsf: 1, /* bit 8: if set, tx expire TSF spec is valid*/
  1376. is_dsrc: 1, /* bit 9: if set, MSDU is a DSRC frame */
  1377. reserved0_31_7: 22; /* bits 31:10 - unused, set to 0x0 */
  1378. /* DWORD 1: tx power, tx rate, tx BW */
  1379. A_UINT32
  1380. /* pwr -
  1381. * Specify what power the tx frame needs to be transmitted at.
  1382. * The power a signed (two's complement) value is in units of 0.5 dBm.
  1383. * The value needs to be appropriately sign-extended when extracting
  1384. * the value from the message and storing it in a variable that is
  1385. * larger than A_INT8. (The HTT_TX_MSDU_EXT_DESC_FLAG_PWR_GET macro
  1386. * automatically handles this sign-extension.)
  1387. * If the transmission uses multiple tx chains, this power spec is
  1388. * the total transmit power, assuming incoherent combination of
  1389. * per-chain power to produce the total power.
  1390. */
  1391. pwr: 8,
  1392. /* mcs_mask -
  1393. * Specify the allowable values for MCS index (modulation and coding)
  1394. * to use for transmitting the frame.
  1395. *
  1396. * For HT / VHT preamble types, this mask directly corresponds to
  1397. * the HT or VHT MCS indices that are allowed. For each bit N set
  1398. * within the mask, MCS index N is allowed for transmitting the frame.
  1399. * For legacy CCK and OFDM rates, separate bits are provided for CCK
  1400. * rates versus OFDM rates, so the host has the option of specifying
  1401. * that the target must transmit the frame with CCK or OFDM rates
  1402. * (not HT or VHT), but leaving the decision to the target whether
  1403. * to use CCK or OFDM.
  1404. *
  1405. * For CCK and OFDM, the bits within this mask are interpreted as
  1406. * follows:
  1407. * bit 0 -> CCK 1 Mbps rate is allowed
  1408. * bit 1 -> CCK 2 Mbps rate is allowed
  1409. * bit 2 -> CCK 5.5 Mbps rate is allowed
  1410. * bit 3 -> CCK 11 Mbps rate is allowed
  1411. * bit 4 -> OFDM BPSK modulation, 1/2 coding rate is allowed
  1412. * bit 5 -> OFDM BPSK modulation, 3/4 coding rate is allowed
  1413. * bit 6 -> OFDM QPSK modulation, 1/2 coding rate is allowed
  1414. * bit 7 -> OFDM QPSK modulation, 3/4 coding rate is allowed
  1415. * bit 8 -> OFDM 16-QAM modulation, 1/2 coding rate is allowed
  1416. * bit 9 -> OFDM 16-QAM modulation, 3/4 coding rate is allowed
  1417. * bit 10 -> OFDM 64-QAM modulation, 2/3 coding rate is allowed
  1418. * bit 11 -> OFDM 64-QAM modulation, 3/4 coding rate is allowed
  1419. *
  1420. * The MCS index specification needs to be compatible with the
  1421. * bandwidth mask specification. For example, a MCS index == 9
  1422. * specification is inconsistent with a preamble type == VHT,
  1423. * Nss == 1, and channel bandwidth == 20 MHz.
  1424. *
  1425. * Furthermore, the host has only a limited ability to specify to
  1426. * the target to select from HT + legacy rates, or VHT + legacy rates,
  1427. * since this mcs_mask can specify either HT/VHT rates or legacy rates.
  1428. */
  1429. mcs_mask: 12,
  1430. /* nss_mask -
  1431. * Specify which numbers of spatial streams (MIMO factor) are permitted.
  1432. * Each bit in this mask corresponds to a Nss value:
  1433. * bit 0: if set, Nss = 1 (non-MIMO) is permitted
  1434. * bit 1: if set, Nss = 2 (2x2 MIMO) is permitted
  1435. * bit 2: if set, Nss = 3 (3x3 MIMO) is permitted
  1436. * bit 3: if set, Nss = 4 (4x4 MIMO) is permitted
  1437. * The values in the Nss mask must be suitable for the recipient, e.g.
  1438. * a value of 0x4 (Nss = 3) cannot be specified for a tx frame to a
  1439. * recipient which only supports 2x2 MIMO.
  1440. */
  1441. nss_mask: 4,
  1442. /* guard_interval -
  1443. * Specify a htt_tx_guard_interval enum value to indicate whether
  1444. * the transmission should use a regular guard interval or a
  1445. * short guard interval.
  1446. */
  1447. guard_interval: 1,
  1448. /* preamble_type_mask -
  1449. * Specify which preamble types (CCK, OFDM, HT, VHT) the target
  1450. * may choose from for transmitting this frame.
  1451. * The bits in this mask correspond to the values in the
  1452. * htt_tx_preamble_type enum. For example, to allow the target
  1453. * to transmit the frame as either CCK or OFDM, this field would
  1454. * be set to
  1455. * (1 << htt_tx_preamble_type_ofdm) |
  1456. * (1 << htt_tx_preamble_type_cck)
  1457. */
  1458. preamble_type_mask: 4,
  1459. reserved1_31_29: 3; /* unused, set to 0x0 */
  1460. /* DWORD 2: tx chain mask, tx retries */
  1461. A_UINT32
  1462. /* chain_mask - specify which chains to transmit from */
  1463. chain_mask: 4,
  1464. /* retry_limit -
  1465. * Specify the maximum number of transmissions, including the
  1466. * initial transmission, to attempt before giving up if no ack
  1467. * is received.
  1468. * If the tx rate is specified, then all retries shall use the
  1469. * same rate as the initial transmission.
  1470. * If no tx rate is specified, the target can choose whether to
  1471. * retain the original rate during the retransmissions, or to
  1472. * fall back to a more robust rate.
  1473. */
  1474. retry_limit: 4,
  1475. /* bandwidth_mask -
  1476. * Specify what channel widths may be used for the transmission.
  1477. * A value of zero indicates "don't care" - the target may choose
  1478. * the transmission bandwidth.
  1479. * The bits within this mask correspond to the htt_tx_bandwidth
  1480. * enum values - bit 0 is for 5 MHz, bit 1 is for 10 MHz, etc.
  1481. * The bandwidth_mask must be consistent with the preamble_type_mask
  1482. * and mcs_mask specs, if they are provided. For example, 80 MHz and
  1483. * 160 MHz can only be enabled in the mask if preamble_type == VHT.
  1484. */
  1485. bandwidth_mask: 6,
  1486. reserved2_31_14: 18; /* unused, set to 0x0 */
  1487. /* DWORD 3: tx expiry time (TSF) LSBs */
  1488. A_UINT32 expire_tsf_lo;
  1489. /* DWORD 4: tx expiry time (TSF) MSBs */
  1490. A_UINT32 expire_tsf_hi;
  1491. A_UINT32 reserved_for_future_expansion_set_to_zero[3];
  1492. } POSTPACK;
  1493. /* DWORD 0 */
  1494. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M 0x00000001
  1495. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S 0
  1496. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1497. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S 1
  1498. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1499. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_NSS_MASK_S 2
  1500. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000008
  1501. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S 3
  1502. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M 0x00000010
  1503. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S 4
  1504. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000020
  1505. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S 5
  1506. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M 0x00000040
  1507. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S 6
  1508. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M 0x00000080
  1509. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S 7
  1510. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000100
  1511. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S 8
  1512. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M 0x00000200
  1513. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S 9
  1514. /* DWORD 1 */
  1515. #define HTT_TX_MSDU_EXT_DESC_PWR_M 0x000000ff
  1516. #define HTT_TX_MSDU_EXT_DESC_PWR_S 0
  1517. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_M 0x000fff00
  1518. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_S 8
  1519. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_M 0x00f00000
  1520. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_S 20
  1521. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M 0x01000000
  1522. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S 24
  1523. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M 0x1c000000
  1524. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S 25
  1525. /* DWORD 2 */
  1526. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M 0x0000000f
  1527. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S 0
  1528. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M 0x000000f0
  1529. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S 4
  1530. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M 0x00003f00
  1531. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S 8
  1532. /* DWORD 0 */
  1533. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_GET(_var) \
  1534. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1535. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)
  1536. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1537. do { \
  1538. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR, _val); \
  1539. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_S)); \
  1540. } while (0)
  1541. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1542. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1543. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)
  1544. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1545. do { \
  1546. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK, _val); \
  1547. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_MCS_MASK_S)); \
  1548. } while (0)
  1549. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1550. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1551. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1552. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1553. do { \
  1554. HTT_CHECK_SET_VAL( \
  1555. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1556. ((_var) |= ((_val) \
  1557. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1558. } while (0)
  1559. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_GET(_var) \
  1560. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_M) >> \
  1561. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)
  1562. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1563. do { \
  1564. HTT_CHECK_SET_VAL( \
  1565. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK, _val); \
  1566. ((_var) |= ((_val) \
  1567. << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PREAMBLE_TYPE_MASK_S)); \
  1568. } while (0)
  1569. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1570. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1571. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)
  1572. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1573. do { \
  1574. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1575. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1576. } while (0)
  1577. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1578. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_M) >> \
  1579. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)
  1580. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1581. do { \
  1582. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES, _val); \
  1583. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_RETRIES_S)); \
  1584. } while (0)
  1585. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_GET(_var) \
  1586. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_M) >> \
  1587. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)
  1588. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_SET(_var, _val) \
  1589. do { \
  1590. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH, _val); \
  1591. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_BANDWIDTH_S)); \
  1592. } while (0)
  1593. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1594. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1595. HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1596. #define HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1597. do { \
  1598. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1599. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1600. } while (0)
  1601. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_GET(_var) \
  1602. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_M) >> \
  1603. HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)
  1604. #define HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  1605. do { \
  1606. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC, _val); \
  1607. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_FLAG_IS_DSRC_S)); \
  1608. } while (0)
  1609. /* DWORD 1 */
  1610. #define HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) \
  1611. (((_var) & HTT_TX_MSDU_EXT_DESC_PWR_M) >> \
  1612. HTT_TX_MSDU_EXT_DESC_PWR_S)
  1613. #define HTT_TX_MSDU_EXT_DESC_PWR_GET(_var) \
  1614. (HTT_TX_MSDU_EXT_DESC_PWR_GET_BASE(_var) | \
  1615. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT_DESC_PWR))
  1616. #define HTT_TX_MSDU_EXT_DESC_PWR_SET(_var, _val) \
  1617. ((_var) |= (((_val) << HTT_TX_MSDU_EXT_DESC_PWR_S)) & \
  1618. HTT_TX_MSDU_EXT_DESC_PWR_M)
  1619. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_GET(_var) \
  1620. (((_var) & HTT_TX_MSDU_EXT_DESC_MCS_MASK_M) >> \
  1621. HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)
  1622. #define HTT_TX_MSDU_EXT_DESC_MCS_MASK_SET(_var, _val) \
  1623. do { \
  1624. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_MCS_MASK, _val); \
  1625. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_MCS_MASK_S)); \
  1626. } while (0)
  1627. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_GET(_var) \
  1628. (((_var) & HTT_TX_MSDU_EXT_DESC_NSS_MASK_M) >> \
  1629. HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)
  1630. #define HTT_TX_MSDU_EXT_DESC_NSS_MASK_SET(_var, _val) \
  1631. do { \
  1632. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_NSS_MASK, _val); \
  1633. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_NSS_MASK_S)); \
  1634. } while (0)
  1635. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_GET(_var) \
  1636. (((_var) & HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_M) >> \
  1637. HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)
  1638. #define HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_SET(_var, _val) \
  1639. do { \
  1640. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL, _val); \
  1641. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_GUARD_INTERVAL_S)); \
  1642. } while (0)
  1643. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_GET(_var) \
  1644. (((_var) & HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_M) >> \
  1645. HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)
  1646. #define HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_SET(_var, _val) \
  1647. do { \
  1648. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK, _val); \
  1649. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_PREAMBLE_TYPE_MASK_S)); \
  1650. } while (0)
  1651. /* DWORD 2 */
  1652. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_GET(_var) \
  1653. (((_var) & HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_M) >> \
  1654. HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)
  1655. #define HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_SET(_var, _val) \
  1656. do { \
  1657. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_CHAIN_MASK, _val); \
  1658. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_CHAIN_MASK_S)); \
  1659. } while (0)
  1660. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_GET(_var) \
  1661. (((_var) & HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_M) >> \
  1662. HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)
  1663. #define HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_SET(_var, _val) \
  1664. do { \
  1665. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT, _val); \
  1666. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_RETRY_LIMIT_S)); \
  1667. } while (0)
  1668. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_GET(_var) \
  1669. (((_var) & HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_M) >> \
  1670. HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)
  1671. #define HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_SET(_var, _val) \
  1672. do { \
  1673. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK, _val); \
  1674. ((_var) |= ((_val) << HTT_TX_MSDU_EXT_DESC_BANDWIDTH_MASK_S)); \
  1675. } while (0)
  1676. typedef enum {
  1677. HTT_11AX_HE_LTF_SUBTYPE_1X,
  1678. HTT_11AX_HE_LTF_SUBTYPE_2X,
  1679. HTT_11AX_HE_LTF_SUBTYPE_4X,
  1680. } htt_11ax_ltf_subtype_t;
  1681. typedef enum {
  1682. HTT_TX_MSDU_EXT2_DESC_PREAM_OFDM,
  1683. HTT_TX_MSDU_EXT2_DESC_PREAM_CCK,
  1684. HTT_TX_MSDU_EXT2_DESC_PREAM_HT ,
  1685. HTT_TX_MSDU_EXT2_DESC_PREAM_VHT,
  1686. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_SU,
  1687. HTT_TX_MSDU_EXT2_DESC_PREAM_HE_EXT_SU,
  1688. } htt_tx_ext2_preamble_type_t;
  1689. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_M 0x00000001
  1690. #define HTT_TX_MSDU_EXT2_DESC_BW_5MHZ_S 0
  1691. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_M 0x00000002
  1692. #define HTT_TX_MSDU_EXT2_DESC_BW_10MHZ_S 1
  1693. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_M 0x00000004
  1694. #define HTT_TX_MSDU_EXT2_DESC_BW_20MHZ_S 2
  1695. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_M 0x00000008
  1696. #define HTT_TX_MSDU_EXT2_DESC_BW_40MHZ_S 3
  1697. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_M 0x00000010
  1698. #define HTT_TX_MSDU_EXT2_DESC_BW_80MHZ_S 4
  1699. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_M 0x00000020
  1700. #define HTT_TX_MSDU_EXT2_DESC_BW_160MHZ_S 5
  1701. /**
  1702. * @brief HTT tx MSDU extension descriptor v2
  1703. * @details
  1704. * In Lithium, if htt_tx_tcl_metadata->valid_htt_ext is set, this structure
  1705. * is received as tcl_exit_base->host_meta_info in firmware.
  1706. * Also there is no htt_tx_msdu_desc_t in Lithium since most of those fields
  1707. * are already part of tcl_exit_base.
  1708. */
  1709. PREPACK struct htt_tx_msdu_desc_ext2_t {
  1710. /* DWORD 0: flags */
  1711. A_UINT32
  1712. valid_pwr : 1, /* if set, tx pwr spec is valid */
  1713. valid_mcs_mask : 1, /* if set, tx MCS mask is valid */
  1714. valid_nss_mask : 1, /* if set, tx Nss mask is valid */
  1715. valid_preamble_type : 1, /* if set, tx preamble spec is valid */
  1716. valid_retries : 1, /* if set, tx retries spec is valid */
  1717. valid_bw_info : 1, /* if set, tx dyn_bw and bw_mask are valid */
  1718. valid_guard_interval : 1, /* if set, tx guard intv spec is valid */
  1719. valid_chainmask : 1, /* if set, tx chainmask is valid */
  1720. valid_encrypt_type : 1, /* if set, encrypt type is valid */
  1721. valid_key_flags : 1, /* if set, key flags is valid */
  1722. valid_expire_tsf : 1, /* if set, tx expire TSF spec is valid */
  1723. valid_chanfreq : 1, /* if set, chanfreq is valid */
  1724. is_dsrc : 1, /* if set, MSDU is a DSRC frame */
  1725. guard_interval : 2, /* 0.4us, 0.8us, 1.6us, 3.2us */
  1726. encrypt_type : 2, /* 0 = NO_ENCRYPT,
  1727. 1 = ENCRYPT,
  1728. 2 ~ 3 - Reserved */
  1729. /* retry_limit -
  1730. * Specify the maximum number of transmissions, including the
  1731. * initial transmission, to attempt before giving up if no ack
  1732. * is received.
  1733. * If the tx rate is specified, then all retries shall use the
  1734. * same rate as the initial transmission.
  1735. * If no tx rate is specified, the target can choose whether to
  1736. * retain the original rate during the retransmissions, or to
  1737. * fall back to a more robust rate.
  1738. */
  1739. retry_limit : 4,
  1740. use_dcm_11ax : 1, /* If set, Use Dual subcarrier modulation.
  1741. * Valid only for 11ax preamble types HE_SU
  1742. * and HE_EXT_SU
  1743. */
  1744. ltf_subtype_11ax : 2, /* Takes enum values of htt_11ax_ltf_subtype_t
  1745. * Valid only for 11ax preamble types HE_SU
  1746. * and HE_EXT_SU
  1747. */
  1748. dyn_bw : 1, /* 0 = static bw, 1 = dynamic bw */
  1749. bw_mask : 6, /* Valid only if dyn_bw == 0 (static bw).
  1750. * (Bit mask of 5, 10, 20, 40, 80, 160Mhz.
  1751. * Refer to HTT_TX_MSDU_EXT2_DESC_BW defs.)
  1752. */
  1753. host_tx_desc_pool : 1; /* If set, Firmware allocates tx_descriptors
  1754. * in WAL_BUFFERID_TX_HOST_DATA_EXP,instead
  1755. * of WAL_BUFFERID_TX_TCL_DATA_EXP.
  1756. * Use cases:
  1757. * Any time firmware uses TQM-BYPASS for Data
  1758. * TID, firmware expect host to set this bit.
  1759. */
  1760. /* DWORD 1: tx power, tx rate */
  1761. A_UINT32
  1762. power : 8, /* unit of the power field is 0.5 dbm
  1763. * similar to pwr field in htt_tx_msdu_desc_ext_t
  1764. * signed value ranging from -64dbm to 63.5 dbm
  1765. */
  1766. mcs_mask : 12, /* mcs bit mask of 0 ~ 11
  1767. * Setting more than one MCS isn't currently
  1768. * supported by the target (but is supported
  1769. * in the interface in case in the future
  1770. * the target supports specifications of
  1771. * a limited set of MCS values.
  1772. */
  1773. nss_mask : 8, /* Nss bit mask 0 ~ 7
  1774. * Setting more than one Nss isn't currently
  1775. * supported by the target (but is supported
  1776. * in the interface in case in the future
  1777. * the target supports specifications of
  1778. * a limited set of Nss values.
  1779. */
  1780. pream_type : 3, /* Takes enum values of htt_tx_ext2_preamble_type_t */
  1781. update_peer_cache : 1; /* When set these custom values will be
  1782. * used for all packets, until the next
  1783. * update via this ext header.
  1784. * This is to make sure not all packets
  1785. * need to include this header.
  1786. */
  1787. /* DWORD 2: tx chain mask, tx retries */
  1788. A_UINT32
  1789. /* chain_mask - specify which chains to transmit from */
  1790. chain_mask : 8,
  1791. key_flags : 8, /* Key Index and related flags - used in mesh mode
  1792. * TODO: Update Enum values for key_flags
  1793. */
  1794. /*
  1795. * Channel frequency: This identifies the desired channel
  1796. * frequency (in MHz) for tx frames. This is used by FW to help
  1797. * determine when it is safe to transmit or drop frames for
  1798. * off-channel operation.
  1799. * The default value of zero indicates to FW that the corresponding
  1800. * VDEV's home channel (if there is one) is the desired channel
  1801. * frequency.
  1802. */
  1803. chanfreq : 16;
  1804. /* DWORD 3: tx expiry time (TSF) LSBs */
  1805. A_UINT32 expire_tsf_lo;
  1806. /* DWORD 4: tx expiry time (TSF) MSBs */
  1807. A_UINT32 expire_tsf_hi;
  1808. /* DWORD 5: flags to control routing / processing of the MSDU */
  1809. A_UINT32
  1810. /* learning_frame
  1811. * When this flag is set, this frame will be dropped by FW
  1812. * rather than being enqueued to the Transmit Queue Manager (TQM) HW.
  1813. */
  1814. learning_frame : 1,
  1815. /* send_as_standalone
  1816. * This will indicate if the msdu needs to be sent as a singleton PPDU,
  1817. * i.e. with no A-MSDU or A-MPDU aggregation.
  1818. * The scope is extended to other use-cases.
  1819. */
  1820. send_as_standalone : 1,
  1821. /* is_host_opaque_valid
  1822. * Host should set this bit to 1 if the host_opaque_cookie is populated
  1823. * with valid information.
  1824. */
  1825. is_host_opaque_valid : 1,
  1826. rsvd0 : 29;
  1827. /* DWORD 6 : Host opaque cookie for special frames */
  1828. A_UINT32 host_opaque_cookie : 16, /* see is_host_opaque_valid */
  1829. rsvd1 : 16;
  1830. /*
  1831. * This structure can be expanded further up to 40 bytes
  1832. * by adding further DWORDs as needed.
  1833. */
  1834. } POSTPACK;
  1835. /* DWORD 0 */
  1836. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_M 0x00000001
  1837. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S 0
  1838. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M 0x00000002
  1839. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S 1
  1840. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M 0x00000004
  1841. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S 2
  1842. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M 0x00000008
  1843. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S 3
  1844. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M 0x00000010
  1845. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S 4
  1846. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M 0x00000020
  1847. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S 5
  1848. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M 0x00000040
  1849. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S 6
  1850. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M 0x00000080
  1851. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S 7
  1852. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M 0x00000100
  1853. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S 8
  1854. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M 0x00000200
  1855. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S 9
  1856. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M 0x00000400
  1857. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S 10
  1858. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M 0x00000800
  1859. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S 11
  1860. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M 0x00001000
  1861. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S 12
  1862. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M 0x00006000
  1863. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S 13
  1864. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M 0x00018000
  1865. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S 15
  1866. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M 0x001e0000
  1867. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S 17
  1868. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M 0x00200000
  1869. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S 21
  1870. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M 0x00c00000
  1871. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S 22
  1872. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_M 0x01000000
  1873. #define HTT_TX_MSDU_EXT2_DESC_DYN_BW_S 24
  1874. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_M 0x7e000000
  1875. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_S 25
  1876. /* DWORD 1 */
  1877. #define HTT_TX_MSDU_EXT2_DESC_PWR_M 0x000000ff
  1878. #define HTT_TX_MSDU_EXT2_DESC_PWR_S 0
  1879. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M 0x000fff00
  1880. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S 8
  1881. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M 0x0ff00000
  1882. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S 20
  1883. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_M 0x70000000
  1884. #define HTT_TX_MSDU_EXT2_DESC_PREAM_TYPE_S 28
  1885. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_M 0x80000000
  1886. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_S 31
  1887. /* DWORD 2 */
  1888. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M 0x000000ff
  1889. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S 0
  1890. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_M 0x0000ff00
  1891. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S 8
  1892. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_M 0xffff0000
  1893. #define HTT_TX_MSDU_EXT_DESC_CHANFREQ_S 16
  1894. /* DWORD 5 */
  1895. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M 0x00000001
  1896. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S 0
  1897. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M 0x00000002
  1898. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S 1
  1899. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M 0x00000004
  1900. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S 2
  1901. /* DWORD 6 */
  1902. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M 0x0000FFFF
  1903. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S 0
  1904. /* DWORD 0 */
  1905. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_GET(_var) \
  1906. (((_var) & HTT_TX_MSDU_EXT_DESC_FLAG_VALID_PWR_M) >> \
  1907. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)
  1908. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_SET(_var, _val) \
  1909. do { \
  1910. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR, _val); \
  1911. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PWR_S)); \
  1912. } while (0)
  1913. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_GET(_var) \
  1914. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_M) >> \
  1915. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)
  1916. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_SET(_var, _val) \
  1917. do { \
  1918. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK, _val); \
  1919. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_MCS_MASK_S)); \
  1920. } while (0)
  1921. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_GET(_var) \
  1922. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_M) >> \
  1923. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)
  1924. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_SET(_var, _val) \
  1925. do { \
  1926. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK, _val); \
  1927. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_NSS_MASK_S)); \
  1928. } while (0)
  1929. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_GET(_var) \
  1930. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_M) >> \
  1931. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)
  1932. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_SET(_var, _val) \
  1933. do { \
  1934. HTT_CHECK_SET_VAL( \
  1935. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE, _val); \
  1936. ((_var) |= ((_val) \
  1937. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_PREAMBLE_TYPE_S)); \
  1938. } while (0)
  1939. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_GET(_var) \
  1940. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_M) >> \
  1941. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)
  1942. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_SET(_var, _val) \
  1943. do { \
  1944. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES, _val); \
  1945. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_RETRIES_S)); \
  1946. } while (0)
  1947. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_GET(_var) \
  1948. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_M) >> \
  1949. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)
  1950. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_SET(_var, _val) \
  1951. do { \
  1952. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO, _val); \
  1953. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_BW_INFO_S)); \
  1954. } while (0)
  1955. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_GET(_var) \
  1956. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_M) >> \
  1957. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)
  1958. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_SET(_var, _val) \
  1959. do { \
  1960. HTT_CHECK_SET_VAL( \
  1961. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL, _val); \
  1962. ((_var) |= ((_val) \
  1963. << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_GUARD_INTERVAL_S)); \
  1964. } while (0)
  1965. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_GET(_var) \
  1966. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_M) >> \
  1967. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)
  1968. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_SET(_var, _val) \
  1969. do { \
  1970. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK, _val); \
  1971. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHAIN_MASK_S)); \
  1972. } while (0)
  1973. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_GET(_var) \
  1974. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_M) >> \
  1975. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S)
  1976. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_SET(_var, _val) \
  1977. do { \
  1978. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE, _val); \
  1979. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_ENCRYPT_TYPE_S));\
  1980. } while (0)
  1981. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_GET(_var) \
  1982. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_M) >> \
  1983. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S)
  1984. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_SET(_var, _val) \
  1985. do { \
  1986. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS, _val); \
  1987. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_KEY_FLAGS_S));\
  1988. } while (0)
  1989. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_GET(_var) \
  1990. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_M) >> \
  1991. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S)
  1992. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_SET(_var, _val) \
  1993. do { \
  1994. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME, _val); \
  1995. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_EXPIRE_TIME_S));\
  1996. } while (0)
  1997. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_GET(_var) \
  1998. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_M) >> \
  1999. HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)
  2000. #define HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_SET(_var, _val) \
  2001. do { \
  2002. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ, _val); \
  2003. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_VALID_CHANFREQ_S)); \
  2004. } while (0)
  2005. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_GET(_var) \
  2006. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_M) >> \
  2007. HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)
  2008. #define HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_SET(_var, _val) \
  2009. do { \
  2010. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC, _val); \
  2011. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_IS_DSRC_S)); \
  2012. } while (0)
  2013. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_GET(_var) \
  2014. (((_var) & HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_M) >> \
  2015. HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)
  2016. #define HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_SET(_var, _val) \
  2017. do { \
  2018. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL, _val); \
  2019. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_GUARD_INTERVAL_S)); \
  2020. } while (0)
  2021. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_GET(_var) \
  2022. (((_var) & HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_M) >> \
  2023. HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)
  2024. #define HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_SET(_var, _val) \
  2025. do { \
  2026. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE, _val); \
  2027. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_ENCRYPT_TYPE_S)); \
  2028. } while (0)
  2029. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_GET(_var) \
  2030. (((_var) & HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_M) >> \
  2031. HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)
  2032. #define HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_SET(_var, _val) \
  2033. do { \
  2034. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT, _val); \
  2035. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_RETRY_LIMIT_S)); \
  2036. } while (0)
  2037. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_GET(_var) \
  2038. (((_var) & HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_M) >> \
  2039. HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)
  2040. #define HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_SET(_var, _val) \
  2041. do { \
  2042. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX, _val); \
  2043. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_USE_DCM_11AX_S)); \
  2044. } while (0)
  2045. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_GET(_var) \
  2046. (((_var) & HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_M) >> \
  2047. HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)
  2048. #define HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_SET(_var, _val) \
  2049. do { \
  2050. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX, _val); \
  2051. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_LTF_SUBTYPE_11AX_S)); \
  2052. } while (0)
  2053. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_GET(_var) \
  2054. (((_var) & HTT_TX_MSDU_EXT2_DESC_BW_MASK_M) >> \
  2055. HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)
  2056. #define HTT_TX_MSDU_EXT2_DESC_BW_MASK_SET(_var, _val) \
  2057. do { \
  2058. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_BW_MASK, _val); \
  2059. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_BW_MASK_S)); \
  2060. } while (0)
  2061. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_GET(_var) \
  2062. (((_var) & HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_M) >> \
  2063. HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)
  2064. #define HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_SET(_var, _val) \
  2065. do { \
  2066. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK, _val); \
  2067. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PARTIAL_BW_MASK_S)); \
  2068. } while (0)
  2069. /* DWORD 1 */
  2070. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) \
  2071. (((_var) & HTT_TX_MSDU_EXT2_DESC_PWR_M) >> \
  2072. HTT_TX_MSDU_EXT2_DESC_PWR_S)
  2073. #define HTT_TX_MSDU_EXT2_DESC_PWR_GET(_var) \
  2074. (HTT_TX_MSDU_EXT2_DESC_PWR_GET_BASE(_var) | \
  2075. HTT_SIGN_BIT_EXTENSION_MASK(_var, HTT_TX_MSDU_EXT2_DESC_PWR))
  2076. #define HTT_TX_MSDU_EXT2_DESC_PWR_SET(_var, _val) \
  2077. ((_var) |= (((_val) << HTT_TX_MSDU_EXT2_DESC_PWR_S)) & \
  2078. HTT_TX_MSDU_EXT2_DESC_PWR_M)
  2079. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_GET(_var) \
  2080. (((_var) & HTT_TX_MSDU_EXT2_DESC_MCS_MASK_M) >> \
  2081. HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)
  2082. #define HTT_TX_MSDU_EXT2_DESC_MCS_MASK_SET(_var, _val) \
  2083. do { \
  2084. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_MCS_MASK, _val); \
  2085. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_MCS_MASK_S)); \
  2086. } while (0)
  2087. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_GET(_var) \
  2088. (((_var) & HTT_TX_MSDU_EXT2_DESC_NSS_MASK_M) >> \
  2089. HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)
  2090. #define HTT_TX_MSDU_EXT2_DESC_NSS_MASK_SET(_var, _val) \
  2091. do { \
  2092. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_NSS_MASK, _val); \
  2093. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_NSS_MASK_S)); \
  2094. } while (0)
  2095. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_GET(_var) \
  2096. (((_var) & HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_M) >> \
  2097. HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)
  2098. #define HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_SET(_var, _val) \
  2099. do { \
  2100. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE, _val); \
  2101. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_PREAMBLE_TYPE_S)); \
  2102. } while (0)
  2103. #define HTT_TX_MSDU_EXT2_DESC_UPDATE_PEER_CACHE_GET(_var) \
  2104. (((_var) & HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_M) >> \
  2105. HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)
  2106. #define HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_SET(_var, _val) \
  2107. do { \
  2108. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE, _val); \
  2109. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_UPDATE_PEER_CACHE_S)); \
  2110. } while (0)
  2111. /* DWORD 2 */
  2112. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_GET(_var) \
  2113. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_M) >> \
  2114. HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)
  2115. #define HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_SET(_var, _val) \
  2116. do { \
  2117. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK, _val); \
  2118. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHAIN_MASK_S)); \
  2119. } while (0)
  2120. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_GET(_var) \
  2121. (((_var) & HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_MASK_M) >> \
  2122. HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)
  2123. #define HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_SET(_var, _val) \
  2124. do { \
  2125. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS, _val); \
  2126. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_KEY_FLAGS_S)); \
  2127. } while (0)
  2128. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_GET(_var) \
  2129. (((_var) & HTT_TX_MSDU_EXT2_DESC_CHANFREQ_MASK_M) >> \
  2130. HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)
  2131. #define HTT_TX_MSDU_EXT2_DESC_CHANFREQ_SET(_var, _val) \
  2132. do { \
  2133. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_CHANFREQ, _val); \
  2134. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_CHANFREQ_S)); \
  2135. } while (0)
  2136. /* DWORD 5 */
  2137. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_GET(_var) \
  2138. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_M) >> \
  2139. HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)
  2140. #define HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_SET(_var, _val) \
  2141. do { \
  2142. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME, _val); \
  2143. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_LEARNING_FRAME_S)); \
  2144. } while (0)
  2145. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_GET(_var) \
  2146. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_M) >> \
  2147. HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)
  2148. #define HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_SET(_var, _val) \
  2149. do { \
  2150. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE, _val); \
  2151. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_SEND_AS_STANDALONE_S)); \
  2152. } while (0)
  2153. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_GET(_var) \
  2154. (((_var) & HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_M) >> \
  2155. HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)
  2156. #define HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_SET(_var, _val) \
  2157. do { \
  2158. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID, _val); \
  2159. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_FLAG_HOST_OPAQUE_VALID_S)); \
  2160. } while (0)
  2161. /* DWORD 6 */
  2162. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_GET(_var) \
  2163. (((_var) & HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_M) >> \
  2164. HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)
  2165. #define HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_SET(_var, _val) \
  2166. do { \
  2167. HTT_CHECK_SET_VAL(HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE, _val); \
  2168. ((_var) |= ((_val) << HTT_TX_MSDU_EXT2_DESC_HOST_OPAQUE_COOKIE_S)); \
  2169. } while (0)
  2170. typedef enum {
  2171. HTT_TCL_METADATA_TYPE_PEER_BASED = 0,
  2172. HTT_TCL_METADATA_TYPE_VDEV_BASED = 1,
  2173. } htt_tcl_metadata_type;
  2174. /**
  2175. * @brief HTT TCL command number format
  2176. * @details
  2177. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2178. * available to firmware as tcl_exit_base->tcl_status_number.
  2179. * For regular / multicast packets host will send vdev and mac id and for
  2180. * NAWDS packets, host will send peer id.
  2181. * A_UINT32 is used to avoid endianness conversion problems.
  2182. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2183. */
  2184. typedef struct {
  2185. A_UINT32
  2186. type: 1, /* vdev_id based or peer_id based */
  2187. rsvd: 31;
  2188. } htt_tx_tcl_vdev_or_peer_t;
  2189. typedef struct {
  2190. A_UINT32
  2191. type: 1, /* vdev_id based or peer_id based */
  2192. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2193. vdev_id: 8,
  2194. pdev_id: 2,
  2195. host_inspected:1,
  2196. rsvd: 19;
  2197. } htt_tx_tcl_vdev_metadata;
  2198. typedef struct {
  2199. A_UINT32
  2200. type: 1, /* vdev_id based or peer_id based */
  2201. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2202. peer_id: 14,
  2203. rsvd: 16;
  2204. } htt_tx_tcl_peer_metadata;
  2205. PREPACK struct htt_tx_tcl_metadata {
  2206. union {
  2207. htt_tx_tcl_vdev_or_peer_t vdev_or_peer;
  2208. htt_tx_tcl_vdev_metadata vdev_meta;
  2209. htt_tx_tcl_peer_metadata peer_meta;
  2210. };
  2211. } POSTPACK;
  2212. /* DWORD 0 */
  2213. #define HTT_TX_TCL_METADATA_TYPE_M 0x00000001
  2214. #define HTT_TX_TCL_METADATA_TYPE_S 0
  2215. #define HTT_TX_TCL_METADATA_VALID_HTT_M 0x00000002
  2216. #define HTT_TX_TCL_METADATA_VALID_HTT_S 1
  2217. /* VDEV metadata */
  2218. #define HTT_TX_TCL_METADATA_VDEV_ID_M 0x000003fc
  2219. #define HTT_TX_TCL_METADATA_VDEV_ID_S 2
  2220. #define HTT_TX_TCL_METADATA_PDEV_ID_M 0x00000c00
  2221. #define HTT_TX_TCL_METADATA_PDEV_ID_S 10
  2222. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_M 0x00001000
  2223. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_S 12
  2224. /* PEER metadata */
  2225. #define HTT_TX_TCL_METADATA_PEER_ID_M 0x0000fffc
  2226. #define HTT_TX_TCL_METADATA_PEER_ID_S 2
  2227. #define HTT_TX_TCL_METADATA_TYPE_GET(_var) \
  2228. (((_var) & HTT_TX_TCL_METADATA_TYPE_M) >> \
  2229. HTT_TX_TCL_METADATA_TYPE_S)
  2230. #define HTT_TX_TCL_METADATA_TYPE_SET(_var, _val) \
  2231. do { \
  2232. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE, _val); \
  2233. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_S)); \
  2234. } while (0)
  2235. #define HTT_TX_TCL_METADATA_VALID_HTT_GET(_var) \
  2236. (((_var) & HTT_TX_TCL_METADATA_VALID_HTT_M) >> \
  2237. HTT_TX_TCL_METADATA_VALID_HTT_S)
  2238. #define HTT_TX_TCL_METADATA_VALID_HTT_SET(_var, _val) \
  2239. do { \
  2240. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VALID_HTT, _val); \
  2241. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VALID_HTT_S)); \
  2242. } while (0)
  2243. #define HTT_TX_TCL_METADATA_VDEV_ID_GET(_var) \
  2244. (((_var) & HTT_TX_TCL_METADATA_VDEV_ID_M) >> \
  2245. HTT_TX_TCL_METADATA_VDEV_ID_S)
  2246. #define HTT_TX_TCL_METADATA_VDEV_ID_SET(_var, _val) \
  2247. do { \
  2248. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_VDEV_ID, _val); \
  2249. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_VDEV_ID_S)); \
  2250. } while (0)
  2251. #define HTT_TX_TCL_METADATA_PDEV_ID_GET(_var) \
  2252. (((_var) & HTT_TX_TCL_METADATA_PDEV_ID_M) >> \
  2253. HTT_TX_TCL_METADATA_PDEV_ID_S)
  2254. #define HTT_TX_TCL_METADATA_PDEV_ID_SET(_var, _val) \
  2255. do { \
  2256. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PDEV_ID, _val); \
  2257. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PDEV_ID_S)); \
  2258. } while (0)
  2259. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_GET(_var) \
  2260. (((_var) & HTT_TX_TCL_METADATA_HOST_INSPECTED_M) >> \
  2261. HTT_TX_TCL_METADATA_HOST_INSPECTED_S)
  2262. #define HTT_TX_TCL_METADATA_HOST_INSPECTED_SET(_var, _val) \
  2263. do { \
  2264. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_HOST_INSPECTED, _val); \
  2265. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_HOST_INSPECTED_S)); \
  2266. } while (0)
  2267. #define HTT_TX_TCL_METADATA_PEER_ID_GET(_var) \
  2268. (((_var) & HTT_TX_TCL_METADATA_PEER_ID_M) >> \
  2269. HTT_TX_TCL_METADATA_PEER_ID_S)
  2270. #define HTT_TX_TCL_METADATA_PEER_ID_SET(_var, _val) \
  2271. do { \
  2272. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_PEER_ID, _val); \
  2273. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_PEER_ID_S)); \
  2274. } while (0)
  2275. /*------------------------------------------------------------------
  2276. * V2 Version of TCL Data Command
  2277. * V2 Version to support peer_id, vdev_id, svc_class_id and
  2278. * MLO global_seq all flavours of TCL Data Cmd.
  2279. *-----------------------------------------------------------------*/
  2280. typedef enum {
  2281. HTT_TCL_METADATA_V2_TYPE_PEER_BASED = 0,
  2282. HTT_TCL_METADATA_V2_TYPE_VDEV_BASED = 1,
  2283. HTT_TCL_METADATA_V2_TYPE_SVC_ID_BASED = 2,
  2284. HTT_TCL_METADATA_V2_TYPE_GLOBAL_SEQ_BASED = 3,
  2285. } htt_tcl_metadata_type_v2;
  2286. /**
  2287. * @brief HTT TCL command number format
  2288. * @details
  2289. * This structure is passed from host as tcl_data_cmd->tcl_cmd_number and
  2290. * available to firmware as tcl_exit_base->tcl_status_number.
  2291. * A_UINT32 is used to avoid endianness conversion problems.
  2292. * tcl_status_number size is 16 bits, hence only 16 bits can be used.
  2293. */
  2294. typedef struct {
  2295. A_UINT32
  2296. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2297. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2298. vdev_id: 8,
  2299. pdev_id: 2,
  2300. host_inspected:1,
  2301. rsvd: 2,
  2302. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2303. } htt_tx_tcl_vdev_metadata_v2;
  2304. typedef struct {
  2305. A_UINT32
  2306. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2307. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2308. peer_id: 13,
  2309. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2310. } htt_tx_tcl_peer_metadata_v2;
  2311. typedef struct {
  2312. A_UINT32
  2313. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2314. valid_htt_ext: 1, /* If set, tcl_exit_base->host_meta_info is valid */
  2315. svc_class_id: 8,
  2316. rsvd: 5,
  2317. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2318. } htt_tx_tcl_svc_class_id_metadata;
  2319. typedef struct {
  2320. A_UINT32
  2321. type: 2, /* vdev_id based or peer_id or svc_id or global seq based */
  2322. host_inspected: 1,
  2323. global_seq_no: 12,
  2324. rsvd: 1,
  2325. padding: 16; /* These 16 bits cannot be used by FW for the tcl command */
  2326. } htt_tx_tcl_global_seq_metadata;
  2327. PREPACK struct htt_tx_tcl_metadata_v2 {
  2328. union {
  2329. htt_tx_tcl_vdev_metadata_v2 vdev_meta_v2;
  2330. htt_tx_tcl_peer_metadata_v2 peer_meta_v2;
  2331. htt_tx_tcl_svc_class_id_metadata svc_class_id_meta;
  2332. htt_tx_tcl_global_seq_metadata global_seq_meta;
  2333. };
  2334. } POSTPACK;
  2335. /* DWORD 0 */
  2336. #define HTT_TX_TCL_METADATA_TYPE_V2_M 0x00000003
  2337. #define HTT_TX_TCL_METADATA_TYPE_V2_S 0
  2338. /* Valid htt ext for V2 tcl data cmd used by VDEV, PEER and SVC_ID meta */
  2339. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M 0x00000004
  2340. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S 2
  2341. /* VDEV V2 metadata */
  2342. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_M 0x000007f8
  2343. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_S 3
  2344. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_M 0x00001800
  2345. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_S 11
  2346. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M 0x00002000
  2347. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S 13
  2348. /* PEER V2 metadata */
  2349. #define HTT_TX_TCL_METADATA_V2_PEER_ID_M 0x0000fff8
  2350. #define HTT_TX_TCL_METADATA_V2_PEER_ID_S 3
  2351. /* SVC_CLASS_ID metadata */
  2352. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_M 0x000007f8
  2353. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_S 3
  2354. /* Global Seq no metadata */
  2355. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M 0x00000004
  2356. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S 2
  2357. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M 0x00007ff8
  2358. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S 3
  2359. /*----- Get and Set V2 type field in Vdev, Peer, Svc_Class_Id, Global_seq_no */
  2360. #define HTT_TX_TCL_METADATA_TYPE_V2_GET(_var) \
  2361. (((_var) & HTT_TX_TCL_METADATA_TYPE_V2_M) >> \
  2362. HTT_TX_TCL_METADATA_TYPE_V2_S)
  2363. #define HTT_TX_TCL_METADATA_TYPE_V2_SET(_var, _val) \
  2364. do { \
  2365. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_TYPE_V2, _val); \
  2366. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_TYPE_V2_S)); \
  2367. } while (0)
  2368. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_GET(_var) \
  2369. (((_var) & HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_M) >> \
  2370. HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)
  2371. #define HTT_TX_TCL_METADATA_V2_VALID_HTT_SET(_var, _val) \
  2372. do { \
  2373. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID, _val); \
  2374. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VALID_HTT_EXT_ID_S)); \
  2375. } while (0)
  2376. /*----- Get and Set V2 type field in Vdev meta fields ----*/
  2377. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_GET(_var) \
  2378. (((_var) & HTT_TX_TCL_METADATA_V2_VDEV_ID_M) >> \
  2379. HTT_TX_TCL_METADATA_V2_VDEV_ID_S)
  2380. #define HTT_TX_TCL_METADATA_V2_VDEV_ID_SET(_var, _val) \
  2381. do { \
  2382. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_VDEV_ID, _val); \
  2383. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_VDEV_ID_S)); \
  2384. } while (0)
  2385. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_GET(_var) \
  2386. (((_var) & HTT_TX_TCL_METADATA_V2_PDEV_ID_M) >> \
  2387. HTT_TX_TCL_METADATA_V2_PDEV_ID_S)
  2388. #define HTT_TX_TCL_METADATA_V2_PDEV_ID_SET(_var, _val) \
  2389. do { \
  2390. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PDEV_ID, _val); \
  2391. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PDEV_ID_S)); \
  2392. } while (0)
  2393. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_GET(_var) \
  2394. (((_var) & HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_M) >> \
  2395. HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)
  2396. #define HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_SET(_var, _val) \
  2397. do { \
  2398. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_HOST_INSPECTED, _val); \
  2399. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_HOST_INSPECTED_S)); \
  2400. } while (0)
  2401. /*----- Get and Set V2 type field in Peer meta fields ----*/
  2402. #define HTT_TX_TCL_METADATA_V2_PEER_ID_GET(_var) \
  2403. (((_var) & HTT_TX_TCL_METADATA_V2_PEER_ID_M) >> \
  2404. HTT_TX_TCL_METADATA_V2_PEER_ID_S)
  2405. #define HTT_TX_TCL_METADATA_V2_PEER_ID_SET(_var, _val) \
  2406. do { \
  2407. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_V2_PEER_ID, _val); \
  2408. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_V2_PEER_ID_S)); \
  2409. } while (0)
  2410. /*----- Get and Set V2 type field in Service Class fields ----*/
  2411. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_GET(_var) \
  2412. (((_var) & HTT_TX_TCL_METADATA_SVC_CLASS_ID_M) >> \
  2413. HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)
  2414. #define HTT_TX_TCL_METADATA_SVC_CLASS_ID_SET(_var, _val) \
  2415. do { \
  2416. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_SVC_CLASS_ID, _val); \
  2417. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_SVC_CLASS_ID_S)); \
  2418. } while (0)
  2419. /*----- Get and Set V2 type field in Global sequence fields ----*/
  2420. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_GET(_var) \
  2421. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_M) >> \
  2422. HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)
  2423. #define HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_SET(_var, _val) \
  2424. do { \
  2425. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED, _val); \
  2426. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_HOST_INSPECTED_S)); \
  2427. } while (0)
  2428. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_GET(_var) \
  2429. (((_var) & HTT_TX_TCL_METADATA_GLBL_SEQ_NO_M) >> \
  2430. HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)
  2431. #define HTT_TX_TCL_METADATA_GLBL_SEQ_NO_SET(_var, _val) \
  2432. do { \
  2433. HTT_CHECK_SET_VAL(HTT_TX_TCL_METADATA_GLBL_SEQ_NO, _val); \
  2434. ((_var) |= ((_val) << HTT_TX_TCL_METADATA_GLBL_SEQ_NO_S)); \
  2435. } while (0)
  2436. /*------------------------------------------------------------------
  2437. * End V2 Version of TCL Data Command
  2438. *-----------------------------------------------------------------*/
  2439. typedef enum {
  2440. HTT_TX_FW2WBM_TX_STATUS_OK,
  2441. HTT_TX_FW2WBM_TX_STATUS_DROP,
  2442. HTT_TX_FW2WBM_TX_STATUS_TTL,
  2443. HTT_TX_FW2WBM_TX_STATUS_REINJECT,
  2444. HTT_TX_FW2WBM_TX_STATUS_INSPECT,
  2445. HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY,
  2446. HTT_TX_FW2WBM_TX_STATUS_VDEVID_MISMATCH,
  2447. HTT_TX_FW2WBM_TX_STATUS_MAX
  2448. } htt_tx_fw2wbm_tx_status_t;
  2449. typedef enum {
  2450. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP, /* deprecated */
  2451. HTT_TX_FW2WBM_REINJECT_REASON_RAW_ENCAP_EXP /* current */ =
  2452. HTT_TX_FW2WBM_REINJECT_REASON_EAPOL_ENCAP_EXP,
  2453. HTT_TX_FW2WBM_REINJECT_REASON_INJECT_VIA_EXP,
  2454. HTT_TX_FW2WBM_REINJECT_REASON_MCAST,
  2455. HTT_TX_FW2WBM_REINJECT_REASON_ARP,
  2456. HTT_TX_FW2WBM_REINJECT_REASON_DHCP,
  2457. HTT_TX_FW2WBM_REINJECT_REASON_FLOW_CONTROL,
  2458. HTT_TX_FW2WBM_REINJECT_REASON_MLO_MCAST,
  2459. HTT_TX_FW2WBM_REINJECT_REASON_MAX,
  2460. } htt_tx_fw2wbm_reinject_reason_t;
  2461. /**
  2462. * @brief HTT TX WBM Completion from firmware to host
  2463. * @details
  2464. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2465. * DWORD 3 and 4 for software based completions (Exception frames and
  2466. * TQM bypass frames)
  2467. * For software based completions, wbm_release_ring->release_source_module will
  2468. * be set to release_source_fw
  2469. */
  2470. PREPACK struct htt_tx_wbm_completion {
  2471. A_UINT32
  2472. sch_cmd_id: 24,
  2473. exception_frame: 1, /* If set, this packet was queued via exception path */
  2474. rsvd0_31_25: 7;
  2475. A_UINT32
  2476. ack_frame_rssi: 8, /* If this frame is removed as the result of the
  2477. * reception of an ACK or BA, this field indicates
  2478. * the RSSI of the received ACK or BA frame.
  2479. * When the frame is removed as result of a direct
  2480. * remove command from the SW, this field is set
  2481. * to 0x0 (which is never a valid value when real
  2482. * RSSI is available).
  2483. * Units: dB w.r.t noise floor
  2484. */
  2485. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2486. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2487. rsvd1_31_16: 16;
  2488. } POSTPACK;
  2489. /* DWORD 0 */
  2490. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M 0x00ffffff
  2491. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S 0
  2492. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_M 0x01000000
  2493. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_S 24
  2494. /* DWORD 1 */
  2495. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_M 0x000000ff
  2496. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_S 0
  2497. #define HTT_TX_WBM_COMPLETION_TX_STATUS_M 0x00000f00
  2498. #define HTT_TX_WBM_COMPLETION_TX_STATUS_S 8
  2499. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_M 0x0000f000
  2500. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_S 12
  2501. /* DWORD 0 */
  2502. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_GET(_var) \
  2503. (((_var) & HTT_TX_WBM_COMPLETION_SCH_CMD_ID_M) >> \
  2504. HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)
  2505. #define HTT_TX_WBM_COMPLETION_SCH_CMD_ID_SET(_var, _val) \
  2506. do { \
  2507. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_SCH_CMD_ID, _val); \
  2508. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_SCH_CMD_ID_S)); \
  2509. } while (0)
  2510. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_GET(_var) \
  2511. (((_var) & HTT_TX_WBM_COMPLETION_EXP_FRAME_M) >> \
  2512. HTT_TX_WBM_COMPLETION_EXP_FRAME_S)
  2513. #define HTT_TX_WBM_COMPLETION_EXP_FRAME_SET(_var, _val) \
  2514. do { \
  2515. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_EXP_FRAME, _val); \
  2516. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_EXP_FRAME_S)); \
  2517. } while (0)
  2518. /* DWORD 1 */
  2519. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_GET(_var) \
  2520. (((_var) & HTT_TX_WBM_COMPLETION_ACK_RSSI_M) >> \
  2521. HTT_TX_WBM_COMPLETION_ACK_RSSI_S)
  2522. #define HTT_TX_WBM_COMPLETION_ACK_RSSI_SET(_var, _val) \
  2523. do { \
  2524. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_ACK_RSSI, _val); \
  2525. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_ACK_RSSI_S)); \
  2526. } while (0)
  2527. #define HTT_TX_WBM_COMPLETION_TX_STATUS_GET(_var) \
  2528. (((_var) & HTT_TX_WBM_COMPLETION_TX_STATUS_M) >> \
  2529. HTT_TX_WBM_COMPLETION_TX_STATUS_S)
  2530. #define HTT_TX_WBM_COMPLETION_TX_STATUS_SET(_var, _val) \
  2531. do { \
  2532. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_TX_STATUS, _val); \
  2533. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_TX_STATUS_S)); \
  2534. } while (0)
  2535. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_GET(_var) \
  2536. (((_var) & HTT_TX_WBM_COMPLETION_REINJECT_REASON_M) >> \
  2537. HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)
  2538. #define HTT_TX_WBM_COMPLETION_REINJECT_REASON_SET(_var, _val) \
  2539. do { \
  2540. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_REINJECT_REASON, _val); \
  2541. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_REINJECT_REASON_S)); \
  2542. } while (0)
  2543. /**
  2544. * @brief HTT TX WBM Completion from firmware to host
  2545. * @details
  2546. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2547. * (WBM) offload HW.
  2548. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2549. * For software based completions, release_source_module will
  2550. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2551. * struct wbm_release_ring and then switch to this after looking at
  2552. * release_source_module.
  2553. */
  2554. PREPACK struct htt_tx_wbm_completion_v2 {
  2555. A_UINT32
  2556. used_by_hw0; /* Refer to struct wbm_release_ring */
  2557. A_UINT32
  2558. used_by_hw1; /* Refer to struct wbm_release_ring */
  2559. A_UINT32
  2560. used_by_hw2: 9, /* Refer to struct wbm_release_ring */
  2561. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2562. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2563. exception_frame: 1,
  2564. rsvd0: 12, /* For future use */
  2565. used_by_hw4: 1, /* wbm_internal_error bit being used by HW */
  2566. rsvd1: 1; /* For future use */
  2567. A_UINT32
  2568. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2569. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2570. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2571. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2572. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2573. */
  2574. A_UINT32
  2575. data1: 32;
  2576. A_UINT32
  2577. data2: 32;
  2578. A_UINT32
  2579. used_by_hw3; /* Refer to struct wbm_release_ring */
  2580. } POSTPACK;
  2581. /* DWORD 1, 2 and part of 3 are accessed via HW header files */
  2582. /* DWORD 3 */
  2583. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M 0x00001e00
  2584. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S 9
  2585. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M 0x0001e000
  2586. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S 13
  2587. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M 0x00020000
  2588. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S 17
  2589. /* DWORD 3 */
  2590. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_GET(_var) \
  2591. (((_var) & HTT_TX_WBM_COMPLETION_V2_TX_STATUS_M) >> \
  2592. HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)
  2593. #define HTT_TX_WBM_COMPLETION_V2_TX_STATUS_SET(_var, _val) \
  2594. do { \
  2595. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TX_STATUS, _val); \
  2596. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TX_STATUS_S)); \
  2597. } while (0)
  2598. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_GET(_var) \
  2599. (((_var) & HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_M) >> \
  2600. HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)
  2601. #define HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_SET(_var, _val) \
  2602. do { \
  2603. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON, _val); \
  2604. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_REINJECT_REASON_S)); \
  2605. } while (0)
  2606. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_GET(_var) \
  2607. (((_var) & HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_M) >> \
  2608. HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)
  2609. #define HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_SET(_var, _val) \
  2610. do { \
  2611. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_EXP_FRAME, _val); \
  2612. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_EXP_FRAME_S)); \
  2613. } while (0)
  2614. /**
  2615. * @brief HTT TX WBM Completion from firmware to host (V3)
  2616. * @details
  2617. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2618. * (WBM) offload HW.
  2619. * This structure is passed from firmware to host overlayed on wbm_release_ring
  2620. * For software based completions, release_source_module will
  2621. * be set to WIFIRELEASE_SOURCE_FW_E. Host SW is expected to inspect using
  2622. * struct wbm_release_ring and then switch to this after looking at
  2623. * release_source_module.
  2624. * Due to overlap with WBM block, htt_tx_wbm_completion_v3 will be used
  2625. * by new generations of targets.
  2626. */
  2627. PREPACK struct htt_tx_wbm_completion_v3 {
  2628. A_UINT32
  2629. used_by_hw0; /* Refer to struct wbm_release_ring */
  2630. A_UINT32
  2631. used_by_hw1; /* Refer to struct wbm_release_ring */
  2632. A_UINT32
  2633. used_by_hw2: 13, /* Refer to struct wbm_release_ring */
  2634. tx_status: 4, /* Takes enum values of htt_tx_fw2wbm_tx_status_t */
  2635. used_by_hw3: 15;
  2636. A_UINT32
  2637. reinject_reason: 4, /* Takes enum values of htt_tx_fw2wbm_reinject_reason_t */
  2638. exception_frame: 1,
  2639. rsvd0: 27; /* For future use */
  2640. A_UINT32
  2641. data0: 32; /* data0,1 and 2 changes based on tx_status type
  2642. * if HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2643. * or HTT_TX_FW2WBM_TX_STATUS_TTL, struct htt_tx_wbm_transmit_status will be used.
  2644. * if HTT_TX_FW2WBM_TX_STATUS_REINJECT, struct htt_tx_wbm_reinject_status will be used.
  2645. * if HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY, struct htt_tx_wbm_mec_addr_notify will be used.
  2646. */
  2647. A_UINT32
  2648. data1: 32;
  2649. A_UINT32
  2650. data2: 32;
  2651. A_UINT32
  2652. rsvd1: 20,
  2653. used_by_hw4: 12; /* Refer to struct wbm_release_ring */
  2654. } POSTPACK;
  2655. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M 0x0001E000
  2656. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S 13
  2657. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M 0x0000000F
  2658. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S 0
  2659. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M 0x00000010
  2660. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S 4
  2661. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_GET(_var) \
  2662. (((_var) & HTT_TX_WBM_COMPLETION_V3_TX_STATUS_M) >> \
  2663. HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)
  2664. #define HTT_TX_WBM_COMPLETION_V3_TX_STATUS_SET(_var, _val) \
  2665. do { \
  2666. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_TX_STATUS, _val); \
  2667. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_TX_STATUS_S)); \
  2668. } while (0)
  2669. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_GET(_var) \
  2670. (((_var) & HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_M) >> \
  2671. HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)
  2672. #define HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_SET(_var, _val) \
  2673. do { \
  2674. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON, _val); \
  2675. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_REINJECT_REASON_S)); \
  2676. } while (0)
  2677. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_GET(_var) \
  2678. (((_var) & HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_M) >> \
  2679. HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)
  2680. #define HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_SET(_var, _val) \
  2681. do { \
  2682. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V3_EXP_FRAME, _val); \
  2683. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V3_EXP_FRAME_S)); \
  2684. } while (0)
  2685. typedef enum {
  2686. TX_FRAME_TYPE_UNDEFINED = 0,
  2687. TX_FRAME_TYPE_EAPOL = 1,
  2688. } htt_tx_wbm_status_frame_type;
  2689. /**
  2690. * @brief HTT TX WBM transmit status from firmware to host
  2691. * @details
  2692. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2693. * (WBM) offload HW.
  2694. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2695. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_OK or HTT_TX_FW2WBM_TX_STATUS_DROP
  2696. * or HTT_TX_FW2WBM_TX_STATUS_TTL
  2697. */
  2698. PREPACK struct htt_tx_wbm_transmit_status {
  2699. A_UINT32
  2700. sch_cmd_id: 24,
  2701. ack_frame_rssi: 8; /* If this frame is removed as the result of the
  2702. * reception of an ACK or BA, this field indicates
  2703. * the RSSI of the received ACK or BA frame.
  2704. * When the frame is removed as result of a direct
  2705. * remove command from the SW, this field is set
  2706. * to 0x0 (which is never a valid value when real
  2707. * RSSI is available).
  2708. * Units: dB w.r.t noise floor
  2709. */
  2710. A_UINT32
  2711. sw_peer_id: 16,
  2712. tid_num: 5,
  2713. valid: 1, /* If this "valid" flag is set, the sw_peer_id
  2714. * and tid_num fields contain valid data.
  2715. * If this "valid" flag is not set, the
  2716. * sw_peer_id and tid_num fields must be ignored.
  2717. */
  2718. mcast: 1,
  2719. mcast_valid: 1, /* If this "mcast_valid" is set, the mcast field
  2720. * contains valid data.
  2721. */
  2722. frame_type: 4, /* holds htt_tx_wbm_status_frame_type value */
  2723. reserved: 4;
  2724. A_UINT32
  2725. ppdu_start_tsf: 32; /* PPDU Start timestamp added for multicast
  2726. * packets in the wbm completion path
  2727. */
  2728. } POSTPACK;
  2729. /* DWORD 4 */
  2730. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M 0x00ffffff
  2731. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S 0
  2732. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M 0xff000000
  2733. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S 24
  2734. /* DWORD 5 */
  2735. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M 0x0000ffff
  2736. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S 0
  2737. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_M 0x001f0000
  2738. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_S 16
  2739. #define HTT_TX_WBM_COMPLETION_V2_VALID_M 0x00200000
  2740. #define HTT_TX_WBM_COMPLETION_V2_VALID_S 21
  2741. #define HTT_TX_WBM_COMPLETION_V2_MCAST_M 0x00400000
  2742. #define HTT_TX_WBM_COMPLETION_V2_MCAST_S 22
  2743. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M 0x00800000
  2744. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S 23
  2745. /* DWORD 4 */
  2746. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_GET(_var) \
  2747. (((_var) & HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_M) >> \
  2748. HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)
  2749. #define HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_SET(_var, _val) \
  2750. do { \
  2751. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID, _val); \
  2752. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SCH_CMD_ID_S)); \
  2753. } while (0)
  2754. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_GET(_var) \
  2755. (((_var) & HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_M) >> \
  2756. HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)
  2757. #define HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_SET(_var, _val) \
  2758. do { \
  2759. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI, _val); \
  2760. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_ACK_FRAME_RSSI_S)); \
  2761. } while (0)
  2762. /* DWORD 5 */
  2763. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_GET(_var) \
  2764. (((_var) & HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_M) >> \
  2765. HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)
  2766. #define HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_SET(_var, _val) \
  2767. do { \
  2768. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID, _val); \
  2769. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SW_PEER_ID_S)); \
  2770. } while (0)
  2771. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_GET(_var) \
  2772. (((_var) & HTT_TX_WBM_COMPLETION_V2_TID_NUM_M) >> \
  2773. HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)
  2774. #define HTT_TX_WBM_COMPLETION_V2_TID_NUM_SET(_var, _val) \
  2775. do { \
  2776. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_TID_NUM, _val); \
  2777. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_TID_NUM_S)); \
  2778. } while (0)
  2779. #define HTT_TX_WBM_COMPLETION_V2_VALID_GET(_var) \
  2780. (((_var) & HTT_TX_WBM_COMPLETION_V2_VALID_M) >> \
  2781. HTT_TX_WBM_COMPLETION_V2_VALID_S)
  2782. #define HTT_TX_WBM_COMPLETION_V2_VALID_SET(_var, _val) \
  2783. do { \
  2784. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VALID, _val); \
  2785. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VALID_S)); \
  2786. } while (0)
  2787. #define HTT_TX_WBM_COMPLETION_V2_MCAST_GET(_var) \
  2788. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_M) >> \
  2789. HTT_TX_WBM_COMPLETION_V2_MCAST_S)
  2790. #define HTT_TX_WBM_COMPLETION_V2_MCAST_SET(_var, _val) \
  2791. do { \
  2792. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST, _val); \
  2793. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_S)); \
  2794. } while (0)
  2795. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_GET(_var) \
  2796. (((_var) & HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_M) >> \
  2797. HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)
  2798. #define HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_SET(_var, _val) \
  2799. do { \
  2800. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MCAST_VALID, _val); \
  2801. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MCAST_VALID_S)); \
  2802. } while (0)
  2803. /**
  2804. * @brief HTT TX WBM reinject status from firmware to host
  2805. * @details
  2806. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2807. * (WBM) offload HW.
  2808. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2809. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_REINJECT.
  2810. */
  2811. PREPACK struct htt_tx_wbm_reinject_status {
  2812. A_UINT32
  2813. reserved0: 32;
  2814. A_UINT32
  2815. reserved1: 32;
  2816. A_UINT32
  2817. reserved2: 32;
  2818. } POSTPACK;
  2819. /**
  2820. * @brief HTT TX WBM multicast echo check notification from firmware to host
  2821. * @details
  2822. * This structure applies only to WLAN chips that contain WLAN Buffer Mgmt
  2823. * (WBM) offload HW.
  2824. * This structure is passed from firmware to host overlayed on wbm_release_ring.
  2825. * used only if tx_status is HTT_TX_FW2WBM_TX_STATUS_MEC_NOTIFY.
  2826. * FW sends SA addresses to host for all multicast/broadcast packets received on
  2827. * STA side.
  2828. */
  2829. PREPACK struct htt_tx_wbm_mec_addr_notify {
  2830. A_UINT32
  2831. mec_sa_addr_31_0;
  2832. A_UINT32
  2833. mec_sa_addr_47_32: 16,
  2834. sa_ast_index: 16;
  2835. A_UINT32
  2836. vdev_id: 8,
  2837. reserved0: 24;
  2838. } POSTPACK;
  2839. /* DWORD 4 - mec_sa_addr_31_0 */
  2840. /* DWORD 5 */
  2841. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M 0x0000ffff
  2842. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S 0
  2843. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M 0xffff0000
  2844. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S 16
  2845. /* DWORD 6 */
  2846. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M 0x000000ff
  2847. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S 0
  2848. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_GET(_var) \
  2849. (((_var) & HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_M) >> \
  2850. HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)
  2851. #define HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_SET(_var, _val) \
  2852. do { \
  2853. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32, _val); \
  2854. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_MEC_SA_ADDR_47_32_S)); \
  2855. } while (0)
  2856. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_GET(_var) \
  2857. (((_var) & HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_M) >> \
  2858. HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)
  2859. #define HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_SET(_var, _val) \
  2860. do { \
  2861. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX, _val); \
  2862. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_SA_AST_INDEX_S)); \
  2863. } while (0)
  2864. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_GET(_var) \
  2865. (((_var) & HTT_TX_WBM_COMPLETION_V2_VDEV_ID_M) >> \
  2866. HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)
  2867. #define HTT_TX_WBM_COMPLETION_V2_VDEV_ID_SET(_var, _val) \
  2868. do { \
  2869. HTT_CHECK_SET_VAL(HTT_TX_WBM_COMPLETION_V2_VDEV_ID, _val); \
  2870. ((_var) |= ((_val) << HTT_TX_WBM_COMPLETION_V2_VDEV_ID_S)); \
  2871. } while (0)
  2872. typedef enum {
  2873. TX_FLOW_PRIORITY_BE,
  2874. TX_FLOW_PRIORITY_HIGH,
  2875. TX_FLOW_PRIORITY_LOW,
  2876. } htt_tx_flow_priority_t;
  2877. typedef enum {
  2878. TX_FLOW_LATENCY_SENSITIVE,
  2879. TX_FLOW_LATENCY_INSENSITIVE,
  2880. } htt_tx_flow_latency_t;
  2881. typedef enum {
  2882. TX_FLOW_BEST_EFFORT_TRAFFIC,
  2883. TX_FLOW_INTERACTIVE_TRAFFIC,
  2884. TX_FLOW_PERIODIC_TRAFFIC,
  2885. TX_FLOW_BURSTY_TRAFFIC,
  2886. TX_FLOW_OVER_SUBSCRIBED_TRAFFIC,
  2887. } htt_tx_flow_traffic_pattern_t;
  2888. /**
  2889. * @brief HTT TX Flow search metadata format
  2890. * @details
  2891. * Host will set this metadata in flow table's flow search entry along with
  2892. * to_tqm_if_m0_fw. It indicates to forward the first MSDU to both the
  2893. * firmware and TQM ring if the flow search entry wins.
  2894. * This metadata is available to firmware in that first MSDU's
  2895. * tcl_exit_base->meta_data_fse. Firmware uses this metadata to map a new flow
  2896. * to one of the available flows for specific tid and returns the tqm flow
  2897. * pointer as part of htt_tx_map_flow_info message.
  2898. */
  2899. PREPACK struct htt_tx_flow_metadata {
  2900. A_UINT32
  2901. rsvd0_1_0: 2,
  2902. tid: 4,
  2903. priority: 3, /* Takes enum values of htt_tx_flow_priority_t */
  2904. traffic_pattern: 3, /* Takes enum values of htt_tx_flow_traffic_pattern_t */
  2905. tid_override: 1, /* If set, tid field in this struct is the final tid.
  2906. * Else choose final tid based on latency, priority.
  2907. */
  2908. dedicated_flowq: 1, /* Dedicated flowq per 5 tuple flow. */
  2909. latency_sensitive: 2, /* Takes enum values of htt_tx_flow_latency_t */
  2910. host_flow_identifier: 16; /* Used by host to map flow metadata with flow entry */
  2911. } POSTPACK;
  2912. /* DWORD 0 */
  2913. #define HTT_TX_FLOW_METADATA_TID_M 0x0000003c
  2914. #define HTT_TX_FLOW_METADATA_TID_S 2
  2915. #define HTT_TX_FLOW_METADATA_PRIORITY_M 0x000001c0
  2916. #define HTT_TX_FLOW_METADATA_PRIORITY_S 6
  2917. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M 0x00000e00
  2918. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S 9
  2919. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_M 0x00001000
  2920. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_S 12
  2921. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M 0x00002000
  2922. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S 13
  2923. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M 0x0000c000
  2924. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S 14
  2925. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M 0xffff0000
  2926. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S 16
  2927. /* DWORD 0 */
  2928. #define HTT_TX_FLOW_METADATA_TID_GET(_var) \
  2929. (((_var) & HTT_TX_FLOW_METADATA_TID_M) >> \
  2930. HTT_TX_FLOW_METADATA_TID_S)
  2931. #define HTT_TX_FLOW_METADATA_TID_SET(_var, _val) \
  2932. do { \
  2933. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID, _val); \
  2934. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_S)); \
  2935. } while (0)
  2936. #define HTT_TX_FLOW_METADATA_PRIORITY_GET(_var) \
  2937. (((_var) & HTT_TX_FLOW_PRIORITY_M) >> \
  2938. HTT_TX_FLOW_METADATA_PRIORITY_S)
  2939. #define HTT_TX_FLOW_METADATA_PRIORITY_SET(_var, _val) \
  2940. do { \
  2941. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_PRIORITY, _val); \
  2942. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_PRIORITY_S)); \
  2943. } while (0)
  2944. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_GET(_var) \
  2945. (((_var) & HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_M) >> \
  2946. HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)
  2947. #define HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_SET(_var, _val) \
  2948. do { \
  2949. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN, _val); \
  2950. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TRAFFIC_PATTERN_S)); \
  2951. } while (0)
  2952. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_GET(_var) \
  2953. (((_var) & HTT_TX_FLOW_METADATA_TID_OVERRIDE_M) >> \
  2954. HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)
  2955. #define HTT_TX_FLOW_METADATA_TID_OVERRIDE_SET(_var, _val) \
  2956. do { \
  2957. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_TID_OVERRIDE, _val); \
  2958. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_TID_OVERRIDE_S)); \
  2959. } while (0)
  2960. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_GET(_var) \
  2961. (((_var) & HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_M) >> \
  2962. HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)
  2963. #define HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_SET(_var, _val) \
  2964. do { \
  2965. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ, _val); \
  2966. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_DEDICATED_FLOWQ_S)); \
  2967. } while (0)
  2968. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_GET(_var) \
  2969. (((_var) & HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_M) >> \
  2970. HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_S)
  2971. #define HTT_TX_FLOW_METADATA_LATENCY_SENSITIVE_SET(_var, _val) \
  2972. do { \
  2973. HTT_CHECK_SET_VAL(HTT_TX_FLOW_LATENCY_SENSITIVE, _val); \
  2974. ((_var) |= ((_val) << HTT_TX_FLOW_LATENCY_SENSITIVE_S)); \
  2975. } while (0)
  2976. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_GET(_var) \
  2977. (((_var) & HTT_TX_FLOW_METADATA_HOST_FLOW_ID_M) >> \
  2978. HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)
  2979. #define HTT_TX_FLOW_METADATA_HOST_FLOW_ID_SET(_var, _val) \
  2980. do { \
  2981. HTT_CHECK_SET_VAL(HTT_TX_FLOW_METADATA_HOST_FLOW_ID, _val); \
  2982. ((_var) |= ((_val) << HTT_TX_FLOW_METADATA_HOST_FLOW_ID_S)); \
  2983. } while (0)
  2984. /**
  2985. * @brief host -> target ADD WDS Entry
  2986. *
  2987. * MSG_TYPE => HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY
  2988. *
  2989. * @brief host -> target DELETE WDS Entry
  2990. *
  2991. * MSG_TYPE => HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY
  2992. *
  2993. * @details
  2994. * HTT wds entry from source port learning
  2995. * Host will learn wds entries from rx and send this message to firmware
  2996. * to enable firmware to configure/delete AST entries for wds clients.
  2997. * Firmware creates Source address's AST entry with Transmit MAC's peer_id
  2998. * and when SA's entry is deleted, firmware removes this AST entry
  2999. *
  3000. * The message would appear as follows:
  3001. *
  3002. * |31 30|29 |17 16|15 8|7 0|
  3003. * |----------------+----------------+----------------+----------------|
  3004. * | rsvd0 |PDVID| vdev_id | msg_type |
  3005. * |-------------------------------------------------------------------|
  3006. * | sa_addr_31_0 |
  3007. * |-------------------------------------------------------------------|
  3008. * | | ta_peer_id | sa_addr_47_32 |
  3009. * |-------------------------------------------------------------------|
  3010. * Where PDVID = pdev_id
  3011. *
  3012. * The message is interpreted as follows:
  3013. *
  3014. * dword0 - b'0:7 - msg_type: This will be set to
  3015. * 0xd (HTT_H2T_MSG_TYPE_ADD_WDS_ENTRY) or
  3016. * 0xe (HTT_H2T_MSG_TYPE_DELETE_WDS_ENTRY)
  3017. *
  3018. * dword0 - b'8:15 - vdev_id
  3019. *
  3020. * dword0 - b'16:17 - pdev_id
  3021. *
  3022. * dword0 - b'18:31 - rsvd10: Reserved for future use
  3023. *
  3024. * dword1 - b'0:31 - sa_addr_31_0: Lower 32 bits of source mac address
  3025. *
  3026. * dword2 - b'0:15 - sa_addr_47_32: Upper 16 bits of source mac address
  3027. *
  3028. * dword2 - b'16:19 - ta_peer_id: peer id of Transmit MAC
  3029. */
  3030. PREPACK struct htt_wds_entry {
  3031. A_UINT32
  3032. msg_type: 8,
  3033. vdev_id: 8,
  3034. pdev_id: 2,
  3035. rsvd0: 14;
  3036. A_UINT32 sa_addr_31_0;
  3037. A_UINT32
  3038. sa_addr_47_32: 16,
  3039. ta_peer_id: 14,
  3040. rsvd2: 2;
  3041. } POSTPACK;
  3042. /* DWORD 0 */
  3043. #define HTT_WDS_ENTRY_VDEV_ID_M 0x0000ff00
  3044. #define HTT_WDS_ENTRY_VDEV_ID_S 8
  3045. #define HTT_WDS_ENTRY_PDEV_ID_M 0x00030000
  3046. #define HTT_WDS_ENTRY_PDEV_ID_S 16
  3047. /* DWORD 2 */
  3048. #define HTT_WDS_ENTRY_SA_ADDR_47_32_M 0x0000ffff
  3049. #define HTT_WDS_ENTRY_SA_ADDR_47_32_S 0
  3050. #define HTT_WDS_ENTRY_TA_PEER_ID_M 0x3fff0000
  3051. #define HTT_WDS_ENTRY_TA_PEER_ID_S 16
  3052. /* DWORD 0 */
  3053. #define HTT_WDS_ENTRY_VDEV_ID_GET(_var) \
  3054. (((_var) & HTT_WDS_ENTRY_VDEV_ID_M) >> \
  3055. HTT_WDS_ENTRY_VDEV_ID_S)
  3056. #define HTT_WDS_ENTRY_VDEV_ID_SET(_var, _val) \
  3057. do { \
  3058. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_VDEV_ID, _val); \
  3059. ((_var) |= ((_val) << HTT_WDS_ENTRY_VDEV_ID_S)); \
  3060. } while (0)
  3061. #define HTT_WDS_ENTRY_PDEV_ID_GET(_var) \
  3062. (((_var) & HTT_WDS_ENTRY_PDEV_ID_M) >> \
  3063. HTT_WDS_ENTRY_PDEV_ID_S)
  3064. #define HTT_WDS_ENTRY_PDEV_ID_SET(_var, _val) \
  3065. do { \
  3066. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_PDEV_ID, _val); \
  3067. ((_var) |= ((_val) << HTT_WDS_ENTRY_PDEV_ID_S)); \
  3068. } while (0)
  3069. /* DWORD 2 */
  3070. #define HTT_WDS_ENTRY_SA_ADDR_47_32_GET(_var) \
  3071. (((_var) & HTT_WDS_ENTRY_SA_ADDR_47_32_M) >> \
  3072. HTT_WDS_ENTRY_SA_ADDR_47_32_S)
  3073. #define HTT_WDS_ENTRY_SA_ADDR_47_32_SET(_var, _val) \
  3074. do { \
  3075. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_SA_ADDR_47_32, _val); \
  3076. ((_var) |= ((_val) << HTT_WDS_ENTRY_SA_ADDR_47_32_S)); \
  3077. } while (0)
  3078. #define HTT_WDS_ENTRY_TA_PEER_ID_GET(_var) \
  3079. (((_var) & HTT_WDS_ENTRY_TA_PEER_ID_M) >> \
  3080. HTT_WDS_ENTRY_TA_PEER_ID_S)
  3081. #define HTT_WDS_ENTRY_TA_PEER_ID_SET(_var, _val) \
  3082. do { \
  3083. HTT_CHECK_SET_VAL(HTT_WDS_ENTRY_TA_PEER_ID, _val); \
  3084. ((_var) |= ((_val) << HTT_WDS_ENTRY_TA_PEER_ID_S)); \
  3085. } while (0)
  3086. /**
  3087. * @brief MAC DMA rx ring setup specification
  3088. *
  3089. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_CFG
  3090. *
  3091. * @details
  3092. * To allow for dynamic rx ring reconfiguration and to avoid race
  3093. * conditions, the host SW never directly programs the MAC DMA rx ring(s)
  3094. * it uses. Instead, it sends this message to the target, indicating how
  3095. * the rx ring used by the host should be set up and maintained.
  3096. * The message consists of a 4-octet header followed by 1 or 2 rx ring setup
  3097. * specifications.
  3098. *
  3099. * |31 16|15 8|7 0|
  3100. * |---------------------------------------------------------------|
  3101. * header: | reserved | num rings | msg type |
  3102. * |---------------------------------------------------------------|
  3103. * payload 1: | FW_IDX shadow register physical address (bits 31:0) |
  3104. #if HTT_PADDR64
  3105. * | FW_IDX shadow register physical address (bits 63:32) |
  3106. #endif
  3107. * |---------------------------------------------------------------|
  3108. * | rx ring base physical address (bits 31:0) |
  3109. #if HTT_PADDR64
  3110. * | rx ring base physical address (bits 63:32) |
  3111. #endif
  3112. * |---------------------------------------------------------------|
  3113. * | rx ring buffer size | rx ring length |
  3114. * |---------------------------------------------------------------|
  3115. * | FW_IDX initial value | enabled flags |
  3116. * |---------------------------------------------------------------|
  3117. * | MSDU payload offset | 802.11 header offset |
  3118. * |---------------------------------------------------------------|
  3119. * | PPDU end offset | PPDU start offset |
  3120. * |---------------------------------------------------------------|
  3121. * | MPDU end offset | MPDU start offset |
  3122. * |---------------------------------------------------------------|
  3123. * | MSDU end offset | MSDU start offset |
  3124. * |---------------------------------------------------------------|
  3125. * | frag info offset | rx attention offset |
  3126. * |---------------------------------------------------------------|
  3127. * payload 2, if present, has the same format as payload 1
  3128. * Header fields:
  3129. * - MSG_TYPE
  3130. * Bits 7:0
  3131. * Purpose: identifies this as an rx ring configuration message
  3132. * Value: 0x2 (HTT_H2T_MSG_TYPE_RX_RING_CFG)
  3133. * - NUM_RINGS
  3134. * Bits 15:8
  3135. * Purpose: indicates whether the host is setting up one rx ring or two
  3136. * Value: 1 or 2
  3137. * Payload:
  3138. * for systems using 64-bit format for bus addresses:
  3139. * - IDX_SHADOW_REG_PADDR_LO
  3140. * Bits 31:0
  3141. * Value: lower 4 bytes of physical address of the host's
  3142. * FW_IDX shadow register
  3143. * - IDX_SHADOW_REG_PADDR_HI
  3144. * Bits 31:0
  3145. * Value: upper 4 bytes of physical address of the host's
  3146. * FW_IDX shadow register
  3147. * - RING_BASE_PADDR_LO
  3148. * Bits 31:0
  3149. * Value: lower 4 bytes of physical address of the host's rx ring
  3150. * - RING_BASE_PADDR_HI
  3151. * Bits 31:0
  3152. * Value: uppper 4 bytes of physical address of the host's rx ring
  3153. * for systems using 32-bit format for bus addresses:
  3154. * - IDX_SHADOW_REG_PADDR
  3155. * Bits 31:0
  3156. * Value: physical address of the host's FW_IDX shadow register
  3157. * - RING_BASE_PADDR
  3158. * Bits 31:0
  3159. * Value: physical address of the host's rx ring
  3160. * - RING_LEN
  3161. * Bits 15:0
  3162. * Value: number of elements in the rx ring
  3163. * - RING_BUF_SZ
  3164. * Bits 31:16
  3165. * Value: size of the buffers referenced by the rx ring, in byte units
  3166. * - ENABLED_FLAGS
  3167. * Bits 15:0
  3168. * Value: 1-bit flags to show whether different rx fields are enabled
  3169. * bit 0: 802.11 header enabled (1) or disabled (0)
  3170. * bit 1: MSDU payload enabled (1) or disabled (0)
  3171. * bit 2: PPDU start enabled (1) or disabled (0)
  3172. * bit 3: PPDU end enabled (1) or disabled (0)
  3173. * bit 4: MPDU start enabled (1) or disabled (0)
  3174. * bit 5: MPDU end enabled (1) or disabled (0)
  3175. * bit 6: MSDU start enabled (1) or disabled (0)
  3176. * bit 7: MSDU end enabled (1) or disabled (0)
  3177. * bit 8: rx attention enabled (1) or disabled (0)
  3178. * bit 9: frag info enabled (1) or disabled (0)
  3179. * bit 10: unicast rx enabled (1) or disabled (0)
  3180. * bit 11: multicast rx enabled (1) or disabled (0)
  3181. * bit 12: ctrl rx enabled (1) or disabled (0)
  3182. * bit 13: mgmt rx enabled (1) or disabled (0)
  3183. * bit 14: null rx enabled (1) or disabled (0)
  3184. * bit 15: phy data rx enabled (1) or disabled (0)
  3185. * - IDX_INIT_VAL
  3186. * Bits 31:16
  3187. * Purpose: Specify the initial value for the FW_IDX.
  3188. * Value: the number of buffers initially present in the host's rx ring
  3189. * - OFFSET_802_11_HDR
  3190. * Bits 15:0
  3191. * Value: offset in QUAD-bytes of 802.11 header from the buffer start
  3192. * - OFFSET_MSDU_PAYLOAD
  3193. * Bits 31:16
  3194. * Value: offset in QUAD-bytes of MSDU payload from the buffer start
  3195. * - OFFSET_PPDU_START
  3196. * Bits 15:0
  3197. * Value: offset in QUAD-bytes of PPDU start rx desc from the buffer start
  3198. * - OFFSET_PPDU_END
  3199. * Bits 31:16
  3200. * Value: offset in QUAD-bytes of PPDU end rx desc from the buffer start
  3201. * - OFFSET_MPDU_START
  3202. * Bits 15:0
  3203. * Value: offset in QUAD-bytes of MPDU start rx desc from the buffer start
  3204. * - OFFSET_MPDU_END
  3205. * Bits 31:16
  3206. * Value: offset in QUAD-bytes of MPDU end rx desc from the buffer start
  3207. * - OFFSET_MSDU_START
  3208. * Bits 15:0
  3209. * Value: offset in QUAD-bytes of MSDU start rx desc from the buffer start
  3210. * - OFFSET_MSDU_END
  3211. * Bits 31:16
  3212. * Value: offset in QUAD-bytes of MSDU end rx desc from the buffer start
  3213. * - OFFSET_RX_ATTN
  3214. * Bits 15:0
  3215. * Value: offset in QUAD-bytes of rx attention word from the buffer start
  3216. * - OFFSET_FRAG_INFO
  3217. * Bits 31:16
  3218. * Value: offset in QUAD-bytes of frag info table
  3219. */
  3220. /* header fields */
  3221. #define HTT_RX_RING_CFG_NUM_RINGS_M 0xff00
  3222. #define HTT_RX_RING_CFG_NUM_RINGS_S 8
  3223. /* payload fields */
  3224. /* for systems using a 64-bit format for bus addresses */
  3225. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_M 0xffffffff
  3226. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_S 0
  3227. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_M 0xffffffff
  3228. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_S 0
  3229. #define HTT_RX_RING_CFG_BASE_PADDR_HI_M 0xffffffff
  3230. #define HTT_RX_RING_CFG_BASE_PADDR_HI_S 0
  3231. #define HTT_RX_RING_CFG_BASE_PADDR_LO_M 0xffffffff
  3232. #define HTT_RX_RING_CFG_BASE_PADDR_LO_S 0
  3233. /* for systems using a 32-bit format for bus addresses */
  3234. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_M 0xffffffff
  3235. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_S 0
  3236. #define HTT_RX_RING_CFG_BASE_PADDR_M 0xffffffff
  3237. #define HTT_RX_RING_CFG_BASE_PADDR_S 0
  3238. #define HTT_RX_RING_CFG_LEN_M 0xffff
  3239. #define HTT_RX_RING_CFG_LEN_S 0
  3240. #define HTT_RX_RING_CFG_BUF_SZ_M 0xffff0000
  3241. #define HTT_RX_RING_CFG_BUF_SZ_S 16
  3242. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_M 0x1
  3243. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_S 0
  3244. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M 0x2
  3245. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S 1
  3246. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_M 0x4
  3247. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_S 2
  3248. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_M 0x8
  3249. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_S 3
  3250. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_M 0x10
  3251. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_S 4
  3252. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_M 0x20
  3253. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_S 5
  3254. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_M 0x40
  3255. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_S 6
  3256. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_M 0x80
  3257. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_S 7
  3258. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_M 0x100
  3259. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_S 8
  3260. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M 0x200
  3261. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S 9
  3262. #define HTT_RX_RING_CFG_ENABLED_UCAST_M 0x400
  3263. #define HTT_RX_RING_CFG_ENABLED_UCAST_S 10
  3264. #define HTT_RX_RING_CFG_ENABLED_MCAST_M 0x800
  3265. #define HTT_RX_RING_CFG_ENABLED_MCAST_S 11
  3266. #define HTT_RX_RING_CFG_ENABLED_CTRL_M 0x1000
  3267. #define HTT_RX_RING_CFG_ENABLED_CTRL_S 12
  3268. #define HTT_RX_RING_CFG_ENABLED_MGMT_M 0x2000
  3269. #define HTT_RX_RING_CFG_ENABLED_MGMT_S 13
  3270. #define HTT_RX_RING_CFG_ENABLED_NULL_M 0x4000
  3271. #define HTT_RX_RING_CFG_ENABLED_NULL_S 14
  3272. #define HTT_RX_RING_CFG_ENABLED_PHY_M 0x8000
  3273. #define HTT_RX_RING_CFG_ENABLED_PHY_S 15
  3274. #define HTT_RX_RING_CFG_IDX_INIT_VAL_M 0xffff0000
  3275. #define HTT_RX_RING_CFG_IDX_INIT_VAL_S 16
  3276. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_M 0xffff
  3277. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_S 0
  3278. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M 0xffff0000
  3279. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S 16
  3280. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_M 0xffff
  3281. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_S 0
  3282. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_M 0xffff0000
  3283. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_S 16
  3284. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_M 0xffff
  3285. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_S 0
  3286. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_M 0xffff0000
  3287. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_S 16
  3288. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_M 0xffff
  3289. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_S 0
  3290. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_M 0xffff0000
  3291. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_S 16
  3292. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_M 0xffff
  3293. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_S 0
  3294. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M 0xffff0000
  3295. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S 16
  3296. #define HTT_RX_RING_CFG_HDR_BYTES 4
  3297. #define HTT_RX_RING_CFG_PAYLD_BYTES_64 44
  3298. #define HTT_RX_RING_CFG_PAYLD_BYTES_32 36
  3299. #if HTT_PADDR64
  3300. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_64
  3301. #else
  3302. #define HTT_RX_RING_CFG_PAYLD_BYTES HTT_RX_RING_CFG_PAYLD_BYTES_32
  3303. #endif
  3304. #define HTT_RX_RING_CFG_BYTES(num_rings) \
  3305. (HTT_RX_RING_CFG_HDR_BYTES + (num_rings) * HTT_RX_RING_CFG_PAYLD_BYTES)
  3306. #define HTT_RX_RING_CFG_NUM_RINGS_GET(_var) \
  3307. (((_var) & HTT_RX_RING_CFG_NUM_RINGS_M) >> HTT_RX_RING_CFG_NUM_RINGS_S)
  3308. #define HTT_RX_RING_CFG_NUM_RINGS_SET(_var, _val) \
  3309. do { \
  3310. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_NUM_RINGS, _val); \
  3311. ((_var) |= ((_val) << HTT_RX_RING_CFG_NUM_RINGS_S)); \
  3312. } while (0)
  3313. /* degenerate case for 32-bit fields */
  3314. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_GET(_var) (_var)
  3315. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_HI_SET(_var, _val) \
  3316. ((_var) = (_val))
  3317. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_GET(_var) (_var)
  3318. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_LO_SET(_var, _val) \
  3319. ((_var) = (_val))
  3320. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_GET(_var) (_var)
  3321. #define HTT_RX_RING_CFG_IDX_SHADOW_REG_PADDR_SET(_var, _val) \
  3322. ((_var) = (_val))
  3323. /* degenerate case for 32-bit fields */
  3324. #define HTT_RX_RING_CFG_BASE_PADDR_HI_GET(_var) (_var)
  3325. #define HTT_RX_RING_CFG_BASE_PADDR_HI_SET(_var, _val) \
  3326. ((_var) = (_val))
  3327. #define HTT_RX_RING_CFG_BASE_PADDR_LO_GET(_var) (_var)
  3328. #define HTT_RX_RING_CFG_BASE_PADDR_LO_SET(_var, _val) \
  3329. ((_var) = (_val))
  3330. #define HTT_RX_RING_CFG_BASE_PADDR_GET(_var) (_var)
  3331. #define HTT_RX_RING_CFG_BASE_PADDR_SET(_var, _val) \
  3332. ((_var) = (_val))
  3333. #define HTT_RX_RING_CFG_LEN_GET(_var) \
  3334. (((_var) & HTT_RX_RING_CFG_LEN_M) >> HTT_RX_RING_CFG_LEN_S)
  3335. #define HTT_RX_RING_CFG_LEN_SET(_var, _val) \
  3336. do { \
  3337. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_LEN, _val); \
  3338. ((_var) |= ((_val) << HTT_RX_RING_CFG_LEN_S)); \
  3339. } while (0)
  3340. #define HTT_RX_RING_CFG_BUF_SZ_GET(_var) \
  3341. (((_var) & HTT_RX_RING_CFG_BUF_SZ_M) >> HTT_RX_RING_CFG_BUF_SZ_S)
  3342. #define HTT_RX_RING_CFG_BUF_SZ_SET(_var, _val) \
  3343. do { \
  3344. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_BUF_SZ, _val); \
  3345. ((_var) |= ((_val) << HTT_RX_RING_CFG_BUF_SZ_S)); \
  3346. } while (0)
  3347. #define HTT_RX_RING_CFG_IDX_INIT_VAL_GET(_var) \
  3348. (((_var) & HTT_RX_RING_CFG_IDX_INIT_VAL_M) >> \
  3349. HTT_RX_RING_CFG_IDX_INIT_VAL_S)
  3350. #define HTT_RX_RING_CFG_IDX_INIT_VAL_SET(_var, _val) \
  3351. do { \
  3352. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_IDX_INIT_VAL, _val); \
  3353. ((_var) |= ((_val) << HTT_RX_RING_CFG_IDX_INIT_VAL_S)); \
  3354. } while (0)
  3355. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_GET(_var) \
  3356. (((_var) & HTT_RX_RING_CFG_ENABLED_802_11_HDR_M) >> \
  3357. HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)
  3358. #define HTT_RX_RING_CFG_ENABLED_802_11_HDR_SET(_var, _val) \
  3359. do { \
  3360. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_802_11_HDR, _val); \
  3361. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_802_11_HDR_S)); \
  3362. } while (0)
  3363. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_GET(_var) \
  3364. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_M) >> \
  3365. HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)
  3366. #define HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_SET(_var, _val) \
  3367. do { \
  3368. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD, _val); \
  3369. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_PAYLD_S)); \
  3370. } while (0)
  3371. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_GET(_var) \
  3372. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_START_M) >> \
  3373. HTT_RX_RING_CFG_ENABLED_PPDU_START_S)
  3374. #define HTT_RX_RING_CFG_ENABLED_PPDU_START_SET(_var, _val) \
  3375. do { \
  3376. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_START, _val); \
  3377. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_START_S)); \
  3378. } while (0)
  3379. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_GET(_var) \
  3380. (((_var) & HTT_RX_RING_CFG_ENABLED_PPDU_END_M) >> \
  3381. HTT_RX_RING_CFG_ENABLED_PPDU_END_S)
  3382. #define HTT_RX_RING_CFG_ENABLED_PPDU_END_SET(_var, _val) \
  3383. do { \
  3384. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PPDU_END, _val); \
  3385. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PPDU_END_S)); \
  3386. } while (0)
  3387. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_GET(_var) \
  3388. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_START_M) >> \
  3389. HTT_RX_RING_CFG_ENABLED_MPDU_START_S)
  3390. #define HTT_RX_RING_CFG_ENABLED_MPDU_START_SET(_var, _val) \
  3391. do { \
  3392. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_START, _val); \
  3393. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_START_S)); \
  3394. } while (0)
  3395. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_GET(_var) \
  3396. (((_var) & HTT_RX_RING_CFG_ENABLED_MPDU_END_M) >> \
  3397. HTT_RX_RING_CFG_ENABLED_MPDU_END_S)
  3398. #define HTT_RX_RING_CFG_ENABLED_MPDU_END_SET(_var, _val) \
  3399. do { \
  3400. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MPDU_END, _val); \
  3401. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MPDU_END_S)); \
  3402. } while (0)
  3403. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_GET(_var) \
  3404. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_START_M) >> \
  3405. HTT_RX_RING_CFG_ENABLED_MSDU_START_S)
  3406. #define HTT_RX_RING_CFG_ENABLED_MSDU_START_SET(_var, _val) \
  3407. do { \
  3408. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_START, _val); \
  3409. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_START_S)); \
  3410. } while (0)
  3411. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_GET(_var) \
  3412. (((_var) & HTT_RX_RING_CFG_ENABLED_MSDU_END_M) >> \
  3413. HTT_RX_RING_CFG_ENABLED_MSDU_END_S)
  3414. #define HTT_RX_RING_CFG_ENABLED_MSDU_END_SET(_var, _val) \
  3415. do { \
  3416. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MSDU_END, _val); \
  3417. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MSDU_END_S)); \
  3418. } while (0)
  3419. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_GET(_var) \
  3420. (((_var) & HTT_RX_RING_CFG_ENABLED_RX_ATTN_M) >> \
  3421. HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)
  3422. #define HTT_RX_RING_CFG_ENABLED_RX_ATTN_SET(_var, _val) \
  3423. do { \
  3424. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_RX_ATTN, _val); \
  3425. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_RX_ATTN_S)); \
  3426. } while (0)
  3427. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_GET(_var) \
  3428. (((_var) & HTT_RX_RING_CFG_ENABLED_FRAG_INFO_M) >> \
  3429. HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)
  3430. #define HTT_RX_RING_CFG_ENABLED_FRAG_INFO_SET(_var, _val) \
  3431. do { \
  3432. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_FRAG_INFO, _val); \
  3433. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_FRAG_INFO_S)); \
  3434. } while (0)
  3435. #define HTT_RX_RING_CFG_ENABLED_UCAST_GET(_var) \
  3436. (((_var) & HTT_RX_RING_CFG_ENABLED_UCAST_M) >> \
  3437. HTT_RX_RING_CFG_ENABLED_UCAST_S)
  3438. #define HTT_RX_RING_CFG_ENABLED_UCAST_SET(_var, _val) \
  3439. do { \
  3440. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_UCAST, _val); \
  3441. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_UCAST_S)); \
  3442. } while (0)
  3443. #define HTT_RX_RING_CFG_ENABLED_MCAST_GET(_var) \
  3444. (((_var) & HTT_RX_RING_CFG_ENABLED_MCAST_M) >> \
  3445. HTT_RX_RING_CFG_ENABLED_MCAST_S)
  3446. #define HTT_RX_RING_CFG_ENABLED_MCAST_SET(_var, _val) \
  3447. do { \
  3448. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MCAST, _val); \
  3449. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MCAST_S)); \
  3450. } while (0)
  3451. #define HTT_RX_RING_CFG_ENABLED_CTRL_GET(_var) \
  3452. (((_var) & HTT_RX_RING_CFG_ENABLED_CTRL_M) >> \
  3453. HTT_RX_RING_CFG_ENABLED_CTRL_S)
  3454. #define HTT_RX_RING_CFG_ENABLED_CTRL_SET(_var, _val) \
  3455. do { \
  3456. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_CTRL, _val); \
  3457. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_CTRL_S)); \
  3458. } while (0)
  3459. #define HTT_RX_RING_CFG_ENABLED_MGMT_GET(_var) \
  3460. (((_var) & HTT_RX_RING_CFG_ENABLED_MGMT_M) >> \
  3461. HTT_RX_RING_CFG_ENABLED_MGMT_S)
  3462. #define HTT_RX_RING_CFG_ENABLED_MGMT_SET(_var, _val) \
  3463. do { \
  3464. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_MGMT, _val); \
  3465. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_MGMT_S)); \
  3466. } while (0)
  3467. #define HTT_RX_RING_CFG_ENABLED_NULL_GET(_var) \
  3468. (((_var) & HTT_RX_RING_CFG_ENABLED_NULL_M) >> \
  3469. HTT_RX_RING_CFG_ENABLED_NULL_S)
  3470. #define HTT_RX_RING_CFG_ENABLED_NULL_SET(_var, _val) \
  3471. do { \
  3472. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_NULL, _val); \
  3473. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_NULL_S)); \
  3474. } while (0)
  3475. #define HTT_RX_RING_CFG_ENABLED_PHY_GET(_var) \
  3476. (((_var) & HTT_RX_RING_CFG_ENABLED_PHY_M) >> \
  3477. HTT_RX_RING_CFG_ENABLED_PHY_S)
  3478. #define HTT_RX_RING_CFG_ENABLED_PHY_SET(_var, _val) \
  3479. do { \
  3480. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_ENABLED_PHY, _val); \
  3481. ((_var) |= ((_val) << HTT_RX_RING_CFG_ENABLED_PHY_S)); \
  3482. } while (0)
  3483. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_GET(_var) \
  3484. (((_var) & HTT_RX_RING_CFG_OFFSET_802_11_HDR_M) >> \
  3485. HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)
  3486. #define HTT_RX_RING_CFG_OFFSET_802_11_HDR_SET(_var, _val) \
  3487. do { \
  3488. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_802_11_HDR, _val); \
  3489. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_802_11_HDR_S)); \
  3490. } while (0)
  3491. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_GET(_var) \
  3492. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_M) >> \
  3493. HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)
  3494. #define HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_SET(_var, _val) \
  3495. do { \
  3496. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD, _val); \
  3497. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_PAYLD_S)); \
  3498. } while (0)
  3499. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_GET(_var) \
  3500. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_START_M) >> \
  3501. HTT_RX_RING_CFG_OFFSET_PPDU_START_S)
  3502. #define HTT_RX_RING_CFG_OFFSET_PPDU_START_SET(_var, _val) \
  3503. do { \
  3504. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_START, _val); \
  3505. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_START_S)); \
  3506. } while (0)
  3507. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_GET(_var) \
  3508. (((_var) & HTT_RX_RING_CFG_OFFSET_PPDU_END_M) >> \
  3509. HTT_RX_RING_CFG_OFFSET_PPDU_END_S)
  3510. #define HTT_RX_RING_CFG_OFFSET_PPDU_END_SET(_var, _val) \
  3511. do { \
  3512. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_PPDU_END, _val); \
  3513. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_PPDU_END_S)); \
  3514. } while (0)
  3515. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_GET(_var) \
  3516. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_START_M) >> \
  3517. HTT_RX_RING_CFG_OFFSET_MPDU_START_S)
  3518. #define HTT_RX_RING_CFG_OFFSET_MPDU_START_SET(_var, _val) \
  3519. do { \
  3520. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_START, _val); \
  3521. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_START_S)); \
  3522. } while (0)
  3523. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_GET(_var) \
  3524. (((_var) & HTT_RX_RING_CFG_OFFSET_MPDU_END_M) >> \
  3525. HTT_RX_RING_CFG_OFFSET_MPDU_END_S)
  3526. #define HTT_RX_RING_CFG_OFFSET_MPDU_END_SET(_var, _val) \
  3527. do { \
  3528. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MPDU_END, _val); \
  3529. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MPDU_END_S)); \
  3530. } while (0)
  3531. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_GET(_var) \
  3532. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_START_M) >> \
  3533. HTT_RX_RING_CFG_OFFSET_MSDU_START_S)
  3534. #define HTT_RX_RING_CFG_OFFSET_MSDU_START_SET(_var, _val) \
  3535. do { \
  3536. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_START, _val); \
  3537. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_START_S)); \
  3538. } while (0)
  3539. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_GET(_var) \
  3540. (((_var) & HTT_RX_RING_CFG_OFFSET_MSDU_END_M) >> \
  3541. HTT_RX_RING_CFG_OFFSET_MSDU_END_S)
  3542. #define HTT_RX_RING_CFG_OFFSET_MSDU_END_SET(_var, _val) \
  3543. do { \
  3544. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_MSDU_END, _val); \
  3545. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_MSDU_END_S)); \
  3546. } while (0)
  3547. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_GET(_var) \
  3548. (((_var) & HTT_RX_RING_CFG_OFFSET_RX_ATTN_M) >> \
  3549. HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)
  3550. #define HTT_RX_RING_CFG_OFFSET_RX_ATTN_SET(_var, _val) \
  3551. do { \
  3552. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_RX_ATTN, _val); \
  3553. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_RX_ATTN_S)); \
  3554. } while (0)
  3555. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_GET(_var) \
  3556. (((_var) & HTT_RX_RING_CFG_OFFSET_FRAG_INFO_M) >> \
  3557. HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)
  3558. #define HTT_RX_RING_CFG_OFFSET_FRAG_INFO_SET(_var, _val) \
  3559. do { \
  3560. HTT_CHECK_SET_VAL(HTT_RX_RING_CFG_OFFSET_FRAG_INFO, _val); \
  3561. ((_var) |= ((_val) << HTT_RX_RING_CFG_OFFSET_FRAG_INFO_S)); \
  3562. } while (0)
  3563. /**
  3564. * @brief host -> target FW statistics retrieve
  3565. *
  3566. * MSG_TYPE => HTT_H2T_MSG_TYPE_STATS_REQ
  3567. *
  3568. * @details
  3569. * The following field definitions describe the format of the HTT host
  3570. * to target FW stats retrieve message. The message specifies the type of
  3571. * stats host wants to retrieve.
  3572. *
  3573. * |31 24|23 16|15 8|7 0|
  3574. * |-----------------------------------------------------------|
  3575. * | stats types request bitmask | msg type |
  3576. * |-----------------------------------------------------------|
  3577. * | stats types reset bitmask | reserved |
  3578. * |-----------------------------------------------------------|
  3579. * | stats type | config value |
  3580. * |-----------------------------------------------------------|
  3581. * | cookie LSBs |
  3582. * |-----------------------------------------------------------|
  3583. * | cookie MSBs |
  3584. * |-----------------------------------------------------------|
  3585. * Header fields:
  3586. * - MSG_TYPE
  3587. * Bits 7:0
  3588. * Purpose: identifies this is a stats upload request message
  3589. * Value: 0x3 (HTT_H2T_MSG_TYPE_STATS_REQ)
  3590. * - UPLOAD_TYPES
  3591. * Bits 31:8
  3592. * Purpose: identifies which types of FW statistics to upload
  3593. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3594. * - RESET_TYPES
  3595. * Bits 31:8
  3596. * Purpose: identifies which types of FW statistics to reset
  3597. * Value: mask with bits set in positions defined by htt_dbg_stats_type
  3598. * - CFG_VAL
  3599. * Bits 23:0
  3600. * Purpose: give an opaque configuration value to the specified stats type
  3601. * Value: stats-type specific configuration value
  3602. * if stats type == tx PPDU log, then CONFIG_VAL has the format:
  3603. * bits 7:0 - how many per-MPDU byte counts to include in a record
  3604. * bits 15:8 - how many per-MPDU MSDU counts to include in a record
  3605. * bits 23:16 - how many per-MSDU byte counts to include in a record
  3606. * - CFG_STAT_TYPE
  3607. * Bits 31:24
  3608. * Purpose: specify which stats type (if any) the config value applies to
  3609. * Value: htt_dbg_stats_type value, or 0xff if the message doesn't have
  3610. * a valid configuration specification
  3611. * - COOKIE_LSBS
  3612. * Bits 31:0
  3613. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3614. * message with its preceding host->target stats request message.
  3615. * Value: LSBs of the opaque cookie specified by the host-side requestor
  3616. * - COOKIE_MSBS
  3617. * Bits 31:0
  3618. * Purpose: Provide a mechanism to match a target->host stats confirmation
  3619. * message with its preceding host->target stats request message.
  3620. * Value: MSBs of the opaque cookie specified by the host-side requestor
  3621. */
  3622. #define HTT_H2T_STATS_REQ_MSG_SZ 20 /* bytes */
  3623. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_INVALID 0xff
  3624. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_M 0xffffff00
  3625. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_S 8
  3626. #define HTT_H2T_STATS_REQ_RESET_TYPES_M 0xffffff00
  3627. #define HTT_H2T_STATS_REQ_RESET_TYPES_S 8
  3628. #define HTT_H2T_STATS_REQ_CFG_VAL_M 0x00ffffff
  3629. #define HTT_H2T_STATS_REQ_CFG_VAL_S 0
  3630. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M 0xff000000
  3631. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S 24
  3632. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_GET(_var) \
  3633. (((_var) & HTT_H2T_STATS_REQ_UPLOAD_TYPES_M) >> \
  3634. HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)
  3635. #define HTT_H2T_STATS_REQ_UPLOAD_TYPES_SET(_var, _val) \
  3636. do { \
  3637. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_UPLOAD_TYPES, _val); \
  3638. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_UPLOAD_TYPES_S)); \
  3639. } while (0)
  3640. #define HTT_H2T_STATS_REQ_RESET_TYPES_GET(_var) \
  3641. (((_var) & HTT_H2T_STATS_REQ_RESET_TYPES_M) >> \
  3642. HTT_H2T_STATS_REQ_RESET_TYPES_S)
  3643. #define HTT_H2T_STATS_REQ_RESET_TYPES_SET(_var, _val) \
  3644. do { \
  3645. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_RESET_TYPES, _val); \
  3646. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_RESET_TYPES_S)); \
  3647. } while (0)
  3648. #define HTT_H2T_STATS_REQ_CFG_VAL_GET(_var) \
  3649. (((_var) & HTT_H2T_STATS_REQ_CFG_VAL_M) >> \
  3650. HTT_H2T_STATS_REQ_CFG_VAL_S)
  3651. #define HTT_H2T_STATS_REQ_CFG_VAL_SET(_var, _val) \
  3652. do { \
  3653. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_VAL, _val); \
  3654. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_VAL_S)); \
  3655. } while (0)
  3656. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_GET(_var) \
  3657. (((_var) & HTT_H2T_STATS_REQ_CFG_STAT_TYPE_M) >> \
  3658. HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)
  3659. #define HTT_H2T_STATS_REQ_CFG_STAT_TYPE_SET(_var, _val) \
  3660. do { \
  3661. HTT_CHECK_SET_VAL(HTT_H2T_STATS_REQ_CFG_STAT_TYPE, _val); \
  3662. ((_var) |= ((_val) << HTT_H2T_STATS_REQ_CFG_STAT_TYPE_S)); \
  3663. } while (0)
  3664. /**
  3665. * @brief host -> target HTT out-of-band sync request
  3666. *
  3667. * MSG_TYPE => HTT_H2T_MSG_TYPE_SYNC
  3668. *
  3669. * @details
  3670. * The HTT SYNC tells the target to suspend processing of subsequent
  3671. * HTT host-to-target messages until some other target agent locally
  3672. * informs the target HTT FW that the current sync counter is equal to
  3673. * or greater than (in a modulo sense) the sync counter specified in
  3674. * the SYNC message.
  3675. * This allows other host-target components to synchronize their operation
  3676. * with HTT, e.g. to ensure that tx frames don't get transmitted until a
  3677. * security key has been downloaded to and activated by the target.
  3678. * In the absence of any explicit synchronization counter value
  3679. * specification, the target HTT FW will use zero as the default current
  3680. * sync value.
  3681. *
  3682. * |31 24|23 16|15 8|7 0|
  3683. * |-----------------------------------------------------------|
  3684. * | reserved | sync count | msg type |
  3685. * |-----------------------------------------------------------|
  3686. * Header fields:
  3687. * - MSG_TYPE
  3688. * Bits 7:0
  3689. * Purpose: identifies this as a sync message
  3690. * Value: 0x4 (HTT_H2T_MSG_TYPE_SYNC)
  3691. * - SYNC_COUNT
  3692. * Bits 15:8
  3693. * Purpose: specifies what sync value the HTT FW will wait for from
  3694. * an out-of-band specification to resume its operation
  3695. * Value: in-band sync counter value to compare against the out-of-band
  3696. * counter spec.
  3697. * The HTT target FW will suspend its host->target message processing
  3698. * as long as
  3699. * 0 < (in-band sync counter - out-of-band sync counter) & 0xff < 128
  3700. */
  3701. #define HTT_H2T_SYNC_MSG_SZ 4
  3702. #define HTT_H2T_SYNC_COUNT_M 0x0000ff00
  3703. #define HTT_H2T_SYNC_COUNT_S 8
  3704. #define HTT_H2T_SYNC_COUNT_GET(_var) \
  3705. (((_var) & HTT_H2T_SYNC_COUNT_M) >> \
  3706. HTT_H2T_SYNC_COUNT_S)
  3707. #define HTT_H2T_SYNC_COUNT_SET(_var, _val) \
  3708. do { \
  3709. HTT_CHECK_SET_VAL(HTT_H2T_SYNC_COUNT, _val); \
  3710. ((_var) |= ((_val) << HTT_H2T_SYNC_COUNT_S)); \
  3711. } while (0)
  3712. /**
  3713. * @brief host -> target HTT aggregation configuration
  3714. *
  3715. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG
  3716. */
  3717. #define HTT_AGGR_CFG_MSG_SZ 4
  3718. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M 0xff00
  3719. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S 8
  3720. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M 0x1f0000
  3721. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S 16
  3722. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_GET(_var) \
  3723. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_M) >> \
  3724. HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)
  3725. #define HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_SET(_var, _val) \
  3726. do { \
  3727. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM, _val); \
  3728. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMPDU_SUBFRM_S)); \
  3729. } while (0)
  3730. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3731. (((_var) & HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3732. HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)
  3733. #define HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3734. do { \
  3735. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM, _val); \
  3736. ((_var) |= ((_val) << HTT_AGGR_CFG_MAX_NUM_AMSDU_SUBFRM_S)); \
  3737. } while (0)
  3738. /**
  3739. * @brief host -> target HTT configure max amsdu info per vdev
  3740. *
  3741. * MSG_TYPE => HTT_H2T_MSG_TYPE_AGGR_CFG_EX
  3742. *
  3743. * @details
  3744. * The HTT AGGR CFG EX tells the target to configure max_amsdu info per vdev
  3745. *
  3746. * |31 21|20 16|15 8|7 0|
  3747. * |-----------------------------------------------------------|
  3748. * | reserved | vdev id | max amsdu | msg type |
  3749. * |-----------------------------------------------------------|
  3750. * Header fields:
  3751. * - MSG_TYPE
  3752. * Bits 7:0
  3753. * Purpose: identifies this as a aggr cfg ex message
  3754. * Value: 0xa (HTT_H2T_MSG_TYPE_AGGR_CFG_EX)
  3755. * - MAX_NUM_AMSDU_SUBFRM
  3756. * Bits 15:8
  3757. * Purpose: max MSDUs per A-MSDU
  3758. * - VDEV_ID
  3759. * Bits 20:16
  3760. * Purpose: ID of the vdev to which this limit is applied
  3761. */
  3762. #define HTT_AGGR_CFG_EX_MSG_SZ 4
  3763. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M 0xff00
  3764. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S 8
  3765. #define HTT_AGGR_CFG_EX_VDEV_ID_M 0x1f0000
  3766. #define HTT_AGGR_CFG_EX_VDEV_ID_S 16
  3767. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_GET(_var) \
  3768. (((_var) & HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_M) >> \
  3769. HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)
  3770. #define HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_SET(_var, _val) \
  3771. do { \
  3772. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM, _val); \
  3773. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_MAX_NUM_AMSDU_SUBFRM_S)); \
  3774. } while (0)
  3775. #define HTT_AGGR_CFG_EX_VDEV_ID_GET(_var) \
  3776. (((_var) & HTT_AGGR_CFG_EX_VDEV_ID_M) >> \
  3777. HTT_AGGR_CFG_EX_VDEV_ID_S)
  3778. #define HTT_AGGR_CFG_EX_VDEV_ID_SET(_var, _val) \
  3779. do { \
  3780. HTT_CHECK_SET_VAL(HTT_AGGR_CFG_EX_VDEV_ID, _val); \
  3781. ((_var) |= ((_val) << HTT_AGGR_CFG_EX_VDEV_ID_S)); \
  3782. } while (0)
  3783. /**
  3784. * @brief HTT WDI_IPA Config Message
  3785. *
  3786. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_CFG
  3787. *
  3788. * @details
  3789. * The HTT WDI_IPA config message is created/sent by host at driver
  3790. * init time. It contains information about data structures used on
  3791. * WDI_IPA TX and RX path.
  3792. * TX CE ring is used for pushing packet metadata from IPA uC
  3793. * to WLAN FW
  3794. * TX Completion ring is used for generating TX completions from
  3795. * WLAN FW to IPA uC
  3796. * RX Indication ring is used for indicating RX packets from FW
  3797. * to IPA uC
  3798. * RX Ring2 is used as either completion ring or as second
  3799. * indication ring. when Ring2 is used as completion ring, IPA uC
  3800. * puts completed RX packet meta data to Ring2. when Ring2 is used
  3801. * as second indication ring, RX packets for LTE-WLAN aggregation are
  3802. * indicated in Ring2, other RX packets (e.g. hotspot related) are
  3803. * indicated in RX Indication ring. Please see WDI_IPA specification
  3804. * for more details.
  3805. * |31 24|23 16|15 8|7 0|
  3806. * |----------------+----------------+----------------+----------------|
  3807. * | tx pkt pool size | Rsvd | msg_type |
  3808. * |-------------------------------------------------------------------|
  3809. * | tx comp ring base (bits 31:0) |
  3810. #if HTT_PADDR64
  3811. * | tx comp ring base (bits 63:32) |
  3812. #endif
  3813. * |-------------------------------------------------------------------|
  3814. * | tx comp ring size |
  3815. * |-------------------------------------------------------------------|
  3816. * | tx comp WR_IDX physical address (bits 31:0) |
  3817. #if HTT_PADDR64
  3818. * | tx comp WR_IDX physical address (bits 63:32) |
  3819. #endif
  3820. * |-------------------------------------------------------------------|
  3821. * | tx CE WR_IDX physical address (bits 31:0) |
  3822. #if HTT_PADDR64
  3823. * | tx CE WR_IDX physical address (bits 63:32) |
  3824. #endif
  3825. * |-------------------------------------------------------------------|
  3826. * | rx indication ring base (bits 31:0) |
  3827. #if HTT_PADDR64
  3828. * | rx indication ring base (bits 63:32) |
  3829. #endif
  3830. * |-------------------------------------------------------------------|
  3831. * | rx indication ring size |
  3832. * |-------------------------------------------------------------------|
  3833. * | rx ind RD_IDX physical address (bits 31:0) |
  3834. #if HTT_PADDR64
  3835. * | rx ind RD_IDX physical address (bits 63:32) |
  3836. #endif
  3837. * |-------------------------------------------------------------------|
  3838. * | rx ind WR_IDX physical address (bits 31:0) |
  3839. #if HTT_PADDR64
  3840. * | rx ind WR_IDX physical address (bits 63:32) |
  3841. #endif
  3842. * |-------------------------------------------------------------------|
  3843. * |-------------------------------------------------------------------|
  3844. * | rx ring2 base (bits 31:0) |
  3845. #if HTT_PADDR64
  3846. * | rx ring2 base (bits 63:32) |
  3847. #endif
  3848. * |-------------------------------------------------------------------|
  3849. * | rx ring2 size |
  3850. * |-------------------------------------------------------------------|
  3851. * | rx ring2 RD_IDX physical address (bits 31:0) |
  3852. #if HTT_PADDR64
  3853. * | rx ring2 RD_IDX physical address (bits 63:32) |
  3854. #endif
  3855. * |-------------------------------------------------------------------|
  3856. * | rx ring2 WR_IDX physical address (bits 31:0) |
  3857. #if HTT_PADDR64
  3858. * | rx ring2 WR_IDX physical address (bits 63:32) |
  3859. #endif
  3860. * |-------------------------------------------------------------------|
  3861. *
  3862. * Header fields:
  3863. * Header fields:
  3864. * - MSG_TYPE
  3865. * Bits 7:0
  3866. * Purpose: Identifies this as WDI_IPA config message
  3867. * value: = 0x8 (HTT_H2T_MSG_TYPE_WDI_IPA_CFG)
  3868. * - TX_PKT_POOL_SIZE
  3869. * Bits 15:0
  3870. * Purpose: Total number of TX packet buffer pool allocated by Host for
  3871. * WDI_IPA TX path
  3872. * For systems using 32-bit format for bus addresses:
  3873. * - TX_COMP_RING_BASE_ADDR
  3874. * Bits 31:0
  3875. * Purpose: TX Completion Ring base address in DDR
  3876. * - TX_COMP_RING_SIZE
  3877. * Bits 31:0
  3878. * Purpose: TX Completion Ring size (must be power of 2)
  3879. * - TX_COMP_WR_IDX_ADDR
  3880. * Bits 31:0
  3881. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3882. * updates the Write Index for WDI_IPA TX completion ring
  3883. * - TX_CE_WR_IDX_ADDR
  3884. * Bits 31:0
  3885. * Purpose: DDR address where IPA uC
  3886. * updates the WR Index for TX CE ring
  3887. * (needed for fusion platforms)
  3888. * - RX_IND_RING_BASE_ADDR
  3889. * Bits 31:0
  3890. * Purpose: RX Indication Ring base address in DDR
  3891. * - RX_IND_RING_SIZE
  3892. * Bits 31:0
  3893. * Purpose: RX Indication Ring size
  3894. * - RX_IND_RD_IDX_ADDR
  3895. * Bits 31:0
  3896. * Purpose: DDR address where IPA uC updates the Read Index for WDI_IPA
  3897. * RX indication ring
  3898. * - RX_IND_WR_IDX_ADDR
  3899. * Bits 31:0
  3900. * Purpose: IPA doorbell register address OR DDR address where WIFI FW
  3901. * updates the Write Index for WDI_IPA RX indication ring
  3902. * - RX_RING2_BASE_ADDR
  3903. * Bits 31:0
  3904. * Purpose: Second RX Ring(Indication or completion)base address in DDR
  3905. * - RX_RING2_SIZE
  3906. * Bits 31:0
  3907. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3908. * - RX_RING2_RD_IDX_ADDR
  3909. * Bits 31:0
  3910. * Purpose: If Second RX ring is Indication ring, DDR address where
  3911. * IPA uC updates the Read Index for Ring2.
  3912. * If Second RX ring is completion ring, this is NOT used
  3913. * - RX_RING2_WR_IDX_ADDR
  3914. * Bits 31:0
  3915. * Purpose: If Second RX ring is Indication ring, DDR address where
  3916. * WIFI FW updates the Write Index for WDI_IPA RX ring2
  3917. * If second RX ring is completion ring, DDR address where
  3918. * IPA uC updates the Write Index for Ring 2.
  3919. * For systems using 64-bit format for bus addresses:
  3920. * - TX_COMP_RING_BASE_ADDR_LO
  3921. * Bits 31:0
  3922. * Purpose: Lower 4 bytes of TX Completion Ring base physical address in DDR
  3923. * - TX_COMP_RING_BASE_ADDR_HI
  3924. * Bits 31:0
  3925. * Purpose: Higher 4 bytes of TX Completion Ring base physical address in DDR
  3926. * - TX_COMP_RING_SIZE
  3927. * Bits 31:0
  3928. * Purpose: TX Completion Ring size (must be power of 2)
  3929. * - TX_COMP_WR_IDX_ADDR_LO
  3930. * Bits 31:0
  3931. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3932. * Lower 4 bytes of DDR address where WIFI FW
  3933. * updates the Write Index for WDI_IPA TX completion ring
  3934. * - TX_COMP_WR_IDX_ADDR_HI
  3935. * Bits 31:0
  3936. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3937. * Higher 4 bytes of DDR address where WIFI FW
  3938. * updates the Write Index for WDI_IPA TX completion ring
  3939. * - TX_CE_WR_IDX_ADDR_LO
  3940. * Bits 31:0
  3941. * Purpose: Lower 4 bytes of DDR address where IPA uC
  3942. * updates the WR Index for TX CE ring
  3943. * (needed for fusion platforms)
  3944. * - TX_CE_WR_IDX_ADDR_HI
  3945. * Bits 31:0
  3946. * Purpose: Higher 4 bytes of DDR address where IPA uC
  3947. * updates the WR Index for TX CE ring
  3948. * (needed for fusion platforms)
  3949. * - RX_IND_RING_BASE_ADDR_LO
  3950. * Bits 31:0
  3951. * Purpose: Lower 4 bytes of RX Indication Ring base address in DDR
  3952. * - RX_IND_RING_BASE_ADDR_HI
  3953. * Bits 31:0
  3954. * Purpose: Higher 4 bytes of RX Indication Ring base address in DDR
  3955. * - RX_IND_RING_SIZE
  3956. * Bits 31:0
  3957. * Purpose: RX Indication Ring size
  3958. * - RX_IND_RD_IDX_ADDR_LO
  3959. * Bits 31:0
  3960. * Purpose: Lower 4 bytes of DDR address where IPA uC updates the Read Index
  3961. * for WDI_IPA RX indication ring
  3962. * - RX_IND_RD_IDX_ADDR_HI
  3963. * Bits 31:0
  3964. * Purpose: Higher 4 bytes of DDR address where IPA uC updates the Read Index
  3965. * for WDI_IPA RX indication ring
  3966. * - RX_IND_WR_IDX_ADDR_LO
  3967. * Bits 31:0
  3968. * Purpose: Lower 4 bytes of IPA doorbell register address OR
  3969. * Lower 4 bytes of DDR address where WIFI FW
  3970. * updates the Write Index for WDI_IPA RX indication ring
  3971. * - RX_IND_WR_IDX_ADDR_HI
  3972. * Bits 31:0
  3973. * Purpose: Higher 4 bytes of IPA doorbell register address OR
  3974. * Higher 4 bytes of DDR address where WIFI FW
  3975. * updates the Write Index for WDI_IPA RX indication ring
  3976. * - RX_RING2_BASE_ADDR_LO
  3977. * Bits 31:0
  3978. * Purpose: Lower 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3979. * - RX_RING2_BASE_ADDR_HI
  3980. * Bits 31:0
  3981. * Purpose: Higher 4 bytes of Second RX Ring(Indication OR completion)base address in DDR
  3982. * - RX_RING2_SIZE
  3983. * Bits 31:0
  3984. * Purpose: Second RX Ring size (must be >= RX_IND_RING_SIZE)
  3985. * - RX_RING2_RD_IDX_ADDR_LO
  3986. * Bits 31:0
  3987. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3988. * DDR address where IPA uC updates the Read Index for Ring2.
  3989. * If Second RX ring is completion ring, this is NOT used
  3990. * - RX_RING2_RD_IDX_ADDR_HI
  3991. * Bits 31:0
  3992. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  3993. * DDR address where IPA uC updates the Read Index for Ring2.
  3994. * If Second RX ring is completion ring, this is NOT used
  3995. * - RX_RING2_WR_IDX_ADDR_LO
  3996. * Bits 31:0
  3997. * Purpose: If Second RX ring is Indication ring, lower 4 bytes of
  3998. * DDR address where WIFI FW updates the Write Index
  3999. * for WDI_IPA RX ring2
  4000. * If second RX ring is completion ring, lower 4 bytes of
  4001. * DDR address where IPA uC updates the Write Index for Ring 2.
  4002. * - RX_RING2_WR_IDX_ADDR_HI
  4003. * Bits 31:0
  4004. * Purpose: If Second RX ring is Indication ring, higher 4 bytes of
  4005. * DDR address where WIFI FW updates the Write Index
  4006. * for WDI_IPA RX ring2
  4007. * If second RX ring is completion ring, higher 4 bytes of
  4008. * DDR address where IPA uC updates the Write Index for Ring 2.
  4009. */
  4010. #if HTT_PADDR64
  4011. #define HTT_WDI_IPA_CFG_SZ 88 /* bytes */
  4012. #else
  4013. #define HTT_WDI_IPA_CFG_SZ 52 /* bytes */
  4014. #endif
  4015. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M 0xffff0000
  4016. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S 16
  4017. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M 0xffffffff
  4018. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S 0
  4019. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M 0xffffffff
  4020. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S 0
  4021. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M 0xffffffff
  4022. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S 0
  4023. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M 0xffffffff
  4024. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S 0
  4025. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M 0xffffffff
  4026. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S 0
  4027. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M 0xffffffff
  4028. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S 0
  4029. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M 0xffffffff
  4030. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S 0
  4031. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M 0xffffffff
  4032. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S 0
  4033. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M 0xffffffff
  4034. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S 0
  4035. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M 0xffffffff
  4036. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S 0
  4037. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M 0xffffffff
  4038. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S 0
  4039. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M 0xffffffff
  4040. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S 0
  4041. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M 0xffffffff
  4042. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S 0
  4043. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M 0xffffffff
  4044. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S 0
  4045. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M 0xffffffff
  4046. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S 0
  4047. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M 0xffffffff
  4048. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S 0
  4049. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M 0xffffffff
  4050. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S 0
  4051. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M 0xffffffff
  4052. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S 0
  4053. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M 0xffffffff
  4054. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S 0
  4055. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M 0xffffffff
  4056. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S 0
  4057. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M 0xffffffff
  4058. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S 0
  4059. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M 0xffffffff
  4060. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S 0
  4061. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M 0xffffffff
  4062. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S 0
  4063. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_M 0xffffffff
  4064. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_S 0
  4065. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M 0xffffffff
  4066. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S 0
  4067. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M 0xffffffff
  4068. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S 0
  4069. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M 0xffffffff
  4070. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S 0
  4071. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M 0xffffffff
  4072. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S 0
  4073. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M 0xffffffff
  4074. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S 0
  4075. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M 0xffffffff
  4076. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S 0
  4077. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_GET(_var) \
  4078. (((_var) & HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_M) >> HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)
  4079. #define HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_SET(_var, _val) \
  4080. do { \
  4081. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE, _val); \
  4082. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_PKT_POOL_SIZE_S)); \
  4083. } while (0)
  4084. /* for systems using 32-bit format for bus addr */
  4085. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_GET(_var) \
  4086. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)
  4087. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_SET(_var, _val) \
  4088. do { \
  4089. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR, _val); \
  4090. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_S)); \
  4091. } while (0)
  4092. /* for systems using 64-bit format for bus addr */
  4093. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_GET(_var) \
  4094. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)
  4095. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4096. do { \
  4097. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI, _val); \
  4098. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_HI_S)); \
  4099. } while (0)
  4100. /* for systems using 64-bit format for bus addr */
  4101. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_GET(_var) \
  4102. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)
  4103. #define HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4104. do { \
  4105. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO, _val); \
  4106. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_BASE_ADDR_LO_S)); \
  4107. } while (0)
  4108. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_GET(_var) \
  4109. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_M) >> HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)
  4110. #define HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_SET(_var, _val) \
  4111. do { \
  4112. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE, _val); \
  4113. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_RING_SIZE_S)); \
  4114. } while (0)
  4115. /* for systems using 32-bit format for bus addr */
  4116. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_GET(_var) \
  4117. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)
  4118. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_SET(_var, _val) \
  4119. do { \
  4120. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR, _val); \
  4121. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_S)); \
  4122. } while (0)
  4123. /* for systems using 64-bit format for bus addr */
  4124. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_GET(_var) \
  4125. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)
  4126. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_SET(_var, _val) \
  4127. do { \
  4128. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI, _val); \
  4129. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_HI_S)); \
  4130. } while (0)
  4131. /* for systems using 64-bit format for bus addr */
  4132. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_GET(_var) \
  4133. (((_var) & HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)
  4134. #define HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_SET(_var, _val) \
  4135. do { \
  4136. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO, _val); \
  4137. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_COMP_WR_IDX_ADDR_LO_S)); \
  4138. } while (0)
  4139. /* for systems using 32-bit format for bus addr */
  4140. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_GET(_var) \
  4141. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)
  4142. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_SET(_var, _val) \
  4143. do { \
  4144. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR, _val); \
  4145. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_S)); \
  4146. } while (0)
  4147. /* for systems using 64-bit format for bus addr */
  4148. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_GET(_var) \
  4149. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)
  4150. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_SET(_var, _val) \
  4151. do { \
  4152. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI, _val); \
  4153. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_HI_S)); \
  4154. } while (0)
  4155. /* for systems using 64-bit format for bus addr */
  4156. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_GET(_var) \
  4157. (((_var) & HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)
  4158. #define HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_SET(_var, _val) \
  4159. do { \
  4160. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO, _val); \
  4161. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_TX_CE_WR_IDX_ADDR_LO_S)); \
  4162. } while (0)
  4163. /* for systems using 32-bit format for bus addr */
  4164. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_GET(_var) \
  4165. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)
  4166. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_SET(_var, _val) \
  4167. do { \
  4168. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR, _val); \
  4169. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_S)); \
  4170. } while (0)
  4171. /* for systems using 64-bit format for bus addr */
  4172. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_GET(_var) \
  4173. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)
  4174. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_SET(_var, _val) \
  4175. do { \
  4176. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI, _val); \
  4177. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_HI_S)); \
  4178. } while (0)
  4179. /* for systems using 64-bit format for bus addr */
  4180. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_GET(_var) \
  4181. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)
  4182. #define HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_SET(_var, _val) \
  4183. do { \
  4184. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO, _val); \
  4185. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_BASE_ADDR_LO_S)); \
  4186. } while (0)
  4187. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_GET(_var) \
  4188. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_M) >> HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)
  4189. #define HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_SET(_var, _val) \
  4190. do { \
  4191. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RING_SIZE, _val); \
  4192. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RING_SIZE_S)); \
  4193. } while (0)
  4194. /* for systems using 32-bit format for bus addr */
  4195. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_GET(_var) \
  4196. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)
  4197. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_SET(_var, _val) \
  4198. do { \
  4199. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR, _val); \
  4200. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_S)); \
  4201. } while (0)
  4202. /* for systems using 64-bit format for bus addr */
  4203. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_GET(_var) \
  4204. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)
  4205. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_SET(_var, _val) \
  4206. do { \
  4207. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI, _val); \
  4208. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_HI_S)); \
  4209. } while (0)
  4210. /* for systems using 64-bit format for bus addr */
  4211. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_GET(_var) \
  4212. (((_var) & HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)
  4213. #define HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_SET(_var, _val) \
  4214. do { \
  4215. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO, _val); \
  4216. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_RD_IDX_ADDR_LO_S)); \
  4217. } while (0)
  4218. /* for systems using 32-bit format for bus addr */
  4219. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_GET(_var) \
  4220. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)
  4221. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_SET(_var, _val) \
  4222. do { \
  4223. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR, _val); \
  4224. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_S)); \
  4225. } while (0)
  4226. /* for systems using 64-bit format for bus addr */
  4227. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_GET(_var) \
  4228. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)
  4229. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_SET(_var, _val) \
  4230. do { \
  4231. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI, _val); \
  4232. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_HI_S)); \
  4233. } while (0)
  4234. /* for systems using 64-bit format for bus addr */
  4235. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_GET(_var) \
  4236. (((_var) & HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)
  4237. #define HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_SET(_var, _val) \
  4238. do { \
  4239. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO, _val); \
  4240. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_IND_WR_IDX_ADDR_LO_S)); \
  4241. } while (0)
  4242. /* for systems using 32-bit format for bus addr */
  4243. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_GET(_var) \
  4244. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)
  4245. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_SET(_var, _val) \
  4246. do { \
  4247. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR, _val); \
  4248. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_S)); \
  4249. } while (0)
  4250. /* for systems using 64-bit format for bus addr */
  4251. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_GET(_var) \
  4252. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)
  4253. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_SET(_var, _val) \
  4254. do { \
  4255. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI, _val); \
  4256. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_HI_S)); \
  4257. } while (0)
  4258. /* for systems using 64-bit format for bus addr */
  4259. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_GET(_var) \
  4260. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)
  4261. #define HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_SET(_var, _val) \
  4262. do { \
  4263. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO, _val); \
  4264. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_BASE_ADDR_LO_S)); \
  4265. } while (0)
  4266. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_GET(_var) \
  4267. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_SIZE_M) >> HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)
  4268. #define HTT_WDI_IPA_CFG_RX_RING2_SIZE_SET(_var, _val) \
  4269. do { \
  4270. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_SIZE, _val); \
  4271. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_SIZE_S)); \
  4272. } while (0)
  4273. /* for systems using 32-bit format for bus addr */
  4274. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_GET(_var) \
  4275. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)
  4276. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_SET(_var, _val) \
  4277. do { \
  4278. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR, _val); \
  4279. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_S)); \
  4280. } while (0)
  4281. /* for systems using 64-bit format for bus addr */
  4282. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_GET(_var) \
  4283. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)
  4284. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_SET(_var, _val) \
  4285. do { \
  4286. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI, _val); \
  4287. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_HI_S)); \
  4288. } while (0)
  4289. /* for systems using 64-bit format for bus addr */
  4290. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_GET(_var) \
  4291. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)
  4292. #define HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_SET(_var, _val) \
  4293. do { \
  4294. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO, _val); \
  4295. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_RD_IDX_ADDR_LO_S)); \
  4296. } while (0)
  4297. /* for systems using 32-bit format for bus addr */
  4298. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_GET(_var) \
  4299. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)
  4300. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_SET(_var, _val) \
  4301. do { \
  4302. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR, _val); \
  4303. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_S)); \
  4304. } while (0)
  4305. /* for systems using 64-bit format for bus addr */
  4306. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_GET(_var) \
  4307. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)
  4308. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_SET(_var, _val) \
  4309. do { \
  4310. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI, _val); \
  4311. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_HI_S)); \
  4312. } while (0)
  4313. /* for systems using 64-bit format for bus addr */
  4314. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_GET(_var) \
  4315. (((_var) & HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_M) >> HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)
  4316. #define HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_SET(_var, _val) \
  4317. do { \
  4318. HTT_CHECK_SET_VAL(HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO, _val); \
  4319. ((_var) |= ((_val) << HTT_WDI_IPA_CFG_RX_RING2_WR_IDX_ADDR_LO_S)); \
  4320. } while (0)
  4321. /*
  4322. * TEMPLATE_HTT_WDI_IPA_CONFIG_T:
  4323. * This macro defines a htt_wdi_ipa_configXXX_t in which any physical
  4324. * addresses are stored in a XXX-bit field.
  4325. * This macro is used to define both htt_wdi_ipa_config32_t and
  4326. * htt_wdi_ipa_config64_t structs.
  4327. */
  4328. #define TEMPLATE_HTT_WDI_IPA_CONFIG_T(_paddr_bits_, \
  4329. _paddr__tx_comp_ring_base_addr_, \
  4330. _paddr__tx_comp_wr_idx_addr_, \
  4331. _paddr__tx_ce_wr_idx_addr_, \
  4332. _paddr__rx_ind_ring_base_addr_, \
  4333. _paddr__rx_ind_rd_idx_addr_, \
  4334. _paddr__rx_ind_wr_idx_addr_, \
  4335. _paddr__rx_ring2_base_addr_,\
  4336. _paddr__rx_ring2_rd_idx_addr_,\
  4337. _paddr__rx_ring2_wr_idx_addr_) \
  4338. PREPACK struct htt_wdi_ipa_cfg ## _paddr_bits_ ## _t \
  4339. { \
  4340. /* DWORD 0: flags and meta-data */ \
  4341. A_UINT32 \
  4342. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_CFG */ \
  4343. reserved: 8, \
  4344. tx_pkt_pool_size: 16;\
  4345. /* DWORD 1 */\
  4346. _paddr__tx_comp_ring_base_addr_;\
  4347. /* DWORD 2 (or 3)*/\
  4348. A_UINT32 tx_comp_ring_size;\
  4349. /* DWORD 3 (or 4)*/\
  4350. _paddr__tx_comp_wr_idx_addr_;\
  4351. /* DWORD 4 (or 6)*/\
  4352. _paddr__tx_ce_wr_idx_addr_;\
  4353. /* DWORD 5 (or 8)*/\
  4354. _paddr__rx_ind_ring_base_addr_;\
  4355. /* DWORD 6 (or 10)*/\
  4356. A_UINT32 rx_ind_ring_size;\
  4357. /* DWORD 7 (or 11)*/\
  4358. _paddr__rx_ind_rd_idx_addr_;\
  4359. /* DWORD 8 (or 13)*/\
  4360. _paddr__rx_ind_wr_idx_addr_;\
  4361. /* DWORD 9 (or 15)*/\
  4362. _paddr__rx_ring2_base_addr_;\
  4363. /* DWORD 10 (or 17) */\
  4364. A_UINT32 rx_ring2_size;\
  4365. /* DWORD 11 (or 18) */\
  4366. _paddr__rx_ring2_rd_idx_addr_;\
  4367. /* DWORD 12 (or 20) */\
  4368. _paddr__rx_ring2_wr_idx_addr_;\
  4369. } POSTPACK
  4370. /* define a htt_wdi_ipa_config32_t type */
  4371. 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));
  4372. /* define a htt_wdi_ipa_config64_t type */
  4373. 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));
  4374. #if HTT_PADDR64
  4375. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg64_t
  4376. #else
  4377. #define htt_wdi_ipa_cfg_t htt_wdi_ipa_cfg32_t
  4378. #endif
  4379. enum htt_wdi_ipa_op_code {
  4380. HTT_WDI_IPA_OPCODE_TX_SUSPEND = 0,
  4381. HTT_WDI_IPA_OPCODE_TX_RESUME = 1,
  4382. HTT_WDI_IPA_OPCODE_RX_SUSPEND = 2,
  4383. HTT_WDI_IPA_OPCODE_RX_RESUME = 3,
  4384. HTT_WDI_IPA_OPCODE_DBG_STATS = 4,
  4385. HTT_WDI_IPA_OPCODE_GET_SHARING_STATS = 5,
  4386. HTT_WDI_IPA_OPCODE_SET_QUOTA = 6,
  4387. HTT_WDI_IPA_OPCODE_IND_QUOTA = 7,
  4388. /* keep this last */
  4389. HTT_WDI_IPA_OPCODE_MAX
  4390. };
  4391. /**
  4392. * @brief HTT WDI_IPA Operation Request Message
  4393. *
  4394. * MSG_TYPE => HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ
  4395. *
  4396. * @details
  4397. * HTT WDI_IPA Operation Request message is sent by host
  4398. * to either suspend or resume WDI_IPA TX or RX path.
  4399. * |31 24|23 16|15 8|7 0|
  4400. * |----------------+----------------+----------------+----------------|
  4401. * | op_code | Rsvd | msg_type |
  4402. * |-------------------------------------------------------------------|
  4403. *
  4404. * Header fields:
  4405. * - MSG_TYPE
  4406. * Bits 7:0
  4407. * Purpose: Identifies this as WDI_IPA Operation Request message
  4408. * value: = 0x9 (HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQ)
  4409. * - OP_CODE
  4410. * Bits 31:16
  4411. * Purpose: Identifies operation host is requesting (e.g. TX suspend)
  4412. * value: = enum htt_wdi_ipa_op_code
  4413. */
  4414. PREPACK struct htt_wdi_ipa_op_request_t
  4415. {
  4416. /* DWORD 0: flags and meta-data */
  4417. A_UINT32
  4418. msg_type: 8, /* HTT_H2T_MSG_TYPE_WDI_IPA_OP_REQUEST */
  4419. reserved: 8,
  4420. op_code: 16;
  4421. } POSTPACK;
  4422. #define HTT_WDI_IPA_OP_REQUEST_SZ 4 /* bytes */
  4423. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_M 0xffff0000
  4424. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_S 16
  4425. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_GET(_var) \
  4426. (((_var) & HTT_WDI_IPA_OP_REQUEST_OP_CODE_M) >> HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)
  4427. #define HTT_WDI_IPA_OP_REQUEST_OP_CODE_SET(_var, _val) \
  4428. do { \
  4429. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_REQUEST_OP_CODE, _val); \
  4430. ((_var) |= ((_val) << HTT_WDI_IPA_OP_REQUEST_OP_CODE_S)); \
  4431. } while (0)
  4432. /*
  4433. * @brief host -> target HTT_MSI_SETUP message
  4434. *
  4435. * MSG_TYPE => HTT_H2T_MSG_TYPE_MSI_SETUP
  4436. *
  4437. * @details
  4438. * After target is booted up, host can send MSI setup message so that
  4439. * target sets up HW registers based on setup message.
  4440. *
  4441. * The message would appear as follows:
  4442. * |31 24|23 16|15|14 8|7 0|
  4443. * |---------------+-----------------+-----------------+-----------------|
  4444. * | reserved | msi_type | pdev_id | msg_type |
  4445. * |---------------------------------------------------------------------|
  4446. * | msi_addr_lo |
  4447. * |---------------------------------------------------------------------|
  4448. * | msi_addr_hi |
  4449. * |---------------------------------------------------------------------|
  4450. * | msi_data |
  4451. * |---------------------------------------------------------------------|
  4452. *
  4453. * The message is interpreted as follows:
  4454. * dword0 - b'0:7 - msg_type: This will be set to
  4455. * 0x1f (HTT_H2T_MSG_TYPE_MSI_SETUP)
  4456. * b'8:15 - pdev_id:
  4457. * 0 (for rings at SOC/UMAC level),
  4458. * 1/2/3 mac id (for rings at LMAC level)
  4459. * b'16:23 - msi_type: identify which msi registers need to be setup
  4460. * more details can be got from enum htt_msi_setup_type
  4461. * b'24:31 - reserved
  4462. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4463. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4464. * dword10 - b'0:31 - ring_msi_data: MSI data configured by host
  4465. */
  4466. PREPACK struct htt_msi_setup_t {
  4467. A_UINT32 msg_type: 8,
  4468. pdev_id: 8,
  4469. msi_type: 8,
  4470. reserved: 8;
  4471. A_UINT32 msi_addr_lo;
  4472. A_UINT32 msi_addr_hi;
  4473. A_UINT32 msi_data;
  4474. } POSTPACK;
  4475. enum htt_msi_setup_type {
  4476. HTT_PPDU_END_MSI_SETUP_TYPE,
  4477. /* Insert new types here*/
  4478. };
  4479. #define HTT_MSI_SETUP_SZ (sizeof(struct htt_msi_setup_t))
  4480. #define HTT_MSI_SETUP_PDEV_ID_M 0x0000ff00
  4481. #define HTT_MSI_SETUP_PDEV_ID_S 8
  4482. #define HTT_MSI_SETUP_PDEV_ID_GET(_var) \
  4483. (((_var) & HTT_MSI_SETUP_PDEV_ID_M) >> \
  4484. HTT_MSI_SETUP_PDEV_ID_S)
  4485. #define HTT_MSI_SETUP_PDEV_ID_SET(_var, _val) \
  4486. do { \
  4487. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_PDEV_ID, _val); \
  4488. ((_var) |= ((_val) << HTT_MSI_SETUP_PDEV_ID_S)); \
  4489. } while (0)
  4490. #define HTT_MSI_SETUP_MSI_TYPE_M 0x00ff0000
  4491. #define HTT_MSI_SETUP_MSI_TYPE_S 16
  4492. #define HTT_MSI_SETUP_MSI_TYPE_GET(_var) \
  4493. (((_var) & HTT_MSI_SETUP_MSI_TYPE_M) >> \
  4494. HTT_MSI_SETUP_MSI_TYPE_S)
  4495. #define HTT_MSI_SETUP_MSI_TYPE_SET(_var, _val) \
  4496. do { \
  4497. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_TYPE, _val); \
  4498. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_TYPE_S)); \
  4499. } while (0)
  4500. #define HTT_MSI_SETUP_MSI_ADDR_LO_M 0xffffffff
  4501. #define HTT_MSI_SETUP_MSI_ADDR_LO_S 0
  4502. #define HTT_MSI_SETUP_MSI_ADDR_LO_GET(_var) \
  4503. (((_var) & HTT_MSI_SETUP_MSI_ADDR_LO_M) >> \
  4504. HTT_MSI_SETUP_MSI_ADDR_LO_S)
  4505. #define HTT_MSI_SETUP_MSI_ADDR_LO_SET(_var, _val) \
  4506. do { \
  4507. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_LO, _val); \
  4508. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_LO_S)); \
  4509. } while (0)
  4510. #define HTT_MSI_SETUP_MSI_ADDR_HI_M 0xffffffff
  4511. #define HTT_MSI_SETUP_MSI_ADDR_HI_S 0
  4512. #define HTT_MSI_SETUP_MSI_ADDR_HI_GET(_var) \
  4513. (((_var) & HTT_MSI_SETUP_MSI_ADDR_HI_M) >> \
  4514. HTT_MSI_SETUP_MSI_ADDR_HI_S)
  4515. #define HTT_MSI_SETUP_MSI_ADDR_HI_SET(_var, _val) \
  4516. do { \
  4517. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_ADDR_HI, _val); \
  4518. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_ADDR_HI_S)); \
  4519. } while (0)
  4520. #define HTT_MSI_SETUP_MSI_DATA_M 0xffffffff
  4521. #define HTT_MSI_SETUP_MSI_DATA_S 0
  4522. #define HTT_MSI_SETUP_MSI_DATA_GET(_var) \
  4523. (((_var) & HTT_MSI_SETUP_MSI_DATA_M) >> \
  4524. HTT_MSI_SETUP_MSI_DATA_S)
  4525. #define HTT_MSI_SETUP_MSI_DATA_SET(_var, _val) \
  4526. do { \
  4527. HTT_CHECK_SET_VAL(HTT_MSI_SETUP_MSI_DATA, _val); \
  4528. ((_var) |= ((_val) << HTT_MSI_SETUP_MSI_DATA_S)); \
  4529. } while (0)
  4530. /*
  4531. * @brief host -> target HTT_SRING_SETUP message
  4532. *
  4533. * MSG_TYPE => HTT_H2T_MSG_TYPE_SRING_SETUP
  4534. *
  4535. * @details
  4536. * After target is booted up, Host can send SRING setup message for
  4537. * each host facing LMAC SRING. Target setups up HW registers based
  4538. * on setup message and confirms back to Host if response_required is set.
  4539. * Host should wait for confirmation message before sending new SRING
  4540. * setup message
  4541. *
  4542. * The message would appear as follows:
  4543. * |31 24|23 21|20|19|18 16|15|14 8|7 0|
  4544. * |--------------- +-----------------+-----------------+-----------------|
  4545. * | ring_type | ring_id | pdev_id | msg_type |
  4546. * |----------------------------------------------------------------------|
  4547. * | ring_base_addr_lo |
  4548. * |----------------------------------------------------------------------|
  4549. * | ring_base_addr_hi |
  4550. * |----------------------------------------------------------------------|
  4551. * |ring_misc_cfg_flag|ring_entry_size| ring_size |
  4552. * |----------------------------------------------------------------------|
  4553. * | ring_head_offset32_remote_addr_lo |
  4554. * |----------------------------------------------------------------------|
  4555. * | ring_head_offset32_remote_addr_hi |
  4556. * |----------------------------------------------------------------------|
  4557. * | ring_tail_offset32_remote_addr_lo |
  4558. * |----------------------------------------------------------------------|
  4559. * | ring_tail_offset32_remote_addr_hi |
  4560. * |----------------------------------------------------------------------|
  4561. * | ring_msi_addr_lo |
  4562. * |----------------------------------------------------------------------|
  4563. * | ring_msi_addr_hi |
  4564. * |----------------------------------------------------------------------|
  4565. * | ring_msi_data |
  4566. * |----------------------------------------------------------------------|
  4567. * | intr_timer_th |IM| intr_batch_counter_th |
  4568. * |----------------------------------------------------------------------|
  4569. * | reserved |ID|RR| PTCF| intr_low_threshold |
  4570. * |----------------------------------------------------------------------|
  4571. * | reserved |IPA drop thres hi|IPA drop thres lo|
  4572. * |----------------------------------------------------------------------|
  4573. * Where
  4574. * IM = sw_intr_mode
  4575. * RR = response_required
  4576. * PTCF = prefetch_timer_cfg
  4577. * IP = IPA drop flag
  4578. *
  4579. * The message is interpreted as follows:
  4580. * dword0 - b'0:7 - msg_type: This will be set to
  4581. * 0xb (HTT_H2T_MSG_TYPE_SRING_SETUP)
  4582. * b'8:15 - pdev_id:
  4583. * 0 (for rings at SOC/UMAC level),
  4584. * 1/2/3 mac id (for rings at LMAC level)
  4585. * b'16:23 - ring_id: identify which ring is to setup,
  4586. * more details can be got from enum htt_srng_ring_id
  4587. * b'24:31 - ring_type: identify type of host rings,
  4588. * more details can be got from enum htt_srng_ring_type
  4589. * dword1 - b'0:31 - ring_base_addr_lo: Lower 32bits of ring base address
  4590. * dword2 - b'0:31 - ring_base_addr_hi: Upper 32bits of ring base address
  4591. * dword3 - b'0:15 - ring_size: size of the ring in unit of 4-bytes words
  4592. * b'16:23 - ring_entry_size: Size of each entry in 4-byte word units
  4593. * b'24:31 - ring_misc_cfg_flag: Valid only for HW_TO_SW_RING and
  4594. * SW_TO_HW_RING.
  4595. * Refer to HTT_SRING_SETUP_RING_MISC_CFG_RING defs.
  4596. * dword4 - b'0:31 - ring_head_offset32_remote_addr_lo:
  4597. * Lower 32 bits of memory address of the remote variable
  4598. * storing the 4-byte word offset that identifies the head
  4599. * element within the ring.
  4600. * (The head offset variable has type A_UINT32.)
  4601. * Valid for HW_TO_SW and SW_TO_SW rings.
  4602. * dword5 - b'0:31 - ring_head_offset32_remote_addr_hi:
  4603. * Upper 32 bits of memory address of the remote variable
  4604. * storing the 4-byte word offset that identifies the head
  4605. * element within the ring.
  4606. * (The head offset variable has type A_UINT32.)
  4607. * Valid for HW_TO_SW and SW_TO_SW rings.
  4608. * dword6 - b'0:31 - ring_tail_offset32_remote_addr_lo:
  4609. * Lower 32 bits of memory address of the remote variable
  4610. * storing the 4-byte word offset that identifies the tail
  4611. * element within the ring.
  4612. * (The tail offset variable has type A_UINT32.)
  4613. * Valid for HW_TO_SW and SW_TO_SW rings.
  4614. * dword7 - b'0:31 - ring_tail_offset32_remote_addr_hi:
  4615. * Upper 32 bits of memory address of the remote variable
  4616. * storing the 4-byte word offset that identifies the tail
  4617. * element within the ring.
  4618. * (The tail offset variable has type A_UINT32.)
  4619. * Valid for HW_TO_SW and SW_TO_SW rings.
  4620. * dword8 - b'0:31 - ring_msi_addr_lo: Lower 32bits of MSI cfg address
  4621. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4622. * dword9 - b'0:31 - ring_msi_addr_hi: Upper 32bits of MSI cfg address
  4623. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4624. * dword10 - b'0:31 - ring_msi_data: MSI data
  4625. * Refer to HTT_SRING_SETUP_RING_MSC_CFG_xxx defs
  4626. * valid only for HW_TO_SW_RING and SW_TO_HW_RING
  4627. * dword11 - b'0:14 - intr_batch_counter_th:
  4628. * batch counter threshold is in units of 4-byte words.
  4629. * HW internally maintains and increments batch count.
  4630. * (see SRING spec for detail description).
  4631. * When batch count reaches threshold value, an interrupt
  4632. * is generated by HW.
  4633. * b'15 - sw_intr_mode:
  4634. * This configuration shall be static.
  4635. * Only programmed at power up.
  4636. * 0: generate pulse style sw interrupts
  4637. * 1: generate level style sw interrupts
  4638. * b'16:31 - intr_timer_th:
  4639. * The timer init value when timer is idle or is
  4640. * initialized to start downcounting.
  4641. * In 8us units (to cover a range of 0 to 524 ms)
  4642. * dword12 - b'0:15 - intr_low_threshold:
  4643. * Used only by Consumer ring to generate ring_sw_int_p.
  4644. * Ring entries low threshold water mark, that is used
  4645. * in combination with the interrupt timer as well as
  4646. * the the clearing of the level interrupt.
  4647. * b'16:18 - prefetch_timer_cfg:
  4648. * Used only by Consumer ring to set timer mode to
  4649. * support Application prefetch handling.
  4650. * The external tail offset/pointer will be updated
  4651. * at following intervals:
  4652. * 3'b000: (Prefetch feature disabled; used only for debug)
  4653. * 3'b001: 1 usec
  4654. * 3'b010: 4 usec
  4655. * 3'b011: 8 usec (default)
  4656. * 3'b100: 16 usec
  4657. * Others: Reserverd
  4658. * b'19 - response_required:
  4659. * Host needs HTT_T2H_MSG_TYPE_SRING_SETUP_DONE as response
  4660. * b'20 - ipa_drop_flag:
  4661. Indicates that host will config ipa drop threshold percentage
  4662. * b'21:31 - reserved: reserved for future use
  4663. * dword13 - b'0:7 - ipa drop low threshold percentage:
  4664. * b'8:15 - ipa drop high threshold percentage:
  4665. * b'16:31 - Reserved
  4666. */
  4667. PREPACK struct htt_sring_setup_t {
  4668. A_UINT32 msg_type: 8,
  4669. pdev_id: 8,
  4670. ring_id: 8,
  4671. ring_type: 8;
  4672. A_UINT32 ring_base_addr_lo;
  4673. A_UINT32 ring_base_addr_hi;
  4674. A_UINT32 ring_size: 16,
  4675. ring_entry_size: 8,
  4676. ring_misc_cfg_flag: 8;
  4677. A_UINT32 ring_head_offset32_remote_addr_lo;
  4678. A_UINT32 ring_head_offset32_remote_addr_hi;
  4679. A_UINT32 ring_tail_offset32_remote_addr_lo;
  4680. A_UINT32 ring_tail_offset32_remote_addr_hi;
  4681. A_UINT32 ring_msi_addr_lo;
  4682. A_UINT32 ring_msi_addr_hi;
  4683. A_UINT32 ring_msi_data;
  4684. A_UINT32 intr_batch_counter_th: 15,
  4685. sw_intr_mode: 1,
  4686. intr_timer_th: 16;
  4687. A_UINT32 intr_low_threshold: 16,
  4688. prefetch_timer_cfg: 3,
  4689. response_required: 1,
  4690. ipa_drop_flag: 1,
  4691. reserved1: 11;
  4692. A_UINT32 ipa_drop_low_threshold: 8,
  4693. ipa_drop_high_threshold: 8,
  4694. reserved: 16;
  4695. } POSTPACK;
  4696. enum htt_srng_ring_type {
  4697. HTT_HW_TO_SW_RING = 0,
  4698. HTT_SW_TO_HW_RING,
  4699. HTT_SW_TO_SW_RING,
  4700. /* Insert new ring types above this line */
  4701. };
  4702. enum htt_srng_ring_id {
  4703. HTT_RXDMA_HOST_BUF_RING = 0, /* Used by FW to feed remote buffers and update remote packets */
  4704. HTT_RXDMA_MONITOR_STATUS_RING, /* For getting all PPDU/MPDU/MSDU status deescriptors on host for monitor VAP or packet log purposes */
  4705. HTT_RXDMA_MONITOR_BUF_RING, /* For feeding free host buffers to RxDMA for monitor traffic upload */
  4706. HTT_RXDMA_MONITOR_DESC_RING, /* For providing free LINK_DESC to RXDMA for monitor traffic upload */
  4707. HTT_RXDMA_MONITOR_DEST_RING, /* Per MPDU indication to host for monitor traffic upload */
  4708. HTT_HOST1_TO_FW_RXBUF_RING, /* (mobile only) used by host to provide remote RX buffers */
  4709. HTT_HOST2_TO_FW_RXBUF_RING, /* (mobile only) second ring used by host to provide remote RX buffers */
  4710. HTT_RXDMA_NON_MONITOR_DEST_RING, /* Per MDPU indication to host for non-monitor RxDMA traffic upload */
  4711. HTT_RXDMA_HOST_BUF_RING2, /* Second ring used by FW to feed removed buffers and update removed packets */
  4712. HTT_TX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4713. HTT_TX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4714. HTT_RX_MON_HOST2MON_BUF_RING, /* Status buffers and Packet buffers are provided by host */
  4715. HTT_RX_MON_MON2HOST_DEST_RING, /* Used by monitor to fill status buffers and provide to host */
  4716. /* Add Other SRING which can't be directly configured by host software above this line */
  4717. };
  4718. #define HTT_SRING_SETUP_SZ (sizeof(struct htt_sring_setup_t))
  4719. #define HTT_SRING_SETUP_PDEV_ID_M 0x0000ff00
  4720. #define HTT_SRING_SETUP_PDEV_ID_S 8
  4721. #define HTT_SRING_SETUP_PDEV_ID_GET(_var) \
  4722. (((_var) & HTT_SRING_SETUP_PDEV_ID_M) >> \
  4723. HTT_SRING_SETUP_PDEV_ID_S)
  4724. #define HTT_SRING_SETUP_PDEV_ID_SET(_var, _val) \
  4725. do { \
  4726. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PDEV_ID, _val); \
  4727. ((_var) |= ((_val) << HTT_SRING_SETUP_PDEV_ID_S)); \
  4728. } while (0)
  4729. #define HTT_SRING_SETUP_RING_ID_M 0x00ff0000
  4730. #define HTT_SRING_SETUP_RING_ID_S 16
  4731. #define HTT_SRING_SETUP_RING_ID_GET(_var) \
  4732. (((_var) & HTT_SRING_SETUP_RING_ID_M) >> \
  4733. HTT_SRING_SETUP_RING_ID_S)
  4734. #define HTT_SRING_SETUP_RING_ID_SET(_var, _val) \
  4735. do { \
  4736. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_ID, _val); \
  4737. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_ID_S)); \
  4738. } while (0)
  4739. #define HTT_SRING_SETUP_RING_TYPE_M 0xff000000
  4740. #define HTT_SRING_SETUP_RING_TYPE_S 24
  4741. #define HTT_SRING_SETUP_RING_TYPE_GET(_var) \
  4742. (((_var) & HTT_SRING_SETUP_RING_TYPE_M) >> \
  4743. HTT_SRING_SETUP_RING_TYPE_S)
  4744. #define HTT_SRING_SETUP_RING_TYPE_SET(_var, _val) \
  4745. do { \
  4746. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_TYPE, _val); \
  4747. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_TYPE_S)); \
  4748. } while (0)
  4749. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_M 0xffffffff
  4750. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_S 0
  4751. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_GET(_var) \
  4752. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_LO_M) >> \
  4753. HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)
  4754. #define HTT_SRING_SETUP_RING_BASE_ADDR_LO_SET(_var, _val) \
  4755. do { \
  4756. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_LO, _val); \
  4757. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_LO_S)); \
  4758. } while (0)
  4759. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_M 0xffffffff
  4760. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_S 0
  4761. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_GET(_var) \
  4762. (((_var) & HTT_SRING_SETUP_RING_BASE_ADDR_HI_M) >> \
  4763. HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)
  4764. #define HTT_SRING_SETUP_RING_BASE_ADDR_HI_SET(_var, _val) \
  4765. do { \
  4766. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_BASE_ADDR_HI, _val); \
  4767. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_BASE_ADDR_HI_S)); \
  4768. } while (0)
  4769. #define HTT_SRING_SETUP_RING_SIZE_M 0x0000ffff
  4770. #define HTT_SRING_SETUP_RING_SIZE_S 0
  4771. #define HTT_SRING_SETUP_RING_SIZE_GET(_var) \
  4772. (((_var) & HTT_SRING_SETUP_RING_SIZE_M) >> \
  4773. HTT_SRING_SETUP_RING_SIZE_S)
  4774. #define HTT_SRING_SETUP_RING_SIZE_SET(_var, _val) \
  4775. do { \
  4776. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_SIZE, _val); \
  4777. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_SIZE_S)); \
  4778. } while (0)
  4779. #define HTT_SRING_SETUP_ENTRY_SIZE_M 0x00ff0000
  4780. #define HTT_SRING_SETUP_ENTRY_SIZE_S 16
  4781. #define HTT_SRING_SETUP_ENTRY_SIZE_GET(_var) \
  4782. (((_var) & HTT_SRING_SETUP_ENTRY_SIZE_M) >> \
  4783. HTT_SRING_SETUP_ENTRY_SIZE_S)
  4784. #define HTT_SRING_SETUP_ENTRY_SIZE_SET(_var, _val) \
  4785. do { \
  4786. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_ENTRY_SIZE, _val); \
  4787. ((_var) |= ((_val) << HTT_SRING_SETUP_ENTRY_SIZE_S)); \
  4788. } while (0)
  4789. #define HTT_SRING_SETUP_MISC_CFG_FLAG_M 0xff000000
  4790. #define HTT_SRING_SETUP_MISC_CFG_FLAG_S 24
  4791. #define HTT_SRING_SETUP_MISC_CFG_FLAG_GET(_var) \
  4792. (((_var) & HTT_SRING_SETUP_MISC_CFG_FLAG_M) >> \
  4793. HTT_SRING_SETUP_MISC_CFG_FLAG_S)
  4794. #define HTT_SRING_SETUP_MISC_CFG_FLAG_SET(_var, _val) \
  4795. do { \
  4796. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_MISC_CFG_FLAG, _val); \
  4797. ((_var) |= ((_val) << HTT_SRING_SETUP_MISC_CFG_FLAG_S)); \
  4798. } while (0)
  4799. /* This control bit is applicable to only Producer, which updates Ring ID field
  4800. * of each descriptor before pushing into the ring.
  4801. * 0: updates ring_id(default)
  4802. * 1: ring_id updating disabled */
  4803. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M 0x01000000
  4804. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S 24
  4805. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_GET(_var) \
  4806. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_M) >> \
  4807. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)
  4808. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_SET(_var, _val) \
  4809. do { \
  4810. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE, _val); \
  4811. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RING_ID_DISABLE_S)); \
  4812. } while (0)
  4813. /* This control bit is applicable to only Producer, which updates Loopcnt field
  4814. * of each descriptor before pushing into the ring.
  4815. * 0: updates Loopcnt(default)
  4816. * 1: Loopcnt updating disabled */
  4817. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M 0x02000000
  4818. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S 25
  4819. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_GET(_var) \
  4820. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_M) >> \
  4821. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)
  4822. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_SET(_var, _val) \
  4823. do { \
  4824. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE, _val); \
  4825. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_LOOPCOUNT_DISABLE_S)); \
  4826. } while (0)
  4827. /* Secured access enable/disable bit. SRNG drives value of this register bit
  4828. * into security_id port of GXI/AXI. */
  4829. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M 0x04000000
  4830. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S 26
  4831. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_GET(_var) \
  4832. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_M) >> \
  4833. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)
  4834. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_SET(_var, _val) \
  4835. do { \
  4836. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY, _val); \
  4837. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_SECURITY_S)); \
  4838. } while (0)
  4839. /* During MSI write operation, SRNG drives value of this register bit into
  4840. * swap bit of GXI/AXI. */
  4841. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M 0x08000000
  4842. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S 27
  4843. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_GET(_var) \
  4844. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_M) >> \
  4845. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)
  4846. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_SET(_var, _val) \
  4847. do { \
  4848. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP, _val); \
  4849. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_MSI_SWAP_S)); \
  4850. } while (0)
  4851. /* During Pointer write operation, SRNG drives value of this register bit into
  4852. * swap bit of GXI/AXI. */
  4853. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M 0x10000000
  4854. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S 28
  4855. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_GET(_var) \
  4856. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_M) >> \
  4857. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)
  4858. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_SET(_var, _val) \
  4859. do { \
  4860. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP, _val); \
  4861. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_HOST_FW_SWAP_S)); \
  4862. } while (0)
  4863. /* During any data or TLV write operation, SRNG drives value of this register
  4864. * bit into swap bit of GXI/AXI. */
  4865. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M 0x20000000
  4866. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S 29
  4867. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_GET(_var) \
  4868. (((_var) & HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_M) >> \
  4869. HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)
  4870. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_SET(_var, _val) \
  4871. do { \
  4872. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP, _val); \
  4873. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MISC_CFG_FLAG_TLV_SWAP_S)); \
  4874. } while (0)
  4875. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED1 0x40000000
  4876. #define HTT_SRING_SETUP_RING_MISC_CFG_FLAG_RESERVED2 0x80000000
  4877. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4878. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4879. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4880. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4881. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4882. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4883. do { \
  4884. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4885. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4886. } while (0)
  4887. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4888. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4889. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4890. (((_var) & HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4891. HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4892. #define HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4893. do { \
  4894. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4895. ((_var) |= ((_val) << HTT_SRING_SETUP_HEAD_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4896. } while (0)
  4897. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M 0xffffffff
  4898. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S 0
  4899. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_GET(_var) \
  4900. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_M) >> \
  4901. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)
  4902. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_SET(_var, _val) \
  4903. do { \
  4904. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO, _val); \
  4905. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_LO_S)); \
  4906. } while (0)
  4907. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M 0xffffffff
  4908. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S 0
  4909. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_GET(_var) \
  4910. (((_var) & HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_M) >> \
  4911. HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)
  4912. #define HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_SET(_var, _val) \
  4913. do { \
  4914. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI, _val); \
  4915. ((_var) |= ((_val) << HTT_SRING_SETUP_TAIL_OFFSET32_REMOTE_BASE_ADDR_HI_S)); \
  4916. } while (0)
  4917. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_M 0xffffffff
  4918. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_S 0
  4919. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_GET(_var) \
  4920. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_LO_M) >> \
  4921. HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)
  4922. #define HTT_SRING_SETUP_RING_MSI_ADDR_LO_SET(_var, _val) \
  4923. do { \
  4924. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_LO, _val); \
  4925. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_LO_S)); \
  4926. } while (0)
  4927. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_M 0xffffffff
  4928. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_S 0
  4929. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_GET(_var) \
  4930. (((_var) & HTT_SRING_SETUP_RING_MSI_ADDR_HI_M) >> \
  4931. HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)
  4932. #define HTT_SRING_SETUP_RING_MSI_ADDR_HI_SET(_var, _val) \
  4933. do { \
  4934. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_ADDR_HI, _val); \
  4935. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_ADDR_HI_S)); \
  4936. } while (0)
  4937. #define HTT_SRING_SETUP_RING_MSI_DATA_M 0xffffffff
  4938. #define HTT_SRING_SETUP_RING_MSI_DATA_S 0
  4939. #define HTT_SRING_SETUP_RING_MSI_DATA_GET(_var) \
  4940. (((_var) & HTT_SRING_SETUP_RING_MSI_DATA_M) >> \
  4941. HTT_SRING_SETUP_RING_MSI_DATA_S)
  4942. #define HTT_SRING_SETUP_RING_MSI_DATA_SET(_var, _val) \
  4943. do { \
  4944. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RING_MSI_DATA, _val); \
  4945. ((_var) |= ((_val) << HTT_SRING_SETUP_RING_MSI_DATA_S)); \
  4946. } while (0)
  4947. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M 0x00007fff
  4948. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S 0
  4949. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_GET(_var) \
  4950. (((_var) & HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_M) >> \
  4951. HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)
  4952. #define HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_SET(_var, _val) \
  4953. do { \
  4954. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH, _val); \
  4955. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_BATCH_COUNTER_TH_S)); \
  4956. } while (0)
  4957. #define HTT_SRING_SETUP_SW_INTR_MODE_M 0x00008000
  4958. #define HTT_SRING_SETUP_SW_INTR_MODE_S 15
  4959. #define HTT_SRING_SETUP_SW_INTR_MODE_GET(_var) \
  4960. (((_var) & HTT_SRING_SETUP_SW_INTR_MODE_M) >> \
  4961. HTT_SRING_SETUP_SW_INTR_MODE_S)
  4962. #define HTT_SRING_SETUP_SW_INTR_MODE_SET(_var, _val) \
  4963. do { \
  4964. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_SW_INTR_MODE, _val); \
  4965. ((_var) |= ((_val) << HTT_SRING_SETUP_SW_INTR_MODE_S)); \
  4966. } while (0)
  4967. #define HTT_SRING_SETUP_INTR_TIMER_TH_M 0xffff0000
  4968. #define HTT_SRING_SETUP_INTR_TIMER_TH_S 16
  4969. #define HTT_SRING_SETUP_INTR_TIMER_TH_GET(_var) \
  4970. (((_var) & HTT_SRING_SETUP_INTR_TIMER_TH_M) >> \
  4971. HTT_SRING_SETUP_INTR_TIMER_TH_S)
  4972. #define HTT_SRING_SETUP_INTR_TIMER_TH_SET(_var, _val) \
  4973. do { \
  4974. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_TIMER_TH, _val); \
  4975. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_TIMER_TH_S)); \
  4976. } while (0)
  4977. #define HTT_SRING_SETUP_INTR_LOW_TH_M 0x0000ffff
  4978. #define HTT_SRING_SETUP_INTR_LOW_TH_S 0
  4979. #define HTT_SRING_SETUP_INTR_LOW_TH_GET(_var) \
  4980. (((_var) & HTT_SRING_SETUP_INTR_LOW_TH_M) >> \
  4981. HTT_SRING_SETUP_INTR_LOW_TH_S)
  4982. #define HTT_SRING_SETUP_INTR_LOW_TH_SET(_var, _val) \
  4983. do { \
  4984. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_INTR_LOW_TH, _val); \
  4985. ((_var) |= ((_val) << HTT_SRING_SETUP_INTR_LOW_TH_S)); \
  4986. } while (0)
  4987. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M 0x00070000
  4988. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S 16
  4989. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_GET(_var) \
  4990. (((_var) & HTT_SRING_SETUP_PREFETCH_TIMER_CFG_M) >> \
  4991. HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)
  4992. #define HTT_SRING_SETUP_PREFETCH_TIMER_CFG_SET(_var, _val) \
  4993. do { \
  4994. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_PREFETCH_TIMER_CFG, _val); \
  4995. ((_var) |= ((_val) << HTT_SRING_SETUP_PREFETCH_TIMER_CFG_S)); \
  4996. } while (0)
  4997. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_M 0x00080000
  4998. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_S 19
  4999. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_GET(_var) \
  5000. (((_var) & HTT_SRING_SETUP_RESPONSE_REQUIRED_M) >> \
  5001. HTT_SRING_SETUP_RESPONSE_REQUIRED_S)
  5002. #define HTT_SRING_SETUP_RESPONSE_REQUIRED_SET(_var, _val) \
  5003. do { \
  5004. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_RESPONSE_REQUIRED, _val); \
  5005. ((_var) |= ((_val) << HTT_SRING_SETUP_RESPONSE_REQUIRED_S)); \
  5006. } while (0)
  5007. /**
  5008. * @brief host -> target RX ring selection config message
  5009. *
  5010. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG
  5011. *
  5012. * @details
  5013. * HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG message is sent by host to
  5014. * configure RXDMA rings.
  5015. * The configuration is per ring based and includes both packet subtypes
  5016. * and PPDU/MPDU TLVs.
  5017. *
  5018. * The message would appear as follows:
  5019. *
  5020. * |31 28|27|26|25|24|23 16|15 | 11| 10|9 8|7 0|
  5021. * |-----+--+--+--+--+----------------+----+---+---+---+---------------|
  5022. * |rsvd1|DT|OV|PS|SS| ring_id | pdev_id | msg_type |
  5023. * |-------------------------------------------------------------------|
  5024. * | rsvd2 | ring_buffer_size |
  5025. * |-------------------------------------------------------------------|
  5026. * | packet_type_enable_flags_0 |
  5027. * |-------------------------------------------------------------------|
  5028. * | packet_type_enable_flags_1 |
  5029. * |-------------------------------------------------------------------|
  5030. * | packet_type_enable_flags_2 |
  5031. * |-------------------------------------------------------------------|
  5032. * | packet_type_enable_flags_3 |
  5033. * |-------------------------------------------------------------------|
  5034. * | tlv_filter_in_flags |
  5035. * |-------------------------------------------------------------------|
  5036. * | rx_header_offset | rx_packet_offset |
  5037. * |-------------------------------------------------------------------|
  5038. * | rx_mpdu_start_offset | rx_mpdu_end_offset |
  5039. * |-------------------------------------------------------------------|
  5040. * | rx_msdu_start_offset | rx_msdu_end_offset |
  5041. * |-------------------------------------------------------------------|
  5042. * | rsvd3 | rx_attention_offset |
  5043. * |-------------------------------------------------------------------|
  5044. * | rsvd4 | mo| fp| rx_drop_threshold |
  5045. * | |ndp|ndp| |
  5046. * |-------------------------------------------------------------------|
  5047. * Where:
  5048. * PS = pkt_swap
  5049. * SS = status_swap
  5050. * OV = rx_offsets_valid
  5051. * DT = drop_thresh_valid
  5052. * The message is interpreted as follows:
  5053. * dword0 - b'0:7 - msg_type: This will be set to
  5054. * 0xc (HTT_H2T_MSG_TYPE_RX_RING_SELECTION_CFG)
  5055. * b'8:15 - pdev_id:
  5056. * 0 (for rings at SOC/UMAC level),
  5057. * 1/2/3 mac id (for rings at LMAC level)
  5058. * b'16:23 - ring_id : Identify the ring to configure.
  5059. * More details can be got from enum htt_srng_ring_id
  5060. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  5061. * BUF_RING_CFG_0 defs within HW .h files,
  5062. * e.g. wmac_top_reg_seq_hwioreg.h
  5063. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  5064. * BUF_RING_CFG_0 defs within HW .h files,
  5065. * e.g. wmac_top_reg_seq_hwioreg.h
  5066. * b'26 - rx_offset_valid (OV): flag to indicate rx offsets
  5067. * configuration fields are valid
  5068. * b'27 - drop_thresh_valid (DT): flag to indicate if the
  5069. * rx_drop_threshold field is valid
  5070. * b'28 - rx_mon_global_en: Enable/Disable global register
  5071. 8 configuration in Rx monitor module.
  5072. * b'29:31 - rsvd1: reserved for future use
  5073. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  5074. * in byte units.
  5075. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5076. * b'16:18 - config_length_mgmt (MGMT):
  5077. * Represents the length of mpdu bytes for mgmt pkt.
  5078. * valid values:
  5079. * 001 - 64bytes
  5080. * 010 - 128bytes
  5081. * 100 - 256bytes
  5082. * 111 - Full mpdu bytes
  5083. * b'19:21 - config_length_ctrl (CTRL):
  5084. * Represents the length of mpdu bytes for ctrl pkt.
  5085. * valid values:
  5086. * 001 - 64bytes
  5087. * 010 - 128bytes
  5088. * 100 - 256bytes
  5089. * 111 - Full mpdu bytes
  5090. * b'22:24 - config_length_data (DATA):
  5091. * Represents the length of mpdu bytes for data pkt.
  5092. * valid values:
  5093. * 001 - 64bytes
  5094. * 010 - 128bytes
  5095. * 100 - 256bytes
  5096. * 111 - Full mpdu bytes
  5097. * b'25:26 - rx_hdr_len:
  5098. * Specifies the number of bytes of recvd packet to copy
  5099. * into the rx_hdr tlv.
  5100. * supported values for now by host:
  5101. * 01 - 64bytes
  5102. * 10 - 128bytes
  5103. * 11 - 256bytes
  5104. * default - 128 bytes
  5105. * b'27:31 - rsvd2: Reserved for future use
  5106. * dword2 - b'0:31 - packet_type_enable_flags_0:
  5107. * Enable MGMT packet from 0b0000 to 0b1001
  5108. * bits from low to high: FP, MD, MO - 3 bits
  5109. * FP: Filter_Pass
  5110. * MD: Monitor_Direct
  5111. * MO: Monitor_Other
  5112. * 10 mgmt subtypes * 3 bits -> 30 bits
  5113. * Refer to PKT_TYPE_ENABLE_FLAG0_xxx_MGMT_xxx defs
  5114. * dword3 - b'0:31 - packet_type_enable_flags_1:
  5115. * Enable MGMT packet from 0b1010 to 0b1111
  5116. * bits from low to high: FP, MD, MO - 3 bits
  5117. * Refer to PKT_TYPE_ENABLE_FLAG1_xxx_MGMT_xxx defs
  5118. * dword4 - b'0:31 - packet_type_enable_flags_2:
  5119. * Enable CTRL packet from 0b0000 to 0b1001
  5120. * bits from low to high: FP, MD, MO - 3 bits
  5121. * Refer to PKT_TYPE_ENABLE_FLAG2_xxx_CTRL_xxx defs
  5122. * dword5 - b'0:31 - packet_type_enable_flags_3:
  5123. * Enable CTRL packet from 0b1010 to 0b1111,
  5124. * MCAST_DATA, UCAST_DATA, NULL_DATA
  5125. * bits from low to high: FP, MD, MO - 3 bits
  5126. * Refer to PKT_TYPE_ENABLE_FLAG3_xxx_CTRL_xxx defs
  5127. * dword6 - b'0:31 - tlv_filter_in_flags:
  5128. * Filter in Attention/MPDU/PPDU/Header/User tlvs
  5129. * Refer to CFG_TLV_FILTER_IN_FLAG defs
  5130. * dword7 - b'0:15 - rx_packet_offset: rx_packet_offset in byte units
  5131. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5132. * A value of 0 will be considered as ignore this config.
  5133. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5134. * e.g. wmac_top_reg_seq_hwioreg.h
  5135. * - b'16:31 - rx_header_offset: rx_header_offset in byte units
  5136. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5137. * A value of 0 will be considered as ignore this config.
  5138. * Refer to BUF_RING_CFG_1 defs within HW .h files,
  5139. * e.g. wmac_top_reg_seq_hwioreg.h
  5140. * dword8 - b'0:15 - rx_mpdu_end_offset: rx_mpdu_end_offset in byte units
  5141. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5142. * A value of 0 will be considered as ignore this config.
  5143. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5144. * e.g. wmac_top_reg_seq_hwioreg.h
  5145. * - b'16:31 - rx_mpdu_start_offset: rx_mpdu_start_offset in byte units
  5146. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5147. * A value of 0 will be considered as ignore this config.
  5148. * Refer to BUF_RING_CFG_2 defs within HW .h files,
  5149. * e.g. wmac_top_reg_seq_hwioreg.h
  5150. * dword9 - b'0:15 - rx_msdu_end_offset: rx_msdu_end_offset in byte units
  5151. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5152. * A value of 0 will be considered as ignore this config.
  5153. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5154. * e.g. wmac_top_reg_seq_hwioreg.h
  5155. * - b'16:31 - rx_msdu_start_offset: rx_msdu_start_offset in byte units
  5156. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5157. * A value of 0 will be considered as ignore this config.
  5158. * Refer to BUF_RING_CFG_3 defs within HW .h files,
  5159. * e.g. wmac_top_reg_seq_hwioreg.h
  5160. * dword10- b'0:15 - rx_attention_offset: rx_attention_offset in byte units
  5161. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  5162. * A value of 0 will be considered as ignore this config.
  5163. * Refer to BUF_RING_CFG_4 defs within HW .h files,
  5164. * e.g. wmac_top_reg_seq_hwioreg.h
  5165. * - b'16:31 - rsvd3 for future use
  5166. * dword11- b'9:0 - rx_drop_threshold: Threshold configured in monitor mode
  5167. * to source rings. Consumer drops packets if the available
  5168. * words in the ring falls below the configured threshold
  5169. * value.
  5170. * - b'10 - fp_ndp: Flag to indicate FP NDP status tlv is subscribed
  5171. * by host. 1 -> subscribed
  5172. * - b'11 - mo_ndp: Flag to indicate MO NDP status tlv is subscribed
  5173. * by host. 1 -> subscribed
  5174. * - b'12 - fp_phy_err: Flag to indicate FP PHY status tlv is
  5175. * subscribed by host. 1 -> subscribed
  5176. * - b'13:14 - fp_phy_err_buf_src: This indicates the source ring
  5177. * selection for the FP PHY ERR status tlv.
  5178. * 0 - wbm2rxdma_buf_source_ring
  5179. * 1 - fw2rxdma_buf_source_ring
  5180. * 2 - sw2rxdma_buf_source_ring
  5181. * 3 - no_buffer_ring
  5182. * - b'15:16 - fp_phy_err_buf_dest: This indicates the destination ring
  5183. * selection for the FP PHY ERR status tlv.
  5184. * 0 - rxdma_release_ring
  5185. * 1 - rxdma2fw_ring
  5186. * 2 - rxdma2sw_ring
  5187. * 3 - rxdma2reo_ring
  5188. * - b'17:19 - pkt_type_en_msdu_or_mpdu_logging
  5189. * b'17 - Enables MSDU/MPDU logging for frames of MGMT type
  5190. * b'18 - Enables MSDU/MPDU logging for frames of CTRL type
  5191. * b'19 - Enables MSDU/MPDU logging for frames of DATA type
  5192. * - b'20 - dma_mpdu_mgmt: 1: MPDU level logging
  5193. * 0: MSDU level logging
  5194. * - b'21 - dma_mpdu_ctrl: 1: MPDU level logging
  5195. * 0: MSDU level logging
  5196. * - b'22 - dma_mpdu_data: 1: MPDU level logging
  5197. * 0: MSDU level logging
  5198. * - b'23 - word_mask_compaction: enable/disable word mask for
  5199. * mpdu/msdu start/end tlvs
  5200. * - b'24 - rbm_override_enable: enabling/disabling return buffer
  5201. * manager override
  5202. * - b'25:28 - rbm_override_val: return buffer manager override value
  5203. * dword12- b'0:31 - phy_err_mask: This field is to select the fp phy errors
  5204. * which have to be posted to host from phy.
  5205. * Corresponding to errors defined in
  5206. * phyrx_abort_request_reason enums 0 to 31.
  5207. * Refer to RXPCU register definition header files for the
  5208. * phyrx_abort_request_reason enum definition.
  5209. * dword13- b'0:31 - phy_err_mask_cont: This field is to select the fp phy
  5210. * errors which have to be posted to host from phy.
  5211. * Corresponding to errors defined in
  5212. * phyrx_abort_request_reason enums 32 to 63.
  5213. * Refer to RXPCU register definition header files for the
  5214. * phyrx_abort_request_reason enum definition.
  5215. * dword14- b'0:15 - rx_mpdu_start_word_mask: word mask for rx mpdu start,
  5216. * applicable if word mask enabled
  5217. * - b'16:18 - rx_mpdu_end_word_mask: word mask value for rx mpdu end,
  5218. * applicable if word mask enabled
  5219. * - b'19:31 - rsvd7
  5220. * dword15- b'0:16 - rx_msdu_end_word_mask
  5221. * - b'17:31 - rsvd5
  5222. * dword17- b'0 - en_rx_tlv_pkt_offset:
  5223. * 0: RX_PKT TLV logging at offset 0 for the subsequent
  5224. * buffer
  5225. * 1: RX_PKT TLV logging at specified offset for the
  5226. * subsequent buffer
  5227. * b`15:1 - rx_pkt_tlv_offset: Qword offset for rx_packet TLVs.
  5228. */
  5229. PREPACK struct htt_rx_ring_selection_cfg_t {
  5230. A_UINT32 msg_type: 8,
  5231. pdev_id: 8,
  5232. ring_id: 8,
  5233. status_swap: 1,
  5234. pkt_swap: 1,
  5235. rx_offsets_valid: 1,
  5236. drop_thresh_valid: 1,
  5237. rx_mon_global_en: 1,
  5238. rsvd1: 3;
  5239. A_UINT32 ring_buffer_size: 16,
  5240. config_length_mgmt:3,
  5241. config_length_ctrl:3,
  5242. config_length_data:3,
  5243. rx_hdr_len: 2,
  5244. rsvd2: 5;
  5245. A_UINT32 packet_type_enable_flags_0;
  5246. A_UINT32 packet_type_enable_flags_1;
  5247. A_UINT32 packet_type_enable_flags_2;
  5248. A_UINT32 packet_type_enable_flags_3;
  5249. A_UINT32 tlv_filter_in_flags;
  5250. A_UINT32 rx_packet_offset: 16,
  5251. rx_header_offset: 16;
  5252. A_UINT32 rx_mpdu_end_offset: 16,
  5253. rx_mpdu_start_offset: 16;
  5254. A_UINT32 rx_msdu_end_offset: 16,
  5255. rx_msdu_start_offset: 16;
  5256. A_UINT32 rx_attn_offset: 16,
  5257. rsvd3: 16;
  5258. A_UINT32 rx_drop_threshold: 10,
  5259. fp_ndp: 1,
  5260. mo_ndp: 1,
  5261. fp_phy_err: 1,
  5262. fp_phy_err_buf_src: 2,
  5263. fp_phy_err_buf_dest: 2,
  5264. pkt_type_enable_msdu_or_mpdu_logging:3,
  5265. dma_mpdu_mgmt: 1,
  5266. dma_mpdu_ctrl: 1,
  5267. dma_mpdu_data: 1,
  5268. word_mask_compaction_enable:1,
  5269. rbm_override_enable: 1,
  5270. rbm_override_val: 4,
  5271. rsvd4: 3;
  5272. A_UINT32 phy_err_mask;
  5273. A_UINT32 phy_err_mask_cont;
  5274. A_UINT32 rx_mpdu_start_word_mask:16,
  5275. rx_mpdu_end_word_mask: 3,
  5276. rsvd7: 13;
  5277. A_UINT32 rx_msdu_end_word_mask: 17,
  5278. rsvd5: 15;
  5279. A_UINT32 en_rx_tlv_pkt_offset: 1,
  5280. rx_pkt_tlv_offset: 15,
  5281. rsvd6: 16;
  5282. } POSTPACK;
  5283. #define HTT_RX_RING_SELECTION_CFG_SZ (sizeof(struct htt_rx_ring_selection_cfg_t))
  5284. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_M 0x0000ff00
  5285. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_S 8
  5286. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_GET(_var) \
  5287. (((_var) & HTT_RX_RING_SELECTION_CFG_PDEV_ID_M) >> \
  5288. HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)
  5289. #define HTT_RX_RING_SELECTION_CFG_PDEV_ID_SET(_var, _val) \
  5290. do { \
  5291. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PDEV_ID, _val); \
  5292. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PDEV_ID_S)); \
  5293. } while (0)
  5294. #define HTT_RX_RING_SELECTION_CFG_RING_ID_M 0x00ff0000
  5295. #define HTT_RX_RING_SELECTION_CFG_RING_ID_S 16
  5296. #define HTT_RX_RING_SELECTION_CFG_RING_ID_GET(_var) \
  5297. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_ID_M) >> \
  5298. HTT_RX_RING_SELECTION_CFG_RING_ID_S)
  5299. #define HTT_RX_RING_SELECTION_CFG_RING_ID_SET(_var, _val) \
  5300. do { \
  5301. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_ID, _val); \
  5302. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_ID_S)); \
  5303. } while (0)
  5304. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M 0x01000000
  5305. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S 24
  5306. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_GET(_var) \
  5307. (((_var) & HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_M) >> \
  5308. HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)
  5309. #define HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SET(_var, _val) \
  5310. do { \
  5311. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP, _val); \
  5312. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_STATUS_TLV_SWAP_S)); \
  5313. } while (0)
  5314. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M 0x02000000
  5315. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S 25
  5316. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_GET(_var) \
  5317. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_M) >> \
  5318. HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)
  5319. #define HTT_RX_RING_SELECTION_CFG_PKT_TLV_SET(_var, _val) \
  5320. do { \
  5321. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP, _val); \
  5322. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TLV_SWAP_S)); \
  5323. } while (0)
  5324. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M 0x04000000
  5325. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S 26
  5326. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_GET(_var) \
  5327. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_M) >> \
  5328. HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)
  5329. #define HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_SET(_var, _val) \
  5330. do { \
  5331. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID, _val); \
  5332. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_OFFSETS_VALID_S)); \
  5333. } while (0)
  5334. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M 0x08000000
  5335. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S 27
  5336. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_GET(_var) \
  5337. (((_var) & HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_M) >> \
  5338. HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)
  5339. #define HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_SET(_var, _val) \
  5340. do { \
  5341. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID, _val); \
  5342. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DROP_THRESHOLD_VALID_S)); \
  5343. } while (0)
  5344. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M 0x10000000
  5345. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S 28
  5346. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_GET(_var) \
  5347. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_M) >> \
  5348. HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)
  5349. #define HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_SET(_var, _val) \
  5350. do { \
  5351. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN, _val); \
  5352. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MON_GLOBAL_EN_S)); \
  5353. } while (0)
  5354. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  5355. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S 0
  5356. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_GET(_var) \
  5357. (((_var) & HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_M) >> \
  5358. HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)
  5359. #define HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  5360. do { \
  5361. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE, _val); \
  5362. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RING_BUFFER_SIZE_S)); \
  5363. } while (0)
  5364. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  5365. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S 16
  5366. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  5367. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_M) >> \
  5368. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)
  5369. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  5370. do { \
  5371. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT, _val); \
  5372. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_MGMT_S)); \
  5373. } while (0)
  5374. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  5375. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S 19
  5376. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  5377. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_M) >> \
  5378. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)
  5379. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  5380. do { \
  5381. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL, _val); \
  5382. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_CTRL_S)); \
  5383. } while (0)
  5384. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  5385. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S 22
  5386. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  5387. (((_var) & HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_M) >> \
  5388. HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)
  5389. #define HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  5390. do { \
  5391. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA, _val); \
  5392. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_CONFIG_LENGTH_DATA_S)); \
  5393. } while (0)
  5394. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M 0x06000000
  5395. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S 25
  5396. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_GET(_var) \
  5397. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_M) >> \
  5398. HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S)
  5399. #define HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_SET(_var, _val) \
  5400. do { \
  5401. HTT_CHECK_SET_VAL( HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN, _val); \
  5402. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HDR_LEN_S));\
  5403. } while(0)
  5404. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M 0xffffffff
  5405. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S 0
  5406. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_GET(_var) \
  5407. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_M) >> \
  5408. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)
  5409. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_SET(_var, _val) \
  5410. do { \
  5411. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0, _val); \
  5412. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_0_S)); \
  5413. } while (0)
  5414. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M 0xffffffff
  5415. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S 0
  5416. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_GET(_var) \
  5417. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_M) >> \
  5418. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)
  5419. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_SET(_var, _val) \
  5420. do { \
  5421. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1, _val); \
  5422. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_1_S)); \
  5423. } while (0)
  5424. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M 0xffffffff
  5425. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S 0
  5426. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_GET(_var) \
  5427. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_M) >> \
  5428. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)
  5429. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_SET(_var, _val) \
  5430. do { \
  5431. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2, _val); \
  5432. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_2_S)); \
  5433. } while (0)
  5434. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M 0xffffffff
  5435. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S 0
  5436. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_GET(_var) \
  5437. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_M) >> \
  5438. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)
  5439. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_SET(_var, _val) \
  5440. do { \
  5441. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3, _val); \
  5442. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG_3_S)); \
  5443. } while (0)
  5444. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M 0xffffffff
  5445. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S 0
  5446. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_GET(_var) \
  5447. (((_var) & HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_M) >> \
  5448. HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)
  5449. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_SET(_var, _val) \
  5450. do { \
  5451. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG, _val); \
  5452. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_S)); \
  5453. } while (0)
  5454. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M 0x0000ffff
  5455. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S 0
  5456. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_GET(_var) \
  5457. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_M) >> \
  5458. HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)
  5459. #define HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_SET(_var, _val) \
  5460. do { \
  5461. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET, _val); \
  5462. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PACKET_OFFSET_S)); \
  5463. } while (0)
  5464. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M 0xffff0000
  5465. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S 16
  5466. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_GET(_var) \
  5467. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_M) >> \
  5468. HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)
  5469. #define HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_SET(_var, _val) \
  5470. do { \
  5471. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET, _val); \
  5472. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_HEADER_OFFSET_S)); \
  5473. } while (0)
  5474. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M 0x0000ffff
  5475. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S 0
  5476. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_GET(_var) \
  5477. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_M) >> \
  5478. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)
  5479. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_SET(_var, _val) \
  5480. do { \
  5481. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET, _val); \
  5482. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_OFFSET_S)); \
  5483. } while (0)
  5484. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M 0xffff0000
  5485. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S 16
  5486. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_GET(_var) \
  5487. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_M) >> \
  5488. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)
  5489. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_SET(_var, _val) \
  5490. do { \
  5491. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET, _val); \
  5492. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_OFFSET_S)); \
  5493. } while (0)
  5494. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M 0x0000ffff
  5495. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S 0
  5496. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_GET(_var) \
  5497. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_M) >> \
  5498. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)
  5499. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_SET(_var, _val) \
  5500. do { \
  5501. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET, _val); \
  5502. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_OFFSET_S)); \
  5503. } while (0)
  5504. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M 0xffff0000
  5505. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S 16
  5506. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_GET(_var) \
  5507. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_M) >> \
  5508. HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)
  5509. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_SET(_var, _val) \
  5510. do { \
  5511. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET, _val); \
  5512. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_START_OFFSET_S)); \
  5513. } while (0)
  5514. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M 0x0000ffff
  5515. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S 0
  5516. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_GET(_var) \
  5517. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_M) >> \
  5518. HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)
  5519. #define HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_SET(_var, _val) \
  5520. do { \
  5521. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET, _val); \
  5522. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_ATTENTION_OFFSET_S)); \
  5523. } while (0)
  5524. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M 0x000003ff
  5525. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S 0
  5526. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_GET(_var) \
  5527. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_M) >> \
  5528. HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)
  5529. #define HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_SET(_var, _val) \
  5530. do { \
  5531. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD, _val); \
  5532. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_DROP_THRESHOLD_S)); \
  5533. } while (0)
  5534. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_M 0x00000400
  5535. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_S 10
  5536. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_GET(_var) \
  5537. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_NDP_M) >> \
  5538. HTT_RX_RING_SELECTION_CFG_FP_NDP_S)
  5539. #define HTT_RX_RING_SELECTION_CFG_FP_NDP_SET(_var, _val) \
  5540. do { \
  5541. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_NDP, _val); \
  5542. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_NDP_S)); \
  5543. } while (0)
  5544. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_M 0x00000800
  5545. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_S 11
  5546. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_GET(_var) \
  5547. (((_var) & HTT_RX_RING_SELECTION_CFG_MO_NDP_M) >> \
  5548. HTT_RX_RING_SELECTION_CFG_MO_NDP_S)
  5549. #define HTT_RX_RING_SELECTION_CFG_MO_NDP_SET(_var, _val) \
  5550. do { \
  5551. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_MO_NDP, _val); \
  5552. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_MO_NDP_S)); \
  5553. } while (0)
  5554. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M 0x00001000
  5555. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S 12
  5556. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_GET(_var) \
  5557. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_M) >> \
  5558. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)
  5559. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_SET(_var, _val) \
  5560. do { \
  5561. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR, _val); \
  5562. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_S)); \
  5563. } while (0)
  5564. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M 0x00006000
  5565. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S 13
  5566. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_GET(_var) \
  5567. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_M) >> \
  5568. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)
  5569. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_SET(_var, _val) \
  5570. do { \
  5571. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC, _val); \
  5572. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_SRC_S)); \
  5573. } while (0)
  5574. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M 0x00018000
  5575. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S 15
  5576. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_GET(_var) \
  5577. (((_var) & HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_M) >> \
  5578. HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)
  5579. #define HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_SET(_var, _val) \
  5580. do { \
  5581. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST, _val); \
  5582. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_FP_PHY_ERR_BUF_DEST_S)); \
  5583. } while (0)
  5584. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M 0x000E0000
  5585. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S 17
  5586. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_GET(_var) \
  5587. (((_var) & HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_M) >> \
  5588. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)
  5589. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_SET(_var, _val) \
  5590. do { \
  5591. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING, _val); \
  5592. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_MSDU_MPDU_LOGGING_S)); \
  5593. } while (0)
  5594. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M 0x00100000
  5595. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S 20
  5596. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_GET(_var) \
  5597. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_M) >> \
  5598. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)
  5599. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  5600. do { \
  5601. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT, _val); \
  5602. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_MGMT_S)); \
  5603. } while (0)
  5604. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M 0x00200000
  5605. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S 21
  5606. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_GET(_var) \
  5607. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_M) >> \
  5608. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)
  5609. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  5610. do { \
  5611. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL, _val); \
  5612. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_CTRL_S)); \
  5613. } while (0)
  5614. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M 0x00400000
  5615. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S 22
  5616. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_GET(_var) \
  5617. (((_var) & HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_M) >> \
  5618. HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)
  5619. #define HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  5620. do { \
  5621. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA, _val); \
  5622. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_DMA_MPDU_DATA_S)); \
  5623. } while (0)
  5624. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M 0x00800000
  5625. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S 23
  5626. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_GET(_var) \
  5627. (((_var) & HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_M) >> \
  5628. HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)
  5629. #define HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_SET(_var, _val) \
  5630. do { \
  5631. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE, _val); \
  5632. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_WORD_MASK_COMPACTION_ENABLE_S)); \
  5633. } while (0)
  5634. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M 0x01000000
  5635. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S 24
  5636. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_GET(_var) \
  5637. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_M) >> \
  5638. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)
  5639. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_SET(_var, _val) \
  5640. do { \
  5641. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE, _val);\
  5642. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_ENABLE_S)); \
  5643. } while (0)
  5644. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M 0x1E000000
  5645. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S 25
  5646. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_GET(_var) \
  5647. (((_var) & HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_M) >> \
  5648. HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S)
  5649. #define HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_SET(_var, _val) \
  5650. do { \
  5651. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE, _val);\
  5652. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RBM_OVERRIDE_VALUE_S));\
  5653. } while (0)
  5654. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M 0xffffffff
  5655. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S 0
  5656. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_GET(_var) \
  5657. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_M) >> \
  5658. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)
  5659. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_SET(_var, _val) \
  5660. do { \
  5661. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK, _val); \
  5662. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_S)); \
  5663. } while (0)
  5664. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M 0xffffffff
  5665. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S 0
  5666. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_GET(_var) \
  5667. (((_var) & HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_M) >> \
  5668. HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)
  5669. #define HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_SET(_var, _val) \
  5670. do { \
  5671. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT, _val); \
  5672. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_PHY_ERR_MASK_CONT_S)); \
  5673. } while (0)
  5674. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M 0x0000FFFF
  5675. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S 0
  5676. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_GET(_var) \
  5677. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_M)>> \
  5678. HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)
  5679. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_SET(_var, _val) \
  5680. do { \
  5681. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK, _val);\
  5682. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_START_WORD_MASK_S)); \
  5683. } while (0)
  5684. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M 0x00070000
  5685. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S 16
  5686. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_GET(_var) \
  5687. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_M)>> \
  5688. HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)
  5689. #define HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_SET(_var, _val) \
  5690. do { \
  5691. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK, _val);\
  5692. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MPDU_END_WORD_MASK_S)); \
  5693. } while (0)
  5694. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M 0x0001FFFF
  5695. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S 0
  5696. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_GET(_var) \
  5697. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_M)>> \
  5698. HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)
  5699. #define HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_SET(_var, _val) \
  5700. do { \
  5701. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK, _val);\
  5702. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_MSDU_END_WORD_MASK_S)); \
  5703. } while (0)
  5704. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M 0x00000001
  5705. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S 0
  5706. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_GET(_var) \
  5707. (((_var) & HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_M)>> \
  5708. HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)
  5709. #define HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5710. do { \
  5711. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET, _val); \
  5712. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_ENABLE_RX_PKT_TLV_OFFSET_S)); \
  5713. } while (0)
  5714. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M 0x0000FFFE
  5715. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S 1
  5716. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_GET(_var) \
  5717. (((_var) & HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_M)>> \
  5718. HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)
  5719. #define HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_SET(_var, _val) \
  5720. do { \
  5721. HTT_CHECK_SET_VAL(HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET, _val); \
  5722. ((_var) |= ((_val) << HTT_RX_RING_SELECTION_CFG_RX_PKT_TLV_OFFSET_S)); \
  5723. } while (0)
  5724. /*
  5725. * Subtype based MGMT frames enable bits.
  5726. * FP: Filter_Pass, MD: Monitor_Direct MO: Monitor_Other
  5727. */
  5728. /* association request */
  5729. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_M 0x00000001
  5730. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0000_S 0
  5731. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_M 0x00000002
  5732. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0000_S 1
  5733. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_M 0x00000004
  5734. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0000_S 2
  5735. /* association response */
  5736. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_M 0x00000008
  5737. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0001_S 3
  5738. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_M 0x00000010
  5739. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0001_S 4
  5740. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_M 0x00000020
  5741. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0001_S 5
  5742. /* Reassociation request */
  5743. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_M 0x00000040
  5744. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0010_S 6
  5745. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_M 0x00000080
  5746. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0010_S 7
  5747. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_M 0x00000100
  5748. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0010_S 8
  5749. /* Reassociation response */
  5750. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_M 0x00000200
  5751. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0011_S 9
  5752. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_M 0x00000400
  5753. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0011_S 10
  5754. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_M 0x00000800
  5755. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0011_S 11
  5756. /* Probe request */
  5757. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_M 0x00001000
  5758. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0100_S 12
  5759. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_M 0x00002000
  5760. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0100_S 13
  5761. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_M 0x00004000
  5762. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0100_S 14
  5763. /* Probe response */
  5764. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_M 0x00008000
  5765. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0101_S 15
  5766. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_M 0x00010000
  5767. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0101_S 16
  5768. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_M 0x00020000
  5769. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0101_S 17
  5770. /* Timing Advertisement */
  5771. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_M 0x00040000
  5772. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0110_S 18
  5773. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_M 0x00080000
  5774. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0110_S 19
  5775. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_M 0x00100000
  5776. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0110_S 20
  5777. /* Reserved */
  5778. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_M 0x00200000
  5779. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_0111_S 21
  5780. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_M 0x00400000
  5781. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_0111_S 22
  5782. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_M 0x00800000
  5783. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_0111_S 23
  5784. /* Beacon */
  5785. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_M 0x01000000
  5786. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1000_S 24
  5787. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_M 0x02000000
  5788. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1000_S 25
  5789. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_M 0x04000000
  5790. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1000_S 26
  5791. /* ATIM */
  5792. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_M 0x08000000
  5793. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_FP_MGMT_1001_S 27
  5794. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_M 0x10000000
  5795. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MD_MGMT_1001_S 28
  5796. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_M 0x20000000
  5797. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG0_MO_MGMT_1001_S 29
  5798. /* Disassociation */
  5799. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_M 0x00000001
  5800. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1010_S 0
  5801. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_M 0x00000002
  5802. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1010_S 1
  5803. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_M 0x00000004
  5804. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1010_S 2
  5805. /* Authentication */
  5806. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_M 0x00000008
  5807. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1011_S 3
  5808. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_M 0x00000010
  5809. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1011_S 4
  5810. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_M 0x00000020
  5811. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1011_S 5
  5812. /* Deauthentication */
  5813. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_M 0x00000040
  5814. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1100_S 6
  5815. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_M 0x00000080
  5816. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1100_S 7
  5817. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_M 0x00000100
  5818. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1100_S 8
  5819. /* Action */
  5820. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_M 0x00000200
  5821. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1101_S 9
  5822. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_M 0x00000400
  5823. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1101_S 10
  5824. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_M 0x00000800
  5825. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1101_S 11
  5826. /* Action No Ack */
  5827. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_M 0x00001000
  5828. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1110_S 12
  5829. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_M 0x00002000
  5830. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1110_S 13
  5831. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_M 0x00004000
  5832. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1110_S 14
  5833. /* Reserved */
  5834. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_M 0x00008000
  5835. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_FP_MGMT_1111_S 15
  5836. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_M 0x00010000
  5837. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MD_MGMT_1111_S 16
  5838. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_M 0x00020000
  5839. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG1_MO_MGMT_1111_S 17
  5840. /*
  5841. * Subtype based CTRL frames enable bits.
  5842. * FP: Filter_Pass, MD: Monitor_Direct, MO: Monitor_Other
  5843. */
  5844. /* Reserved */
  5845. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_M 0x00000001
  5846. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0000_S 0
  5847. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_M 0x00000002
  5848. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0000_S 1
  5849. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_M 0x00000004
  5850. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0000_S 2
  5851. /* Reserved */
  5852. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_M 0x00000008
  5853. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0001_S 3
  5854. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_M 0x00000010
  5855. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0001_S 4
  5856. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_M 0x00000020
  5857. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0001_S 5
  5858. /* Reserved */
  5859. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_M 0x00000040
  5860. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0010_S 6
  5861. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_M 0x00000080
  5862. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0010_S 7
  5863. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_M 0x00000100
  5864. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0010_S 8
  5865. /* Reserved */
  5866. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_M 0x00000200
  5867. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0011_S 9
  5868. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_M 0x00000400
  5869. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0011_S 10
  5870. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_M 0x00000800
  5871. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0011_S 11
  5872. /* Reserved */
  5873. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_M 0x00001000
  5874. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0100_S 12
  5875. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_M 0x00002000
  5876. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0100_S 13
  5877. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_M 0x00004000
  5878. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0100_S 14
  5879. /* Reserved */
  5880. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_M 0x00008000
  5881. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0101_S 15
  5882. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_M 0x00010000
  5883. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0101_S 16
  5884. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_M 0x00020000
  5885. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0101_S 17
  5886. /* Reserved */
  5887. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_M 0x00040000
  5888. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0110_S 18
  5889. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_M 0x00080000
  5890. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0110_S 19
  5891. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_M 0x00100000
  5892. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0110_S 20
  5893. /* Control Wrapper */
  5894. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_M 0x00200000
  5895. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_0111_S 21
  5896. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_M 0x00400000
  5897. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_0111_S 22
  5898. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_M 0x00800000
  5899. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_0111_S 23
  5900. /* Block Ack Request */
  5901. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_M 0x01000000
  5902. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1000_S 24
  5903. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_M 0x02000000
  5904. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1000_S 25
  5905. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_M 0x04000000
  5906. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1000_S 26
  5907. /* Block Ack*/
  5908. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_M 0x08000000
  5909. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_FP_CTRL_1001_S 27
  5910. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_M 0x10000000
  5911. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MD_CTRL_1001_S 28
  5912. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_M 0x20000000
  5913. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG2_MO_CTRL_1001_S 29
  5914. /* PS-POLL */
  5915. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_M 0x00000001
  5916. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1010_S 0
  5917. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_M 0x00000002
  5918. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1010_S 1
  5919. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_M 0x00000004
  5920. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1010_S 2
  5921. /* RTS */
  5922. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_M 0x00000008
  5923. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1011_S 3
  5924. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_M 0x00000010
  5925. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1011_S 4
  5926. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_M 0x00000020
  5927. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1011_S 5
  5928. /* CTS */
  5929. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_M 0x00000040
  5930. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1100_S 6
  5931. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_M 0x00000080
  5932. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1100_S 7
  5933. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_M 0x00000100
  5934. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1100_S 8
  5935. /* ACK */
  5936. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_M 0x00000200
  5937. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1101_S 9
  5938. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_M 0x00000400
  5939. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1101_S 10
  5940. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_M 0x00000800
  5941. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1101_S 11
  5942. /* CF-END */
  5943. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_M 0x00001000
  5944. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1110_S 12
  5945. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_M 0x00002000
  5946. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1110_S 13
  5947. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_M 0x00004000
  5948. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1110_S 14
  5949. /* CF-END + CF-ACK */
  5950. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_M 0x00008000
  5951. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_CTRL_1111_S 15
  5952. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_M 0x00010000
  5953. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_CTRL_1111_S 16
  5954. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_M 0x00020000
  5955. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_CTRL_1111_S 17
  5956. /* Multicast data */
  5957. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_M 0x00040000
  5958. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_MCAST_S 18
  5959. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_M 0x00080000
  5960. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_MCAST_S 19
  5961. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_M 0x00100000
  5962. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_MCAST_S 20
  5963. /* Unicast data */
  5964. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_M 0x00200000
  5965. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_UCAST_S 21
  5966. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_M 0x00400000
  5967. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_UCAST_S 22
  5968. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_M 0x00800000
  5969. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_UCAST_S 23
  5970. /* NULL data */
  5971. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_M 0x01000000
  5972. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_FP_DATA_NULL_S 24
  5973. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_M 0x02000000
  5974. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MD_DATA_NULL_S 25
  5975. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_M 0x04000000
  5976. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_FLAG3_MO_DATA_NULL_S 26
  5977. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET(word, httsym, value) \
  5978. do { \
  5979. HTT_CHECK_SET_VAL(httsym, value); \
  5980. (word) |= (value) << httsym##_S; \
  5981. } while (0)
  5982. #define HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET(word, httsym) \
  5983. (((word) & httsym##_M) >> httsym##_S)
  5984. #define htt_rx_ring_pkt_enable_subtype_set( \
  5985. word, flag, mode, type, subtype, val) \
  5986. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_SET( \
  5987. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype, val)
  5988. #define htt_rx_ring_pkt_enable_subtype_get( \
  5989. word, flag, mode, type, subtype) \
  5990. HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_GET( \
  5991. word, HTT_RX_RING_SELECTION_CFG_PKT_TYPE_ENABLE_##flag##_##mode##_##type##_##subtype)
  5992. /* Definition to filter in TLVs */
  5993. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_M 0x00000001
  5994. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_START_S 0
  5995. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_M 0x00000002
  5996. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_START_S 1
  5997. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_M 0x00000004
  5998. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_S 2
  5999. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_M 0x00000008
  6000. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MSDU_END_S 3
  6001. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_M 0x00000010
  6002. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_MPDU_END_S 4
  6003. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_M 0x00000020
  6004. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PACKET_HEADER_S 5
  6005. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_M 0x00000040
  6006. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_RESERVED_S 6
  6007. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_M 0x00000080
  6008. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_ATTENTION_S 7
  6009. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_M 0x00000100
  6010. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_S 8
  6011. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_M 0x00000200
  6012. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_S 9
  6013. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_M 0x00000400
  6014. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_S 10
  6015. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_M 0x00000800
  6016. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_USER_STATS_EXT_S 11
  6017. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_M 0x00001000
  6018. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_END_STATUS_DONE_S 12
  6019. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_M 0x00002000
  6020. #define HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_PPDU_START_USER_INFO_S 13
  6021. #define HTT_RX_RING_TLV_ENABLE_SET(word, httsym, enable) \
  6022. do { \
  6023. HTT_CHECK_SET_VAL(httsym, enable); \
  6024. (word) |= (enable) << httsym##_S; \
  6025. } while (0)
  6026. #define HTT_RX_RING_TLV_ENABLE_GET(word, httsym) \
  6027. (((word) & httsym##_M) >> httsym##_S)
  6028. #define htt_rx_ring_tlv_filter_in_enable_set(word, tlv, enable) \
  6029. HTT_RX_RING_TLV_ENABLE_SET( \
  6030. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv, enable)
  6031. #define htt_rx_ring_tlv_filter_in_enable_get(word, tlv) \
  6032. HTT_RX_RING_TLV_ENABLE_GET( \
  6033. word, HTT_RX_RING_SELECTION_CFG_TLV_FILTER_IN_FLAG_RX_##tlv)
  6034. /**
  6035. * @brief host -> target TX monitor config message
  6036. *
  6037. * MSG_TYPE => HTT_H2T_MSG_TYPE_TX_MONITOR_CFG
  6038. *
  6039. * @details
  6040. * HTT_H2T_MSG_TYPE_TX_MONITOR_CFG message is sent by host to
  6041. * configure RXDMA rings.
  6042. * The configuration is per ring based and includes both packet types
  6043. * and PPDU/MPDU TLVs.
  6044. *
  6045. * The message would appear as follows:
  6046. *
  6047. * |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|
  6048. * |--------+--+--+-----+--+--+--+-----+--+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6049. * | rsvd1 |PS|SS| ring_id | pdev_id | msg_type |
  6050. * |-----------+--------+--------+-----+------------------------------------|
  6051. * | rsvd2 | DATA | CTRL | MGMT| ring_buffer_size |
  6052. * |--------------------------------------+--+--+--+--+--+-+-+-+-+-+-+-+----|
  6053. * | | M| M| M| M| M|M|M|M|M|M|M|M| |
  6054. * | | S| S| S| P| P|P|S|S|S|P|P|P| |
  6055. * | | E| E| E| E| E|E|S|S|S|S|S|S| |
  6056. * | rsvd3 | D| C| M| D| C|M|D|C|M|D|C|M| E |
  6057. * |------------------------------------------------------------------------|
  6058. * | tlv_filter_mask_in0 |
  6059. * |------------------------------------------------------------------------|
  6060. * | tlv_filter_mask_in1 |
  6061. * |------------------------------------------------------------------------|
  6062. * | tlv_filter_mask_in2 |
  6063. * |------------------------------------------------------------------------|
  6064. * | tlv_filter_mask_in3 |
  6065. * |-----------------+-----------------+---------------------+--------------|
  6066. * | tx_msdu_start_wm| tx_queue_ext_wm | tx_peer_entry_wm |tx_fes_stup_wm|
  6067. * |------------------------------------------------------------------------|
  6068. * | pcu_ppdu_setup_word_mask |
  6069. * |--------------------+--+--+--+-----+---------------------+--------------|
  6070. * | rsvd4 | D| C| M| PT | rxpcu_usrsetp_wm |tx_mpdu_srt_wm|
  6071. * |------------------------------------------------------------------------|
  6072. *
  6073. * Where:
  6074. * PS = pkt_swap
  6075. * SS = status_swap
  6076. * The message is interpreted as follows:
  6077. * dword0 - b'0:7 - msg_type: This will be set to
  6078. * 0x1b (HTT_H2T_MSG_TYPE_TX_MONITOR_CFG)
  6079. * b'8:15 - pdev_id:
  6080. * 0 (for rings at SOC level),
  6081. * 1/2/3 mac id (for rings at LMAC level)
  6082. * b'16:23 - ring_id : Identify the ring to configure.
  6083. * More details can be got from enum htt_srng_ring_id
  6084. * b'24 - status_swap (SS): 1 is to swap status TLV - refer to
  6085. * BUF_RING_CFG_0 defs within HW .h files,
  6086. * e.g. wmac_top_reg_seq_hwioreg.h
  6087. * b'25 - pkt_swap (PS): 1 is to swap packet TLV - refer to
  6088. * BUF_RING_CFG_0 defs within HW .h files,
  6089. * e.g. wmac_top_reg_seq_hwioreg.h
  6090. * b'26 - tx_mon_global_en: Enable/Disable global register
  6091. * configuration in Tx monitor module.
  6092. * b'27:31 - rsvd1: reserved for future use
  6093. * dword1 - b'0:15 - ring_buffer_size: size of bufferes referenced by rx ring,
  6094. * in byte units.
  6095. * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
  6096. * b'16:18 - config_length_mgmt(MGMT) for MGMT: Each bit set represent
  6097. * 64, 128, 256.
  6098. * If all 3 bits are set config length is > 256.
  6099. * if val is '0', then ignore this field.
  6100. * b'19:21 - config_length_ctrl(CTRL) for CTRL: Each bit set represent
  6101. * 64, 128, 256.
  6102. * If all 3 bits are set config length is > 256.
  6103. * if val is '0', then ignore this field.
  6104. * b'22:24 - config_length_data(DATA) for DATA: Each bit set represent
  6105. * 64, 128, 256.
  6106. * If all 3 bits are set config length is > 256.
  6107. * If val is '0', then ignore this field.
  6108. * - b'25:31 - rsvd2: Reserved for future use
  6109. * dword2 - b'0:2 - packet_type_enable_flags(E): MGMT, CTRL, DATA
  6110. * b'3 - filter_in_tx_mpdu_start_mgmt(MPSM):
  6111. * If packet_type_enable_flags is '1' for MGMT type,
  6112. * monitor will ignore this bit and allow this TLV.
  6113. * If packet_type_enable_flags is '0' for MGMT type,
  6114. * monitor will use this bit to enable/disable logging
  6115. * of this TLV.
  6116. * b'4 - filter_in_tx_mpdu_start_ctrl(MPSC)
  6117. * If packet_type_enable_flags is '1' for CTRL type,
  6118. * monitor will ignore this bit and allow this TLV.
  6119. * If packet_type_enable_flags is '0' for CTRL type,
  6120. * monitor will use this bit to enable/disable logging
  6121. * of this TLV.
  6122. * b'5 - filter_in_tx_mpdu_start_data(MPSD)
  6123. * If packet_type_enable_flags is '1' for DATA type,
  6124. * monitor will ignore this bit and allow this TLV.
  6125. * If packet_type_enable_flags is '0' for DATA type,
  6126. * monitor will use this bit to enable/disable logging
  6127. * of this TLV.
  6128. * b'6 - filter_in_tx_msdu_start_mgmt(MSSM)
  6129. * If packet_type_enable_flags is '1' for MGMT type,
  6130. * monitor will ignore this bit and allow this TLV.
  6131. * If packet_type_enable_flags is '0' for MGMT type,
  6132. * monitor will use this bit to enable/disable logging
  6133. * of this TLV.
  6134. * b'7 - filter_in_tx_msdu_start_ctrl(MSSC)
  6135. * If packet_type_enable_flags is '1' for CTRL type,
  6136. * monitor will ignore this bit and allow this TLV.
  6137. * If packet_type_enable_flags is '0' for CTRL type,
  6138. * monitor will use this bit to enable/disable logging
  6139. * of this TLV.
  6140. * b'8 - filter_in_tx_msdu_start_data(MSSD)
  6141. * If packet_type_enable_flags is '1' for DATA type,
  6142. * monitor will ignore this bit and allow this TLV.
  6143. * If packet_type_enable_flags is '0' for DATA type,
  6144. * monitor will use this bit to enable/disable logging
  6145. * of this TLV.
  6146. * b'9 - filter_in_tx_mpdu_end_mgmt(MPEM)
  6147. * If packet_type_enable_flags is '1' for MGMT type,
  6148. * monitor will ignore this bit and allow this TLV.
  6149. * If packet_type_enable_flags is '0' for MGMT type,
  6150. * monitor will use this bit to enable/disable logging
  6151. * of this TLV.
  6152. * If filter_in_TX_MPDU_START = 1 it is recommended
  6153. * to set this bit.
  6154. * b'10 - filter_in_tx_mpdu_end_ctrl(MPEC)
  6155. * If packet_type_enable_flags is '1' for CTRL type,
  6156. * monitor will ignore this bit and allow this TLV.
  6157. * If packet_type_enable_flags is '0' for CTRL type,
  6158. * monitor will use this bit to enable/disable logging
  6159. * of this TLV.
  6160. * If filter_in_TX_MPDU_START = 1 it is recommended
  6161. * to set this bit.
  6162. * b'11 - filter_in_tx_mpdu_end_data(MPED)
  6163. * If packet_type_enable_flags is '1' for DATA type,
  6164. * monitor will ignore this bit and allow this TLV.
  6165. * If packet_type_enable_flags is '0' for DATA type,
  6166. * monitor will use this bit to enable/disable logging
  6167. * of this TLV.
  6168. * If filter_in_TX_MPDU_START = 1 it is recommended
  6169. * to set this bit.
  6170. * b'12 - filter_in_tx_msdu_end_mgmt(MSEM)
  6171. * If packet_type_enable_flags is '1' for MGMT type,
  6172. * monitor will ignore this bit and allow this TLV.
  6173. * If packet_type_enable_flags is '0' for MGMT type,
  6174. * monitor will use this bit to enable/disable logging
  6175. * of this TLV.
  6176. * If filter_in_TX_MSDU_START = 1 it is recommended
  6177. * to set this bit.
  6178. * b'13 - filter_in_tx_msdu_end_ctrl(MSEC)
  6179. * If packet_type_enable_flags is '1' for CTRL type,
  6180. * monitor will ignore this bit and allow this TLV.
  6181. * If packet_type_enable_flags is '0' for CTRL type,
  6182. * monitor will use this bit to enable/disable logging
  6183. * of this TLV.
  6184. * If filter_in_TX_MSDU_START = 1 it is recommended
  6185. * to set this bit.
  6186. * b'14 - filter_in_tx_msdu_end_data(MSED)
  6187. * If packet_type_enable_flags is '1' for DATA type,
  6188. * monitor will ignore this bit and allow this TLV.
  6189. * If packet_type_enable_flags is '0' for DATA type,
  6190. * monitor will use this bit to enable/disable logging
  6191. * of this TLV.
  6192. * If filter_in_TX_MSDU_START = 1 it is recommended
  6193. * to set this bit.
  6194. * b'15:31 - rsvd3: Reserved for future use
  6195. * dword3 - b'0:31 - tlv_filter_mask_in0:
  6196. * dword4 - b'0:31 - tlv_filter_mask_in1:
  6197. * dword5 - b'0:31 - tlv_filter_mask_in2:
  6198. * dword6 - b'0:31 - tlv_filter_mask_in3:
  6199. * dword7 - b'0:7 - tx_fes_setup_word_mask:
  6200. * - b'8:15 - tx_peer_entry_word_mask:
  6201. * - b'16:23 - tx_queue_ext_word_mask:
  6202. * - b'24:31 - tx_msdu_start_word_mask:
  6203. * dword8 - b'0:31 - pcu_ppdu_setup_word_mask:
  6204. * dword9 - b'0:7 - tx_mpdu_start_word_mask:
  6205. * - b'8:15 - rxpcu_user_setup_word_mask:
  6206. * - b'16:18 - pkt_type_enable_msdu_or_mpdu_logging (PT):
  6207. * MGMT, CTRL, DATA
  6208. * - b'19 - dma_mpdu_mgmt(M): For MGMT
  6209. * 0 -> MSDU level logging is enabled
  6210. * (valid only if bit is set in
  6211. * pkt_type_enable_msdu_or_mpdu_logging)
  6212. * 1 -> MPDU level logging is enabled
  6213. * (valid only if bit is set in
  6214. * pkt_type_enable_msdu_or_mpdu_logging)
  6215. * - b'20 - dma_mpdu_ctrl(C) : For CTRL
  6216. * 0 -> MSDU level logging is enabled
  6217. * (valid only if bit is set in
  6218. * pkt_type_enable_msdu_or_mpdu_logging)
  6219. * 1 -> MPDU level logging is enabled
  6220. * (valid only if bit is set in
  6221. * pkt_type_enable_msdu_or_mpdu_logging)
  6222. * - b'21 - dma_mpdu_data(D) : For DATA
  6223. * 0 -> MSDU level logging is enabled
  6224. * (valid only if bit is set in
  6225. * pkt_type_enable_msdu_or_mpdu_logging)
  6226. * 1 -> MPDU level logging is enabled
  6227. * (valid only if bit is set in
  6228. * pkt_type_enable_msdu_or_mpdu_logging)
  6229. * - b'22:31 - rsvd4 for future use
  6230. */
  6231. PREPACK struct htt_tx_monitor_cfg_t {
  6232. A_UINT32 msg_type: 8,
  6233. pdev_id: 8,
  6234. ring_id: 8,
  6235. status_swap: 1,
  6236. pkt_swap: 1,
  6237. tx_mon_global_en: 1,
  6238. rsvd1: 5;
  6239. A_UINT32 ring_buffer_size: 16,
  6240. config_length_mgmt: 3,
  6241. config_length_ctrl: 3,
  6242. config_length_data: 3,
  6243. rsvd2: 7;
  6244. A_UINT32 pkt_type_enable_flags: 3,
  6245. filter_in_tx_mpdu_start_mgmt: 1,
  6246. filter_in_tx_mpdu_start_ctrl: 1,
  6247. filter_in_tx_mpdu_start_data: 1,
  6248. filter_in_tx_msdu_start_mgmt: 1,
  6249. filter_in_tx_msdu_start_ctrl: 1,
  6250. filter_in_tx_msdu_start_data: 1,
  6251. filter_in_tx_mpdu_end_mgmt: 1,
  6252. filter_in_tx_mpdu_end_ctrl: 1,
  6253. filter_in_tx_mpdu_end_data: 1,
  6254. filter_in_tx_msdu_end_mgmt: 1,
  6255. filter_in_tx_msdu_end_ctrl: 1,
  6256. filter_in_tx_msdu_end_data: 1,
  6257. rsvd3: 17;
  6258. A_UINT32 tlv_filter_mask_in0;
  6259. A_UINT32 tlv_filter_mask_in1;
  6260. A_UINT32 tlv_filter_mask_in2;
  6261. A_UINT32 tlv_filter_mask_in3;
  6262. A_UINT32 tx_fes_setup_word_mask: 8,
  6263. tx_peer_entry_word_mask: 8,
  6264. tx_queue_ext_word_mask: 8,
  6265. tx_msdu_start_word_mask: 8;
  6266. A_UINT32 pcu_ppdu_setup_word_mask;
  6267. A_UINT32 tx_mpdu_start_word_mask: 8,
  6268. rxpcu_user_setup_word_mask: 8,
  6269. pkt_type_enable_msdu_or_mpdu_logging: 3,
  6270. dma_mpdu_mgmt: 1,
  6271. dma_mpdu_ctrl: 1,
  6272. dma_mpdu_data: 1,
  6273. rsvd4: 10;
  6274. } POSTPACK;
  6275. #define HTT_TX_MONITOR_CFG_SZ (sizeof(struct htt_tx_monitor_cfg_t))
  6276. #define HTT_TX_MONITOR_CFG_PDEV_ID_M 0x0000ff00
  6277. #define HTT_TX_MONITOR_CFG_PDEV_ID_S 8
  6278. #define HTT_TX_MONITOR_CFG_PDEV_ID_GET(_var) \
  6279. (((_var) & HTT_TX_MONITOR_CFG_PDEV_ID_M) >> \
  6280. HTT_TX_MONITOR_CFG_PDEV_ID_S)
  6281. #define HTT_TX_MONITOR_CFG_PDEV_ID_SET(_var, _val) \
  6282. do { \
  6283. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PDEV_ID, _val); \
  6284. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PDEV_ID_S)); \
  6285. } while (0)
  6286. #define HTT_TX_MONITOR_CFG_RING_ID_M 0x00ff0000
  6287. #define HTT_TX_MONITOR_CFG_RING_ID_S 16
  6288. #define HTT_TX_MONITOR_CFG_RING_ID_GET(_var) \
  6289. (((_var) & HTT_TX_MONITOR_CFG_RING_ID_M) >> \
  6290. HTT_TX_MONITOR_CFG_RING_ID_S)
  6291. #define HTT_TX_MONITOR_CFG_RING_ID_SET(_var, _val) \
  6292. do { \
  6293. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_ID, _val); \
  6294. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_ID_S)); \
  6295. } while (0)
  6296. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_M 0x01000000
  6297. #define HTT_TX_MONITOR_CFG_STATUS_SWAP_S 24
  6298. #define HTT_TX_MONITOR_CFG_STATUS_TLV_GET(_var) \
  6299. (((_var) & HTT_TX_MONITOR_CFG_STATUS_SWAP_M) >> \
  6300. HTT_TX_MONITOR_CFG_STATUS_SWAP_S)
  6301. #define HTT_TX_MONITOR_CFG_STATUS_TLV_SET(_var, _val) \
  6302. do { \
  6303. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_STATUS_SWAP, _val); \
  6304. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_STATUS_SWAP_S)); \
  6305. } while (0)
  6306. #define HTT_TX_MONITOR_CFG_PKT_SWAP_M 0x02000000
  6307. #define HTT_TX_MONITOR_CFG_PKT_SWAP_S 25
  6308. #define HTT_TX_MONITOR_CFG_PKT_TLV_GET(_var) \
  6309. (((_var) & HTT_TX_MONITOR_CFG_PKT_SWAP_M) >> \
  6310. HTT_TX_MONITOR_CFG_PKT_SWAP_S)
  6311. #define HTT_TX_MONITOR_CFG_PKT_TLV_SET(_var, _val) \
  6312. do { \
  6313. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_SWAP, _val); \
  6314. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_SWAP_S)); \
  6315. } while (0)
  6316. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M 0x04000000
  6317. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S 26
  6318. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_GET(_var) \
  6319. (((_var) & HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_M) >> \
  6320. HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)
  6321. #define HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_SET(_var, _val) \
  6322. do { \
  6323. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN, _val); \
  6324. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MON_GLOBAL_EN_S)); \
  6325. } while (0)
  6326. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M 0x0000ffff
  6327. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S 0
  6328. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_GET(_var) \
  6329. (((_var) & HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_M) >> \
  6330. HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)
  6331. #define HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_SET(_var, _val) \
  6332. do { \
  6333. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE, _val); \
  6334. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RING_BUFFER_SIZE_S)); \
  6335. } while (0)
  6336. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M 0x00070000
  6337. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S 16
  6338. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_GET(_var) \
  6339. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_M) >> \
  6340. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)
  6341. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_SET(_var, _val) \
  6342. do { \
  6343. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT, _val); \
  6344. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_MGMT_S)); \
  6345. } while (0)
  6346. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M 0x00380000
  6347. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S 19
  6348. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_GET(_var) \
  6349. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_M) >> \
  6350. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)
  6351. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_SET(_var, _val) \
  6352. do { \
  6353. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL, _val); \
  6354. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_CTRL_S)); \
  6355. } while (0)
  6356. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M 0x01C00000
  6357. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S 22
  6358. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_GET(_var) \
  6359. (((_var) & HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_M) >> \
  6360. HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)
  6361. #define HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_SET(_var, _val) \
  6362. do { \
  6363. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA, _val); \
  6364. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_CONFIG_LENGTH_DATA_S)); \
  6365. } while (0)
  6366. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M 0x00000007
  6367. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S 0
  6368. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_GET(_var) \
  6369. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_M) >> \
  6370. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)
  6371. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_SET(_var, _val) \
  6372. do { \
  6373. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS, _val); \
  6374. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_S)); \
  6375. } while (0)
  6376. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M 0x00000008
  6377. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S 3
  6378. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_GET(_var) \
  6379. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_M) >> \
  6380. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)
  6381. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_SET(_var, _val) \
  6382. do { \
  6383. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT, _val); \
  6384. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_MGMT_S)); \
  6385. } while (0)
  6386. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M 0x00000010
  6387. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S 4
  6388. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_GET(_var) \
  6389. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_M) >> \
  6390. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)
  6391. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_SET(_var, _val) \
  6392. do { \
  6393. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL, _val); \
  6394. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_CTRL_S)); \
  6395. } while (0)
  6396. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M 0x00000020
  6397. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S 5
  6398. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_GET(_var) \
  6399. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_M) >> \
  6400. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)
  6401. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_SET(_var, _val) \
  6402. do { \
  6403. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA, _val); \
  6404. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_START_DATA_S)); \
  6405. } while (0)
  6406. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M 0x00000040
  6407. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S 6
  6408. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_GET(_var) \
  6409. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_M) >> \
  6410. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)
  6411. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_SET(_var, _val) \
  6412. do { \
  6413. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT, _val); \
  6414. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_MGMT_S)); \
  6415. } while (0)
  6416. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M 0x00000080
  6417. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S 7
  6418. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_GET(_var) \
  6419. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_M) >> \
  6420. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)
  6421. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_SET(_var, _val) \
  6422. do { \
  6423. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL, _val); \
  6424. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_CTRL_S)); \
  6425. } while (0)
  6426. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M 0x00000100
  6427. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S 8
  6428. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_GET(_var) \
  6429. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_M) >> \
  6430. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)
  6431. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_SET(_var, _val) \
  6432. do { \
  6433. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA, _val); \
  6434. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_START_DATA_S)); \
  6435. } while (0)
  6436. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M 0x00000200
  6437. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S 9
  6438. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_GET(_var) \
  6439. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_M) >> \
  6440. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)
  6441. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_SET(_var, _val) \
  6442. do { \
  6443. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT, _val); \
  6444. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_MGMT_S)); \
  6445. } while (0)
  6446. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M 0x00000400
  6447. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S 10
  6448. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_GET(_var) \
  6449. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_M) >> \
  6450. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)
  6451. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_SET(_var, _val) \
  6452. do { \
  6453. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL, _val); \
  6454. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_CTRL_S)); \
  6455. } while (0)
  6456. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M 0x00000800
  6457. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S 11
  6458. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_GET(_var) \
  6459. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_M) >> \
  6460. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)
  6461. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_SET(_var, _val) \
  6462. do { \
  6463. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA, _val); \
  6464. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MPDU_END_DATA_S)); \
  6465. } while (0)
  6466. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M 0x00001000
  6467. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S 12
  6468. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_GET(_var) \
  6469. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_M) >> \
  6470. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)
  6471. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_SET(_var, _val) \
  6472. do { \
  6473. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT, _val); \
  6474. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_MGMT_S)); \
  6475. } while (0)
  6476. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M 0x00002000
  6477. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S 13
  6478. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_GET(_var) \
  6479. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_M) >> \
  6480. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)
  6481. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_SET(_var, _val) \
  6482. do { \
  6483. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL, _val); \
  6484. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_CTRL_S)); \
  6485. } while (0)
  6486. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M 0x00004000
  6487. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S 14
  6488. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_GET(_var) \
  6489. (((_var) & HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_M) >> \
  6490. HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)
  6491. #define HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_SET(_var, _val) \
  6492. do { \
  6493. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA, _val); \
  6494. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_FILTER_IN_TX_MSDU_END_DATA_S)); \
  6495. } while (0)
  6496. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M 0xffffffff
  6497. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S 0
  6498. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_GET(_var) \
  6499. (((_var) & HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_M) >> \
  6500. HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)
  6501. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_SET(_var, _val) \
  6502. do { \
  6503. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TLV_FILTER_MASK, _val); \
  6504. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_S)); \
  6505. } while (0)
  6506. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M 0x000000ff
  6507. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S 0
  6508. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_GET(_var) \
  6509. (((_var) & HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_M) >> \
  6510. HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)
  6511. #define HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_SET(_var, _val) \
  6512. do { \
  6513. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK, _val); \
  6514. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_FES_SETUP_WORD_MASK_S)); \
  6515. } while (0)
  6516. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M 0x0000ff00
  6517. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S 8
  6518. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_GET(_var) \
  6519. (((_var) & HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_M) >> \
  6520. HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)
  6521. #define HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_SET(_var, _val) \
  6522. do { \
  6523. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK, _val); \
  6524. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_PEER_ENTRY_WORD_MASK_S)); \
  6525. } while (0)
  6526. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M 0x00ff0000
  6527. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S 16
  6528. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_GET(_var) \
  6529. (((_var) & HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_M) >> \
  6530. HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)
  6531. #define HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_SET(_var, _val) \
  6532. do { \
  6533. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK, _val); \
  6534. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_QUEUE_EXT_WORD_MASK_S)); \
  6535. } while (0)
  6536. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M 0xff000000
  6537. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S 24
  6538. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_GET(_var) \
  6539. (((_var) & HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_M) >> \
  6540. HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)
  6541. #define HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_SET(_var, _val) \
  6542. do { \
  6543. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK, _val); \
  6544. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MSDU_START_WORD_MASK_S)); \
  6545. } while (0)
  6546. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M 0xffffffff
  6547. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S 0
  6548. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_GET(_var) \
  6549. (((_var) & HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_M) >> \
  6550. HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)
  6551. #define HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_SET(_var, _val) \
  6552. do { \
  6553. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK, _val); \
  6554. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PCU_PPDU_SETUP_WORD_MASK_S)); \
  6555. } while (0)
  6556. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M 0x000000ff
  6557. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S 0
  6558. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_GET(_var) \
  6559. (((_var) & HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_M) >> \
  6560. HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)
  6561. #define HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_SET(_var, _val) \
  6562. do { \
  6563. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK, _val); \
  6564. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_TX_MPDU_START_WORD_MASK_S)); \
  6565. } while (0)
  6566. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M 0x0000ff00
  6567. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S 8
  6568. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_GET(_var) \
  6569. (((_var) & HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_M) >> \
  6570. HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)
  6571. #define HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_SET(_var, _val) \
  6572. do { \
  6573. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK, _val); \
  6574. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_RXPCU_USER_SETUP_WORD_MASK_S)); \
  6575. } while (0)
  6576. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M 0x00070000
  6577. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S 16
  6578. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_GET(_var) \
  6579. (((_var) & HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_M) >> \
  6580. HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)
  6581. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_SET(_var, _val) \
  6582. do { \
  6583. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK, _val); \
  6584. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MASK_S)); \
  6585. } while (0)
  6586. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M 0x00080000
  6587. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S 19
  6588. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_GET(_var) \
  6589. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_M) >> \
  6590. HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)
  6591. #define HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_SET(_var, _val) \
  6592. do { \
  6593. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT, _val); \
  6594. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_MGMT_S)); \
  6595. } while (0)
  6596. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M 0x00100000
  6597. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S 20
  6598. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_GET(_var) \
  6599. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_M) >> \
  6600. HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)
  6601. #define HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_SET(_var, _val) \
  6602. do { \
  6603. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL, _val); \
  6604. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_CTRL_S)); \
  6605. } while (0)
  6606. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M 0x00200000
  6607. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S 21
  6608. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_GET(_var) \
  6609. (((_var) & HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_M) >> \
  6610. HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)
  6611. #define HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_SET(_var, _val) \
  6612. do { \
  6613. HTT_CHECK_SET_VAL(HTT_TX_MONITOR_CFG_DMA_MPDU_DATA, _val); \
  6614. ((_var) |= ((_val) << HTT_TX_MONITOR_CFG_DMA_MPDU_DATA_S)); \
  6615. } while (0)
  6616. /*
  6617. * pkt_type_enable_flags
  6618. */
  6619. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_M 0x00000001
  6620. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_MGMT_S 0
  6621. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_M 0x00000002
  6622. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_CTRL_S 1
  6623. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_M 0x00000004
  6624. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_FLAGS_DATA_S 2
  6625. /*
  6626. * PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING
  6627. */
  6628. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_M 0x00010000
  6629. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_MGMT_S 16
  6630. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_M 0x00020000
  6631. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_CTRL_S 17
  6632. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_M 0x00040000
  6633. #define HTT_TX_MONITOR_CFG_PKT_TYPE_ENABLE_MSDU_OR_MPDU_LOGGING_DATA_S 18
  6634. #define HTT_TX_MONITOR_CFG_PKT_TYPE_SET(word, httsym, value) \
  6635. do { \
  6636. HTT_CHECK_SET_VAL(httsym, value); \
  6637. (word) |= (value) << httsym##_S; \
  6638. } while (0)
  6639. #define HTT_TX_MONITOR_CFG_PKT_TYPE_GET(word, httsym) \
  6640. (((word) & httsym##_M) >> httsym##_S)
  6641. /* mode -> ENABLE_FLAGS, ENABLE_MSDU_OR_MPDU_LOGGING
  6642. * type -> MGMT, CTRL, DATA*/
  6643. #define htt_tx_ring_pkt_type_set( \
  6644. word, mode, type, val) \
  6645. HTT_TX_MONITOR_CFG_PKT_TYPE_SET( \
  6646. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type, val)
  6647. #define htt_tx_ring_pkt_type_get( \
  6648. word, mode, type) \
  6649. HTT_TX_MONITOR_CFG_PKT_TYPE_GET( \
  6650. word, HTT_TX_MONITOR_CFG_PKT_TYPE_##mode##_##type)
  6651. /* Definition to filter in TLVs */
  6652. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_M 0x00000001
  6653. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_S 0
  6654. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_M 0x00000002
  6655. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_PEER_ENTRY_S 1
  6656. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_M 0x00000004
  6657. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_QUEUE_EXTENSION_S 2
  6658. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_M 0x00000008
  6659. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_END_S 3
  6660. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_M 0x00000010
  6661. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LAST_MPDU_FETCHED_S 4
  6662. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_M 0x00000020
  6663. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_DATA_SYNC_S 5
  6664. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_M 0x00000040
  6665. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_PCU_PPDU_SETUP_INIT_S 6
  6666. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_M 0x00000080
  6667. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_FW2SW_MON_S 7
  6668. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_M 0x00000100
  6669. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_LOOPBACK_SETUP_S 8
  6670. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_M 0x00000200
  6671. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_CRITICAL_TLV_REFERENCE_S 9
  6672. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_M 0x00000400
  6673. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_NDP_PREAMBLE_DONE_S 10
  6674. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_M 0x00000800
  6675. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_RAW_OR_NATIVE_FRAME_SETUP_S 11
  6676. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_M 0x00001000
  6677. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TXPCU_USER_SETUP_S 12
  6678. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_M 0x00002000
  6679. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_S 13
  6680. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_M 0x00004000
  6681. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_SETUP_COMPLETE_S 14
  6682. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_M 0x00008000
  6683. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_COEX_TX_REQ_S 15
  6684. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_M 0x00010000
  6685. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_S 16
  6686. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_M 0x00020000
  6687. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_RXPCU_USER_SETUP_EXT_S 17
  6688. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_M 0x00040000
  6689. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_WUR_DATA_S 18
  6690. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_M 0x00080000
  6691. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TQM_MPDU_GLOBAL_START_S 19
  6692. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_M 0x00100000
  6693. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_TX_FES_SETUP_COMPLETE_S 20
  6694. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_M 0x00200000
  6695. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCHEDULER_END_S 21
  6696. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_M 0x00400000
  6697. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_SCH_WAIT_INSTR_TX_PATH_S 22
  6698. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_M 0x00800000
  6699. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_S 23
  6700. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_M 0x01000000
  6701. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PUNC_S 24
  6702. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_M 0x02000000
  6703. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_COMMON_PER_BW_S 25
  6704. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_M 0x04000000
  6705. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_S 26
  6706. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_M 0x08000000
  6707. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PUNC_S 27
  6708. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_M 0x10000000
  6709. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MACTX_MU_UPLINK_USER_SETUP_PER_BW_S 28
  6710. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_M 0x20000000
  6711. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_MPDU_QUEUE_OVERVIEW_S 29
  6712. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_M 0x40000000
  6713. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_COMMON_S 30
  6714. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_M 0x80000000
  6715. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_BF_PARAMS_PER_USER_S 31
  6716. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET(word, httsym, enable) \
  6717. do { \
  6718. HTT_CHECK_SET_VAL(httsym, enable); \
  6719. (word) |= (enable) << httsym##_S; \
  6720. } while (0)
  6721. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET(word, httsym) \
  6722. (((word) & httsym##_M) >> httsym##_S)
  6723. #define htt_tx_monitor_tlv_filter_in0_enable_set(word, tlv, enable) \
  6724. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_SET( \
  6725. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv, enable)
  6726. #define htt_tx_monitor_tlv_filter_in0_enable_get(word, tlv) \
  6727. HTT_TX_MONITOR_TLV_FILTER_MASK_IN0_GET( \
  6728. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN0_##tlv)
  6729. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_M 0x00000001
  6730. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_RESPONSE_REQUIRED_INFO_S 0
  6731. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_M 0x00000002
  6732. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_START_STATUS_S 1
  6733. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_M 0x00000004
  6734. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RESPONSE_END_STATUS_S 2
  6735. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_M 0x00000008
  6736. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_S 3
  6737. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_M 0x00000010
  6738. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_END_S 4
  6739. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_M 0x00000020
  6740. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PPDU_S 5
  6741. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_M 0x00000040
  6742. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_PPDU_S 6
  6743. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_M 0x00000080
  6744. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_ACK_OR_BA_S 7
  6745. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_M 0x00000100
  6746. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_1K_BA_S 8
  6747. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_M 0x00000200
  6748. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_START_PROT_S 9
  6749. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_M 0x00000400
  6750. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_PROT_S 10
  6751. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_M 0x00000800
  6752. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TX_FES_STATUS_USER_RESPONSE_S 11
  6753. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_M 0x00001000
  6754. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_BITMAP_ACK_S 12
  6755. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_M 0x00002000
  6756. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RX_FRAME_1K_BITMAP_ACK_S 13
  6757. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_M 0x00004000
  6758. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_COEX_TX_STATUS_S 14
  6759. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_M 0x00008000
  6760. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_S 15
  6761. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_M 0x00010000
  6762. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_RESPONSE_INFO_PART2_S 16
  6763. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_M 0x00020000
  6764. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_OFDMA_TRIGGER_DETAILS_S 17
  6765. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_M 0x00040000
  6766. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_RECEIVED_TRIGGER_INFO_S 18
  6767. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_M 0x00080000
  6768. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TX_REQUEST_S 19
  6769. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_M 0x00100000
  6770. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_RESPONSE_S 20
  6771. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_M 0x00200000
  6772. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PDG_TRIG_RESPONSE_S 21
  6773. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_M 0x00400000
  6774. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_TRIGGER_RESPONSE_TX_DONE_S 22
  6775. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_M 0x00800000
  6776. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PROT_TX_END_S 23
  6777. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_M 0x01000000
  6778. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_PPDU_TX_END_S 24
  6779. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_M 0x02000000
  6780. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_R2R_STATUS_END_S 25
  6781. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_M 0x04000000
  6782. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_FLUSH_REQ_S 26
  6783. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_M 0x08000000
  6784. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_PHY_DESC_S 27
  6785. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_M 0x10000000
  6786. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_COMMON_S 28
  6787. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_M 0x20000000
  6788. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_MACTX_USER_DESC_PER_USER_S 29
  6789. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_M 0x40000000
  6790. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_A_S 30
  6791. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_M 0x80000000
  6792. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_L_SIG_B_S 31
  6793. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET(word, httsym, enable) \
  6794. do { \
  6795. HTT_CHECK_SET_VAL(httsym, enable); \
  6796. (word) |= (enable) << httsym##_S; \
  6797. } while (0)
  6798. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET(word, httsym) \
  6799. (((word) & httsym##_M) >> httsym##_S)
  6800. #define htt_tx_monitor_tlv_filter_in1_enable_set(word, tlv, enable) \
  6801. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_SET( \
  6802. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv, enable)
  6803. #define htt_tx_monitor_tlv_filter_in1_enable_get(word, tlv) \
  6804. HTT_TX_MONITOR_TLV_FILTER_MASK_IN1_GET( \
  6805. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN1_##tlv)
  6806. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_M 0x00000001
  6807. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HT_SIG_S 0
  6808. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_M 0x00000002
  6809. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_A_S 1
  6810. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_M 0x00000004
  6811. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU20_S 2
  6812. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_M 0x00000008
  6813. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU40_S 3
  6814. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_M 0x00000010
  6815. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU80_S 4
  6816. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_M 0x00000020
  6817. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_SU160_S 5
  6818. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_M 0x00000040
  6819. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU20_S 6
  6820. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_M 0x00000080
  6821. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU40_S 7
  6822. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_M 0x00000100
  6823. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU80_S 8
  6824. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_M 0x00000200
  6825. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_VHT_SIG_B_MU160_S 9
  6826. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_M 0x00000400
  6827. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_SERVICE_S 10
  6828. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_M 0x00000800
  6829. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_SU_S 11
  6830. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_M 0x00001000
  6831. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_DL_S 12
  6832. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_M 0x00002000
  6833. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_A_MU_UL_S 13
  6834. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_M 0x00004000
  6835. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B1_MU_S 14
  6836. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_M 0x00008000
  6837. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_MU_S 15
  6838. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_M 0x00010000
  6839. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_HE_SIG_B2_OFDMA_S 16
  6840. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_M 0x00020000
  6841. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_MU_S 17
  6842. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_M 0x00040000
  6843. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_SU_S 18
  6844. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_M 0x00080000
  6845. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_U_SIG_EHT_TB_S 19
  6846. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_M 0x00100000
  6847. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_SU_S 20
  6848. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_M 0x00200000
  6849. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_MU_MIMO_S 21
  6850. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_M 0x00400000
  6851. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EHT_SIG_USR_OFDMA_S 22
  6852. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_M 0x00800000
  6853. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_PHYTX_PPDU_HEADER_INFO_REQUEST_S 23
  6854. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_M 0x01000000
  6855. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_UPDATE_TX_MPDU_COUNT_S 24
  6856. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_M 0x02000000
  6857. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_MPDU_S 25
  6858. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_M 0x04000000
  6859. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TQM_ACKED_1K_MPDU_S 26
  6860. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_M 0x08000000
  6861. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_BUFFER_STATUS_S 27
  6862. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_M 0x10000000
  6863. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXPCU_USER_BUFFER_STATUS_S 28
  6864. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_M 0x20000000
  6865. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TXDMA_STOP_REQUEST_S 29
  6866. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_M 0x40000000
  6867. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_EXPECTED_RESPONSE_S 30
  6868. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_M 0x80000000
  6869. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_TX_MPDU_COUNT_TRANSFER_END_S 31
  6870. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET(word, httsym, enable) \
  6871. do { \
  6872. HTT_CHECK_SET_VAL(httsym, enable); \
  6873. (word) |= (enable) << httsym##_S; \
  6874. } while (0)
  6875. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET(word, httsym) \
  6876. (((word) & httsym##_M) >> httsym##_S)
  6877. #define htt_tx_monitor_tlv_filter_in2_enable_set(word, tlv, enable) \
  6878. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_SET( \
  6879. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv, enable)
  6880. #define htt_tx_monitor_tlv_filter_in2_enable_get(word, tlv) \
  6881. HTT_TX_MONITOR_TLV_FILTER_MASK_IN2_GET( \
  6882. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN2_##tlv)
  6883. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_M 0x00000001
  6884. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_TRIG_INFO_S 0
  6885. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_M 0x00000002
  6886. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_TX_SETUP_CLEAR_S 1
  6887. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_M 0x00000004
  6888. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_FRAME_BITMAP_REQ_S 2
  6889. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_M 0x00000008
  6890. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PHY_SLEEP_S 3
  6891. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_M 0x00000010
  6892. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PREAMBLE_DONE_S 4
  6893. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_M 0x00000020
  6894. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_DEBUG32_S 5
  6895. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_M 0x00000040
  6896. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TXPCU_PHYTX_OTHER_TRANSMIT_INFO32_S 6
  6897. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_M 0x00000080
  6898. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_NO_ACK_REPORT_S 7
  6899. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_M 0x00000100
  6900. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PPDU_ACK_REPORT_S 8
  6901. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_M 0x00000200
  6902. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_COEX_RX_STATUS_S 9
  6903. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_M 0x00000400
  6904. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_START_PARAM_S 10
  6905. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_M 0x00000800
  6906. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_TX_CBF_INFO_S 11
  6907. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_M 0x00001000
  6908. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RXPCU_EARLY_RX_INDICATION_S 12
  6909. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_M 0x00002000
  6910. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_7_0_S 13
  6911. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_M 0x00004000
  6912. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_15_8_S 14
  6913. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_M 0x00008000
  6914. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_23_16_S 15
  6915. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_M 0x00010000
  6916. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_31_24_S 16
  6917. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_M 0x00020000
  6918. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RECEIVED_RESPONSE_USER_36_32_S 17
  6919. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_M 0x00040000
  6920. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PM_INFO_S 18
  6921. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_M 0x00080000
  6922. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_RX_PREAMBLE_S 19
  6923. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_M 0x00100000
  6924. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_OTHERS_S 20
  6925. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_M 0x00200000
  6926. #define HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_MACTX_PRE_PHY_DESC_S 21
  6927. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET(word, httsym, enable) \
  6928. do { \
  6929. HTT_CHECK_SET_VAL(httsym, enable); \
  6930. (word) |= (enable) << httsym##_S; \
  6931. } while (0)
  6932. #define HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET(word, httsym) \
  6933. (((word) & httsym##_M) >> httsym##_S)
  6934. #define htt_tx_monitor_tlv_filter_in3_enable_set(word, tlv, enable) \
  6935. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_SET( \
  6936. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv, enable)
  6937. #define htt_tx_monitor_tlv_filter_in3_enable_get(word, tlv) \
  6938. HTT_TX_MONITOR_TLV_FILTER_MASK_IN3_GET( \
  6939. word, HTT_TX_MONITOR_CFG_TLV_FILTER_MASK_IN3_##tlv)
  6940. /**
  6941. * @brief host --> target Receive Flow Steering configuration message definition
  6942. *
  6943. * MSG_TYPE => HTT_H2T_MSG_TYPE_RFS_CONFIG
  6944. *
  6945. * host --> target Receive Flow Steering configuration message definition.
  6946. * Host must send this message before sending HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6947. * The reason for this is we want RFS to be configured and ready before MAC
  6948. * remote ring is enabled via HTT_H2T_MSG_TYPE_RX_RING_CFG.
  6949. *
  6950. * |31 24|23 16|15 9|8|7 0|
  6951. * |----------------+----------------+----------------+----------------|
  6952. * | reserved |E| msg type |
  6953. * |-------------------------------------------------------------------|
  6954. * Where E = RFS enable flag
  6955. *
  6956. * The RFS_CONFIG message consists of a single 4-byte word.
  6957. *
  6958. * Header fields:
  6959. * - MSG_TYPE
  6960. * Bits 7:0
  6961. * Purpose: identifies this as a RFS config msg
  6962. * Value: 0xf (HTT_H2T_MSG_TYPE_RFS_CONFIG)
  6963. * - RFS_CONFIG
  6964. * Bit 8
  6965. * Purpose: Tells target whether to enable (1) or disable (0)
  6966. * flow steering feature when sending rx indication messages to host
  6967. */
  6968. #define HTT_H2T_RFS_CONFIG_M 0x100
  6969. #define HTT_H2T_RFS_CONFIG_S 8
  6970. #define HTT_RX_RFS_CONFIG_GET(_var) \
  6971. (((_var) & HTT_H2T_RFS_CONFIG_M) >> \
  6972. HTT_H2T_RFS_CONFIG_S)
  6973. #define HTT_RX_RFS_CONFIG_SET(_var, _val) \
  6974. do { \
  6975. HTT_CHECK_SET_VAL(HTT_H2T_RFS_CONFIG, _val); \
  6976. ((_var) |= ((_val) << HTT_H2T_RFS_CONFIG_S)); \
  6977. } while (0)
  6978. #define HTT_RFS_CFG_REQ_BYTES 4
  6979. /**
  6980. * @brief host -> target FW extended statistics request
  6981. *
  6982. * MSG_TYPE => HTT_H2T_MSG_TYPE_EXT_STATS_REQ
  6983. *
  6984. * @details
  6985. * The following field definitions describe the format of the HTT host
  6986. * to target FW extended stats retrieve message.
  6987. * The message specifies the type of stats the host wants to retrieve.
  6988. *
  6989. * |31 24|23 16|15 8|7 0|
  6990. * |-----------------------------------------------------------|
  6991. * | reserved | stats type | pdev_mask | msg type |
  6992. * |-----------------------------------------------------------|
  6993. * | config param [0] |
  6994. * |-----------------------------------------------------------|
  6995. * | config param [1] |
  6996. * |-----------------------------------------------------------|
  6997. * | config param [2] |
  6998. * |-----------------------------------------------------------|
  6999. * | config param [3] |
  7000. * |-----------------------------------------------------------|
  7001. * | reserved |
  7002. * |-----------------------------------------------------------|
  7003. * | cookie LSBs |
  7004. * |-----------------------------------------------------------|
  7005. * | cookie MSBs |
  7006. * |-----------------------------------------------------------|
  7007. * Header fields:
  7008. * - MSG_TYPE
  7009. * Bits 7:0
  7010. * Purpose: identifies this is a extended stats upload request message
  7011. * Value: 0x10 (HTT_H2T_MSG_TYPE_EXT_STATS_REQ)
  7012. * - PDEV_MASK
  7013. * Bits 8:15
  7014. * Purpose: identifies the mask of PDEVs to retrieve stats from
  7015. * Value: This is a overloaded field, refer to usage and interpretation of
  7016. * PDEV in interface document.
  7017. * Bit 8 : Reserved for SOC stats
  7018. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7019. * Indicates MACID_MASK in DBS
  7020. * - STATS_TYPE
  7021. * Bits 23:16
  7022. * Purpose: identifies which FW statistics to upload
  7023. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7024. * - Reserved
  7025. * Bits 31:24
  7026. * - CONFIG_PARAM [0]
  7027. * Bits 31:0
  7028. * Purpose: give an opaque configuration value to the specified stats type
  7029. * Value: stats-type specific configuration value
  7030. * Refer to htt_stats.h for interpretation for each stats sub_type
  7031. * - CONFIG_PARAM [1]
  7032. * Bits 31:0
  7033. * Purpose: give an opaque configuration value to the specified stats type
  7034. * Value: stats-type specific configuration value
  7035. * Refer to htt_stats.h for interpretation for each stats sub_type
  7036. * - CONFIG_PARAM [2]
  7037. * Bits 31:0
  7038. * Purpose: give an opaque configuration value to the specified stats type
  7039. * Value: stats-type specific configuration value
  7040. * Refer to htt_stats.h for interpretation for each stats sub_type
  7041. * - CONFIG_PARAM [3]
  7042. * Bits 31:0
  7043. * Purpose: give an opaque configuration value to the specified stats type
  7044. * Value: stats-type specific configuration value
  7045. * Refer to htt_stats.h for interpretation for each stats sub_type
  7046. * - Reserved [31:0] for future use.
  7047. * - COOKIE_LSBS
  7048. * Bits 31:0
  7049. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7050. * message with its preceding host->target stats request message.
  7051. * Value: LSBs of the opaque cookie specified by the host-side requestor
  7052. * - COOKIE_MSBS
  7053. * Bits 31:0
  7054. * Purpose: Provide a mechanism to match a target->host stats confirmation
  7055. * message with its preceding host->target stats request message.
  7056. * Value: MSBs of the opaque cookie specified by the host-side requestor
  7057. */
  7058. #define HTT_H2T_EXT_STATS_REQ_MSG_SZ 32 /* bytes */
  7059. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M 0x0000ff00
  7060. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S 8
  7061. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7062. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S 16
  7063. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M 0xffffffff
  7064. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S 0
  7065. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_GET(_var) \
  7066. (((_var) & HTT_H2T_EXT_STATS_REQ_PDEV_MASK_M) >> \
  7067. HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)
  7068. #define HTT_H2T_EXT_STATS_REQ_PDEV_MASK_SET(_var, _val) \
  7069. do { \
  7070. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_PDEV_MASK, _val); \
  7071. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_PDEV_MASK_S)); \
  7072. } while (0)
  7073. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_GET(_var) \
  7074. (((_var) & HTT_H2T_EXT_STATS_REQ_STATS_TYPE_M) >> \
  7075. HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)
  7076. #define HTT_H2T_EXT_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7077. do { \
  7078. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_STATS_TYPE, _val); \
  7079. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_STATS_TYPE_S)); \
  7080. } while (0)
  7081. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_GET(_var) \
  7082. (((_var) & HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_M) >> \
  7083. HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)
  7084. #define HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_SET(_var, _val) \
  7085. do { \
  7086. HTT_CHECK_SET_VAL(HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM, _val); \
  7087. ((_var) |= ((_val) << HTT_H2T_EXT_STATS_REQ_CONFIG_PARAM_S)); \
  7088. } while (0)
  7089. /**
  7090. * @brief host -> target FW streaming statistics request
  7091. *
  7092. * MSG_TYPE => HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ
  7093. *
  7094. * @details
  7095. * The following field definitions describe the format of the HTT host
  7096. * to target message that requests the target to start or stop producing
  7097. * ongoing stats of the specified type.
  7098. *
  7099. * |31|30 |23 16|15 8|7 0|
  7100. * |-----------------------------------------------------------|
  7101. * |EN| reserved | stats type | reserved | msg type |
  7102. * |-----------------------------------------------------------|
  7103. * | config param [0] |
  7104. * |-----------------------------------------------------------|
  7105. * | config param [1] |
  7106. * |-----------------------------------------------------------|
  7107. * | config param [2] |
  7108. * |-----------------------------------------------------------|
  7109. * | config param [3] |
  7110. * |-----------------------------------------------------------|
  7111. * Where:
  7112. * - EN is an enable/disable flag
  7113. * Header fields:
  7114. * - MSG_TYPE
  7115. * Bits 7:0
  7116. * Purpose: identifies this is a streaming stats upload request message
  7117. * Value: 0x20 (HTT_H2T_MSG_TYPE_STREAMING_STATS_REQ)
  7118. * - STATS_TYPE
  7119. * Bits 23:16
  7120. * Purpose: identifies which FW statistics to upload
  7121. * Value: Defined by htt_dbg_ext_stats_type (see htt_stats.h)
  7122. * Only the htt_dbg_ext_stats_type values identified as streaming
  7123. * stats are valid to specify in this STEAMING_STATS_REQ message.
  7124. * - ENABLE
  7125. * Bit 31
  7126. * Purpose: enable/disable the target's ongoing stats of the specified type
  7127. * Value:
  7128. * 0 - disable ongoing production of the specified stats type
  7129. * 1 - enable ongoing production of the specified stats type
  7130. * - CONFIG_PARAM [0]
  7131. * Bits 31:0
  7132. * Purpose: give an opaque configuration value to the specified stats type
  7133. * Value: stats-type specific configuration value
  7134. * Refer to htt_stats.h for interpretation for each stats sub_type
  7135. * - CONFIG_PARAM [1]
  7136. * Bits 31:0
  7137. * Purpose: give an opaque configuration value to the specified stats type
  7138. * Value: stats-type specific configuration value
  7139. * Refer to htt_stats.h for interpretation for each stats sub_type
  7140. * - CONFIG_PARAM [2]
  7141. * Bits 31:0
  7142. * Purpose: give an opaque configuration value to the specified stats type
  7143. * Value: stats-type specific configuration value
  7144. * Refer to htt_stats.h for interpretation for each stats sub_type
  7145. * - CONFIG_PARAM [3]
  7146. * Bits 31:0
  7147. * Purpose: give an opaque configuration value to the specified stats type
  7148. * Value: stats-type specific configuration value
  7149. * Refer to htt_stats.h for interpretation for each stats sub_type
  7150. */
  7151. #define HTT_H2T_STREAMING_STATS_REQ_MSG_SZ 20 /* bytes */
  7152. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M 0x00ff0000
  7153. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S 16
  7154. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_M 0x80000000
  7155. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_S 31
  7156. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_GET(_var) \
  7157. (((_var) & HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_M) >> \
  7158. HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)
  7159. #define HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_SET(_var, _val) \
  7160. do { \
  7161. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE, _val); \
  7162. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_STATS_TYPE_S)); \
  7163. } while (0)
  7164. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_GET(_var) \
  7165. (((_var) & HTT_H2T_STREAMING_STATS_REQ_ENABLE_M) >> \
  7166. HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)
  7167. #define HTT_H2T_STREAMING_STATS_REQ_ENABLE_SET(_var, _val) \
  7168. do { \
  7169. HTT_CHECK_SET_VAL(HTT_H2T_STREAMING_STATS_REQ_ENABLE, _val); \
  7170. ((_var) |= ((_val) << HTT_H2T_STREAMING_STATS_REQ_ENABLE_S)); \
  7171. } while (0)
  7172. /**
  7173. * @brief host -> target FW PPDU_STATS request message
  7174. *
  7175. * MSG_TYPE => HTT_H2T_MSG_TYPE_PPDU_STATS_CFG
  7176. *
  7177. * @details
  7178. * The following field definitions describe the format of the HTT host
  7179. * to target FW for PPDU_STATS_CFG msg.
  7180. * The message allows the host to configure the PPDU_STATS_IND messages
  7181. * produced by the target.
  7182. *
  7183. * |31 24|23 16|15 8|7 0|
  7184. * |-----------------------------------------------------------|
  7185. * | REQ bit mask | pdev_mask | msg type |
  7186. * |-----------------------------------------------------------|
  7187. * Header fields:
  7188. * - MSG_TYPE
  7189. * Bits 7:0
  7190. * Purpose: identifies this is a req to configure ppdu_stats_ind from target
  7191. * Value: 0x11 (HTT_H2T_MSG_TYPE_PPDU_STATS_CFG)
  7192. * - PDEV_MASK
  7193. * Bits 8:15
  7194. * Purpose: identifies which pdevs this PPDU stats configuration applies to
  7195. * Value: This is a overloaded field, refer to usage and interpretation of
  7196. * PDEV in interface document.
  7197. * Bit 8 : Reserved for SOC stats
  7198. * Bit 9 - 15 : Indicates PDEV_MASK in DBDC
  7199. * Indicates MACID_MASK in DBS
  7200. * - REQ_TLV_BIT_MASK
  7201. * Bits 16:31
  7202. * Purpose: each set bit indicates the corresponding PPDU stats TLV type
  7203. * needs to be included in the target's PPDU_STATS_IND messages.
  7204. * Value: refer htt_ppdu_stats_tlv_tag_t
  7205. *
  7206. */
  7207. #define HTT_H2T_PPDU_STATS_CFG_MSG_SZ 4 /* bytes */
  7208. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M 0x0000ff00
  7209. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S 8
  7210. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M 0xffff0000
  7211. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S 16
  7212. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_GET(_var) \
  7213. (((_var) & HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_M) >> \
  7214. HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)
  7215. #define HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_SET(_var, _val) \
  7216. do { \
  7217. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_PDEV_MASK, _val); \
  7218. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_PDEV_MASK_S)); \
  7219. } while (0)
  7220. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_GET(_var) \
  7221. (((_var) & HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_M) >> \
  7222. HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)
  7223. #define HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_SET(_var, _val) \
  7224. do { \
  7225. HTT_CHECK_SET_VAL(HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK, _val); \
  7226. ((_var) |= ((_val) << HTT_H2T_PPDU_STATS_CFG_TLV_BITMASK_S)); \
  7227. } while (0)
  7228. /**
  7229. * @brief Host-->target HTT RX FSE setup message
  7230. *
  7231. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG
  7232. *
  7233. * @details
  7234. * Through this message, the host will provide details of the flow tables
  7235. * in host DDR along with hash keys.
  7236. * This message can be sent per SOC or per PDEV, which is differentiated
  7237. * by pdev id values.
  7238. * The host will allocate flow search table and sends table size,
  7239. * physical DMA address of flow table, and hash keys to firmware to
  7240. * program into the RXOLE FSE HW block.
  7241. *
  7242. * The following field definitions describe the format of the RX FSE setup
  7243. * message sent from the host to target
  7244. *
  7245. * Header fields:
  7246. * dword0 - b'7:0 - msg_type: This will be set to
  7247. * 0x12 (HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG)
  7248. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7249. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7250. * pdev's LMAC ring.
  7251. * b'31:16 - reserved : Reserved for future use
  7252. * dword1 - b'19:0 - number of records: This field indicates the number of
  7253. * entries in the flow table. For example: 8k number of
  7254. * records is equivalent to
  7255. * 8 * 1024 * sizeof(RX_FLOW_SEARCH_ENTRY_STRUCT)
  7256. * b'27:20 - max search: This field specifies the skid length to FSE
  7257. * parser HW module whenever match is not found at the
  7258. * exact index pointed by hash.
  7259. * b'29:28 - ip_da_sa: This indicates which IPV4-IPV6 RFC to be used.
  7260. * Refer htt_ip_da_sa_prefix below for more details.
  7261. * b'31:30 - reserved: Reserved for future use
  7262. * dword2 - b'31:0 - base address lo: Lower 4 bytes base address of flow
  7263. * table allocated by host in DDR
  7264. * dword3 - b'31:0 - base address hi: Higher 4 bytes of base address of flow
  7265. * table allocated by host in DDR
  7266. * dword4:13 - b'31:0 - Toeplitz: 315 bits of Toeplitz keys for flow table
  7267. * entry hashing
  7268. *
  7269. *
  7270. * |31 30|29 28|27|26|25 20|19 16|15 8|7 0|
  7271. * |---------------------------------------------------------------|
  7272. * | reserved | pdev_id | MSG_TYPE |
  7273. * |---------------------------------------------------------------|
  7274. * |resvd|IPDSA| max_search | Number of records |
  7275. * |---------------------------------------------------------------|
  7276. * | base address lo |
  7277. * |---------------------------------------------------------------|
  7278. * | base address high |
  7279. * |---------------------------------------------------------------|
  7280. * | toeplitz key 31_0 |
  7281. * |---------------------------------------------------------------|
  7282. * | toeplitz key 63_32 |
  7283. * |---------------------------------------------------------------|
  7284. * | toeplitz key 95_64 |
  7285. * |---------------------------------------------------------------|
  7286. * | toeplitz key 127_96 |
  7287. * |---------------------------------------------------------------|
  7288. * | toeplitz key 159_128 |
  7289. * |---------------------------------------------------------------|
  7290. * | toeplitz key 191_160 |
  7291. * |---------------------------------------------------------------|
  7292. * | toeplitz key 223_192 |
  7293. * |---------------------------------------------------------------|
  7294. * | toeplitz key 255_224 |
  7295. * |---------------------------------------------------------------|
  7296. * | toeplitz key 287_256 |
  7297. * |---------------------------------------------------------------|
  7298. * | reserved | toeplitz key 314_288(26:0 bits) |
  7299. * |---------------------------------------------------------------|
  7300. * where:
  7301. * IPDSA = ip_da_sa
  7302. */
  7303. /**
  7304. * @brief: htt_ip_da_sa_prefix
  7305. * 0x0 -> Prefix is 0x20010db8_00000000_00000000
  7306. * IPv6 addresses beginning with 0x20010db8 are reserved for
  7307. * documentation per RFC3849
  7308. * 0x1 -> Prefix is 0x00000000_00000000_0000ffff RFC4291 IPv4-mapped IPv6
  7309. * 0x2 -> Prefix is 0x0 RFC4291 IPv4-compatible IPv6
  7310. * 0x3 -> Prefix is 0x0064ff9b_00000000_00000000 RFC6052 well-known prefix
  7311. */
  7312. enum htt_ip_da_sa_prefix {
  7313. HTT_RX_IPV6_20010db8,
  7314. HTT_RX_IPV4_MAPPED_IPV6,
  7315. HTT_RX_IPV4_COMPATIBLE_IPV6,
  7316. HTT_RX_IPV6_64FF9B,
  7317. };
  7318. /**
  7319. * @brief Host-->target HTT RX FISA configure and enable
  7320. *
  7321. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FISA_CFG
  7322. *
  7323. * @details
  7324. * The host will send this command down to configure and enable the FISA
  7325. * operational params.
  7326. * Configure RXOLE_RXOLE_R0_FISA_CTRL and RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH
  7327. * register.
  7328. * Should configure both the MACs.
  7329. *
  7330. * dword0 - b'7:0 - msg_type:
  7331. * This will be set to 0x15 (HTT_H2T_MSG_TYPE_RX_FISA_CFG)
  7332. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7333. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for that
  7334. * pdev's LMAC ring.
  7335. * b'31:16 - reserved : Reserved for future use
  7336. *
  7337. * dword1 - b'0 - enable: Global FISA Enable, 0-FISA Disable, 1-Enable
  7338. * b'1 - IPSEC_SKIP_SEARCH: Flow search will be skipped for IP_SEC
  7339. * packets. 1 flow search will be skipped
  7340. * b'2 - NON_TCP_SKIP_SEARCH: Flow search will be skipped for Non
  7341. * tcp,udp packets
  7342. * b'3 - ADD_IPV4_FIXED_HDR_LEN: Add IPV4 Fixed HDR to length
  7343. * calculation
  7344. * b'4 - ADD_IPV6_FIXED_HDR_LEN: Add IPV6 Fixed HDR to length
  7345. * calculation
  7346. * b'5 - ADD_TCP_FIXED_HDR_LEN: Add TCP Fixed HDR to length
  7347. * calculation
  7348. * b'6 - ADD_UDP_HDR_LEN: Add UDP HDR to length calculation
  7349. * b'7 - CHKSUM_CUM_IP_LEN_EN: IPV4 hdr Checksum over cumulative IP
  7350. * length
  7351. * 0 L4 checksum will be provided in the RX_MSDU_END tlv
  7352. * 1 IPV4 hdr checksum after adjusting for cumulative IP
  7353. * length
  7354. * b'8 - DISABLE_TID_CHECK: 1- Disable TID check for MPDU Sequence
  7355. * num jump
  7356. * b'9 - DISABLE_TA_CHECK: 1- Disable TA check for MPDU Sequence
  7357. * num jump
  7358. * b'10 - DISABLE_QOS_CHECK: 1- Disable checking if qos/nonqos
  7359. * data type switch has happend for MPDU Sequence num jump
  7360. * b'11 - DISABLE_RAW_CHECK: 1- Disable checking for raw packet type
  7361. * for MPDU Sequence num jump
  7362. * b'12 - DISABLE_DECRYPT_ERR_CHECK: 1- Disable fisa cache commands
  7363. * for decrypt errors
  7364. * b'13 - DISABLE_MSDU_DROP_CHECK: 1- Ignore checking of msdu drop
  7365. * while aggregating a msdu
  7366. * b'17:14 - LIMIT, Aggregtion limit for number of MSDUs.
  7367. * The aggregation is done until (number of MSDUs aggregated
  7368. * < LIMIT + 1)
  7369. * b'31:18 - Reserved
  7370. *
  7371. * fisa_control_value - 32bit value FW can write to register
  7372. *
  7373. * dword2 - b'31:0 - FISA_TIMEOUT_THRESH, Timeout threshold for aggregation
  7374. * Threshold value for FISA timeout (units are microseconds).
  7375. * When the global timestamp exceeds this threshold, FISA
  7376. * aggregation will be restarted.
  7377. * A value of 0 means timeout is disabled.
  7378. * Compare the threshold register with timestamp field in
  7379. * flow entry to generate timeout for the flow.
  7380. *
  7381. * |31 18 |17 16|15 8|7 0|
  7382. * |-------------------------------------------------------------|
  7383. * | reserved | pdev_mask | msg type |
  7384. * |-------------------------------------------------------------|
  7385. * | reserved | FISA_CTRL |
  7386. * |-------------------------------------------------------------|
  7387. * | FISA_TIMEOUT_THRESH |
  7388. * |-------------------------------------------------------------|
  7389. */
  7390. PREPACK struct htt_h2t_msg_type_fisa_config_t {
  7391. A_UINT32 msg_type:8,
  7392. pdev_id:8,
  7393. reserved0:16;
  7394. /**
  7395. * @brief fisa_control - RXOLE_RXOLE_R0_FISA_CTRL FISA control register
  7396. * [17:0]
  7397. */
  7398. union {
  7399. /*
  7400. * fisa_control_bits structure is deprecated.
  7401. * Please use fisa_control_bits_v2 going forward.
  7402. */
  7403. struct {
  7404. A_UINT32 fisa_enable: 1,
  7405. ipsec_skip_search: 1,
  7406. nontcp_skip_search: 1,
  7407. add_ipv4_fixed_hdr_len: 1,
  7408. add_ipv6_fixed_hdr_len: 1,
  7409. add_tcp_fixed_hdr_len: 1,
  7410. add_udp_hdr_len: 1,
  7411. chksum_cum_ip_len_en: 1,
  7412. disable_tid_check: 1,
  7413. disable_ta_check: 1,
  7414. disable_qos_check: 1,
  7415. disable_raw_check: 1,
  7416. disable_decrypt_err_check: 1,
  7417. disable_msdu_drop_check: 1,
  7418. fisa_aggr_limit: 4,
  7419. reserved: 14;
  7420. } fisa_control_bits;
  7421. struct {
  7422. A_UINT32 fisa_enable: 1,
  7423. fisa_aggr_limit: 4,
  7424. reserved: 27;
  7425. } fisa_control_bits_v2;
  7426. A_UINT32 fisa_control_value;
  7427. } u_fisa_control;
  7428. /**
  7429. * @brief fisa_timeout_threshold - RXOLE_RXOLE_R0_FISA_TIMEOUT_THRESH FISA
  7430. * timeout threshold for aggregation. Unit in usec.
  7431. * [31:0]
  7432. */
  7433. A_UINT32 fisa_timeout_threshold;
  7434. } POSTPACK;
  7435. /* DWord 0: pdev-ID */
  7436. #define HTT_RX_FISA_CONFIG_PDEV_ID_M 0x0000ff00
  7437. #define HTT_RX_FISA_CONFIG_PDEV_ID_S 8
  7438. #define HTT_RX_FISA_CONFIG_PDEV_ID_GET(_var) \
  7439. (((_var) & HTT_RX_FISA_CONFIG_PDEV_ID_M) >> \
  7440. HTT_RX_FISA_CONFIG_PDEV_ID_S)
  7441. #define HTT_RX_FISA_CONFIG_PDEV_ID_SET(_var, _val) \
  7442. do { \
  7443. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_PDEV_ID, _val); \
  7444. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_PDEV_ID_S)); \
  7445. } while (0)
  7446. /* Dword 1: fisa_control_value fisa config */
  7447. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_M 0x00000001
  7448. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_S 0
  7449. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_GET(_var) \
  7450. (((_var) & HTT_RX_FISA_CONFIG_FISA_ENABLE_M) >> \
  7451. HTT_RX_FISA_CONFIG_FISA_ENABLE_S)
  7452. #define HTT_RX_FISA_CONFIG_FISA_ENABLE_SET(_var, _val) \
  7453. do { \
  7454. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_ENABLE, _val); \
  7455. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_ENABLE_S)); \
  7456. } while (0)
  7457. /* Dword 1: fisa_control_value ipsec_skip_search */
  7458. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M 0x00000002
  7459. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S 1
  7460. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_GET(_var) \
  7461. (((_var) & HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_M) >> \
  7462. HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)
  7463. #define HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_SET(_var, _val) \
  7464. do { \
  7465. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH, _val); \
  7466. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_IPSEC_SKIP_SEARCH_S)); \
  7467. } while (0)
  7468. /* Dword 1: fisa_control_value non_tcp_skip_search */
  7469. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M 0x00000004
  7470. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S 2
  7471. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_GET(_var) \
  7472. (((_var) & HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_M) >> \
  7473. HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)
  7474. #define HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_SET(_var, _val) \
  7475. do { \
  7476. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH, _val); \
  7477. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_NON_TCP_SKIP_SEARCH_S)); \
  7478. } while (0)
  7479. /* Dword 1: fisa_control_value add_ipv4_fixed_hdr */
  7480. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M 0x00000008
  7481. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S 3
  7482. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_GET(_var) \
  7483. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_M) >> \
  7484. HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)
  7485. #define HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_SET(_var, _val) \
  7486. do { \
  7487. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN, _val); \
  7488. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV4_FIXED_HDR_LEN_S)); \
  7489. } while (0)
  7490. /* Dword 1: fisa_control_value add_ipv6_fixed_hdr */
  7491. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M 0x00000010
  7492. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S 4
  7493. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_GET(_var) \
  7494. (((_var) & HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_M) >> \
  7495. HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)
  7496. #define HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_SET(_var, _val) \
  7497. do { \
  7498. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN, _val); \
  7499. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_IPV6_FIXED_HDR_LEN_S)); \
  7500. } while (0)
  7501. /* Dword 1: fisa_control_value tcp_fixed_hdr_len */
  7502. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M 0x00000020
  7503. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S 5
  7504. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_GET(_var) \
  7505. (((_var) & HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_M) >> \
  7506. HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)
  7507. #define HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_SET(_var, _val) \
  7508. do { \
  7509. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN, _val); \
  7510. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_TCP_FIXED_HDR_LEN_S)); \
  7511. } while (0)
  7512. /* Dword 1: fisa_control_value add_udp_hdr_len */
  7513. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M 0x00000040
  7514. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S 6
  7515. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_GET(_var) \
  7516. (((_var) & HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_M) >> \
  7517. HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)
  7518. #define HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_SET(_var, _val) \
  7519. do { \
  7520. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN, _val); \
  7521. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_ADD_UDP_HDR_LEN_S)); \
  7522. } while (0)
  7523. /* Dword 1: fisa_control_value chksum_cum_ip_len_en */
  7524. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M 0x00000080
  7525. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S 7
  7526. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_GET(_var) \
  7527. (((_var) & HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_M) >> \
  7528. HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)
  7529. #define HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_SET(_var, _val) \
  7530. do { \
  7531. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN, _val); \
  7532. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_CHKSUM_CUM_IP_LEN_EN_S)); \
  7533. } while (0)
  7534. /* Dword 1: fisa_control_value disable_tid_check */
  7535. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M 0x00000100
  7536. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S 8
  7537. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_GET(_var) \
  7538. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_M) >> \
  7539. HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)
  7540. #define HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_SET(_var, _val) \
  7541. do { \
  7542. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK, _val); \
  7543. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TID_CHECK_S)); \
  7544. } while (0)
  7545. /* Dword 1: fisa_control_value disable_ta_check */
  7546. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M 0x00000200
  7547. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S 9
  7548. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_GET(_var) \
  7549. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_M) >> \
  7550. HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)
  7551. #define HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_SET(_var, _val) \
  7552. do { \
  7553. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK, _val); \
  7554. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_TA_CHECK_S)); \
  7555. } while (0)
  7556. /* Dword 1: fisa_control_value disable_qos_check */
  7557. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M 0x00000400
  7558. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S 10
  7559. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_GET(_var) \
  7560. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_M) >> \
  7561. HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)
  7562. #define HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_SET(_var, _val) \
  7563. do { \
  7564. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK, _val); \
  7565. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_QOS_CHECK_S)); \
  7566. } while (0)
  7567. /* Dword 1: fisa_control_value disable_raw_check */
  7568. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M 0x00000800
  7569. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S 11
  7570. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_GET(_var) \
  7571. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_M) >> \
  7572. HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)
  7573. #define HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_SET(_var, _val) \
  7574. do { \
  7575. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK, _val); \
  7576. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_RAW_CHECK_S)); \
  7577. } while (0)
  7578. /* Dword 1: fisa_control_value disable_decrypt_err_check */
  7579. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M 0x00001000
  7580. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S 12
  7581. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_GET(_var) \
  7582. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_M) >> \
  7583. HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)
  7584. #define HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_SET(_var, _val) \
  7585. do { \
  7586. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK, _val); \
  7587. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_DECRYPT_ERR_CHECK_S)); \
  7588. } while (0)
  7589. /* Dword 1: fisa_control_value disable_msdu_drop_check */
  7590. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M 0x00002000
  7591. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S 13
  7592. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_GET(_var) \
  7593. (((_var) & HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_M) >> \
  7594. HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)
  7595. #define HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_SET(_var, _val) \
  7596. do { \
  7597. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK, _val); \
  7598. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_DISABLE_MSDU_DROP_CHECK_S)); \
  7599. } while (0)
  7600. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7601. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M 0x0003c000
  7602. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S 14
  7603. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_GET(_var) \
  7604. (((_var) & HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_M) >> \
  7605. HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)
  7606. #define HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_SET(_var, _val) \
  7607. do { \
  7608. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT, _val); \
  7609. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_AGGR_LIMIT_S)); \
  7610. } while (0)
  7611. /* Dword 1: fisa_control_value fisa config */
  7612. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M 0x00000001
  7613. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S 0
  7614. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_GET(_var) \
  7615. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_M) >> \
  7616. HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)
  7617. #define HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_SET(_var, _val) \
  7618. do { \
  7619. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_ENABLE, _val); \
  7620. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_ENABLE_S)); \
  7621. } while (0)
  7622. /* Dword 1: fisa_control_value fisa_aggr_limit */
  7623. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M 0x0000001e
  7624. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S 1
  7625. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_GET(_var) \
  7626. (((_var) & HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_M) >> \
  7627. HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)
  7628. #define HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_SET(_var, _val) \
  7629. do { \
  7630. HTT_CHECK_SET_VAL(HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT, _val); \
  7631. ((_var) |= ((_val) << HTT_RX_FISA_CONFIG_FISA_V2_AGGR_LIMIT_S)); \
  7632. } while (0)
  7633. PREPACK struct htt_h2t_msg_rx_fse_setup_t {
  7634. A_UINT32 msg_type:8, /* HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG */
  7635. pdev_id:8,
  7636. reserved0:16;
  7637. A_UINT32 num_records:20,
  7638. max_search:8,
  7639. ip_da_sa:2, /* htt_ip_da_sa_prefix enumeration */
  7640. reserved1:2;
  7641. A_UINT32 base_addr_lo;
  7642. A_UINT32 base_addr_hi;
  7643. A_UINT32 toeplitz31_0;
  7644. A_UINT32 toeplitz63_32;
  7645. A_UINT32 toeplitz95_64;
  7646. A_UINT32 toeplitz127_96;
  7647. A_UINT32 toeplitz159_128;
  7648. A_UINT32 toeplitz191_160;
  7649. A_UINT32 toeplitz223_192;
  7650. A_UINT32 toeplitz255_224;
  7651. A_UINT32 toeplitz287_256;
  7652. A_UINT32 toeplitz314_288:27,
  7653. reserved2:5;
  7654. } POSTPACK;
  7655. #define HTT_RX_FSE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_fse_setup_t))
  7656. #define HTT_RX_FSE_OPERATION_SZ (sizeof(struct htt_h2t_msg_rx_fse_operation_t))
  7657. #define HTT_RX_FISA_CONFIG_SZ (sizeof(struct htt_h2t_msg_type_fisa_config_t))
  7658. #define HTT_RX_FSE_SETUP_HASH_314_288_M 0x07ffffff
  7659. #define HTT_RX_FSE_SETUP_HASH_314_288_S 0
  7660. /* DWORD 0: Pdev ID */
  7661. #define HTT_RX_FSE_SETUP_PDEV_ID_M 0x0000ff00
  7662. #define HTT_RX_FSE_SETUP_PDEV_ID_S 8
  7663. #define HTT_RX_FSE_SETUP_PDEV_ID_GET(_var) \
  7664. (((_var) & HTT_RX_FSE_SETUP_PDEV_ID_M) >> \
  7665. HTT_RX_FSE_SETUP_PDEV_ID_S)
  7666. #define HTT_RX_FSE_SETUP_PDEV_ID_SET(_var, _val) \
  7667. do { \
  7668. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_PDEV_ID, _val); \
  7669. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_PDEV_ID_S)); \
  7670. } while (0)
  7671. /* DWORD 1:num of records */
  7672. #define HTT_RX_FSE_SETUP_NUM_REC_M 0x000fffff
  7673. #define HTT_RX_FSE_SETUP_NUM_REC_S 0
  7674. #define HTT_RX_FSE_SETUP_NUM_REC_GET(_var) \
  7675. (((_var) & HTT_RX_FSE_SETUP_NUM_REC_M) >> \
  7676. HTT_RX_FSE_SETUP_NUM_REC_S)
  7677. #define HTT_RX_FSE_SETUP_NUM_REC_SET(_var, _val) \
  7678. do { \
  7679. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_NUM_REC, _val); \
  7680. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_NUM_REC_S)); \
  7681. } while (0)
  7682. /* DWORD 1:max_search */
  7683. #define HTT_RX_FSE_SETUP_MAX_SEARCH_M 0x0ff00000
  7684. #define HTT_RX_FSE_SETUP_MAX_SEARCH_S 20
  7685. #define HTT_RX_FSE_SETUP_MAX_SEARCH_GET(_var) \
  7686. (((_var) & HTT_RX_FSE_SETUP_MAX_SEARCH_M) >> \
  7687. HTT_RX_FSE_SETUP_MAX_SEARCH_S)
  7688. #define HTT_RX_FSE_SETUP_MAX_SEARCH_SET(_var, _val) \
  7689. do { \
  7690. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_MAX_SEARCH, _val); \
  7691. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_MAX_SEARCH_S)); \
  7692. } while (0)
  7693. /* DWORD 1:ip_da_sa prefix */
  7694. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M 0x30000000
  7695. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S 28
  7696. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_GET(_var) \
  7697. (((_var) & HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_M) >> \
  7698. HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)
  7699. #define HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_SET(_var, _val) \
  7700. do { \
  7701. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX, _val); \
  7702. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_IP_DA_SA_PREFIX_S)); \
  7703. } while (0)
  7704. /* DWORD 2: Base Address LO */
  7705. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_M 0xffffffff
  7706. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_S 0
  7707. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_GET(_var) \
  7708. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_LO_M) >> \
  7709. HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)
  7710. #define HTT_RX_FSE_SETUP_BASE_ADDR_LO_SET(_var, _val) \
  7711. do { \
  7712. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_LO, _val); \
  7713. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_LO_S)); \
  7714. } while (0)
  7715. /* DWORD 3: Base Address High */
  7716. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_M 0xffffffff
  7717. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_S 0
  7718. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_GET(_var) \
  7719. (((_var) & HTT_RX_FSE_SETUP_BASE_ADDR_HI_M) >> \
  7720. HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)
  7721. #define HTT_RX_FSE_SETUP_BASE_ADDR_HI_SET(_var, _val) \
  7722. do { \
  7723. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_BASE_ADDR_HI, _val); \
  7724. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_BASE_ADDR_HI_S)); \
  7725. } while (0)
  7726. /* DWORD 4-12: Hash Value */
  7727. #define HTT_RX_FSE_SETUP_HASH_VALUE_M 0xffffffff
  7728. #define HTT_RX_FSE_SETUP_HASH_VALUE_S 0
  7729. #define HTT_RX_FSE_SETUP_HASH_VALUE_GET(_var) \
  7730. (((_var) & HTT_RX_FSE_SETUP_HASH_VALUE_M) >> \
  7731. HTT_RX_FSE_SETUP_HASH_VALUE_S)
  7732. #define HTT_RX_FSE_SETUP_HASH_VALUE_SET(_var, _val) \
  7733. do { \
  7734. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_VALUE, _val); \
  7735. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_VALUE_S)); \
  7736. } while (0)
  7737. /* DWORD 13: Hash Value 314:288 bits */
  7738. #define HTT_RX_FSE_SETUP_HASH_314_288_GET(_var) \
  7739. (((_var) & HTT_RX_FSE_SETUP_HASH_314_288_M) >> \
  7740. HTT_RX_FSE_SETUP_HASH_314_288_S)
  7741. #define HTT_RX_FSE_SETUP_HASH_314_288_SET(_var, _val) \
  7742. do { \
  7743. HTT_CHECK_SET_VAL(HTT_RX_FSE_SETUP_HASH_314_288, _val); \
  7744. ((_var) |= ((_val) << HTT_RX_FSE_SETUP_HASH_314_288_S)); \
  7745. } while (0)
  7746. /**
  7747. * @brief Host-->target HTT RX FSE operation message
  7748. *
  7749. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG
  7750. *
  7751. * @details
  7752. * The host will send this Flow Search Engine (FSE) operation message for
  7753. * every flow add/delete operation.
  7754. * The FSE operation includes FSE full cache invalidation or individual entry
  7755. * invalidation.
  7756. * This message can be sent per SOC or per PDEV which is differentiated
  7757. * by pdev id values.
  7758. *
  7759. * |31 16|15 8|7 1|0|
  7760. * |-------------------------------------------------------------|
  7761. * | reserved | pdev_id | MSG_TYPE |
  7762. * |-------------------------------------------------------------|
  7763. * | reserved | operation |I|
  7764. * |-------------------------------------------------------------|
  7765. * | ip_src_addr_31_0 |
  7766. * |-------------------------------------------------------------|
  7767. * | ip_src_addr_63_32 |
  7768. * |-------------------------------------------------------------|
  7769. * | ip_src_addr_95_64 |
  7770. * |-------------------------------------------------------------|
  7771. * | ip_src_addr_127_96 |
  7772. * |-------------------------------------------------------------|
  7773. * | ip_dst_addr_31_0 |
  7774. * |-------------------------------------------------------------|
  7775. * | ip_dst_addr_63_32 |
  7776. * |-------------------------------------------------------------|
  7777. * | ip_dst_addr_95_64 |
  7778. * |-------------------------------------------------------------|
  7779. * | ip_dst_addr_127_96 |
  7780. * |-------------------------------------------------------------|
  7781. * | l4_dst_port | l4_src_port |
  7782. * | (32-bit SPI incase of IPsec) |
  7783. * |-------------------------------------------------------------|
  7784. * | reserved | l4_proto |
  7785. * |-------------------------------------------------------------|
  7786. *
  7787. * where I is 1-bit ipsec_valid.
  7788. *
  7789. * The following field definitions describe the format of the RX FSE operation
  7790. * message sent from the host to target for every add/delete flow entry to flow
  7791. * table.
  7792. *
  7793. * Header fields:
  7794. * dword0 - b'7:0 - msg_type: This will be set to
  7795. * 0x13 (HTT_H2T_MSG_TYPE_RX_FSE_OPERATION_CFG)
  7796. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7797. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7798. * specified pdev's LMAC ring.
  7799. * b'31:16 - reserved : Reserved for future use
  7800. * dword1 - b'0 - ipsec_valid: This indicates protocol IP or IPsec
  7801. * (Internet Protocol Security).
  7802. * IPsec describes the framework for providing security at
  7803. * IP layer. IPsec is defined for both versions of IP:
  7804. * IPV4 and IPV6.
  7805. * Please refer to htt_rx_flow_proto enumeration below for
  7806. * more info.
  7807. * ipsec_valid = 1 for IPSEC packets
  7808. * ipsec_valid = 0 for IP Packets
  7809. * b'7:1 - operation: This indicates types of FSE operation.
  7810. * Refer to htt_rx_fse_operation enumeration:
  7811. * 0 - No Cache Invalidation required
  7812. * 1 - Cache invalidate only one entry given by IP
  7813. * src/dest address at DWORD[2:9]
  7814. * 2 - Complete FSE Cache Invalidation
  7815. * 3 - FSE Disable
  7816. * 4 - FSE Enable
  7817. * b'31:8 - reserved: Reserved for future use
  7818. * dword2:9-b'31:0 - IP src/dest: IPV4/IPV6 source and destination address
  7819. * for per flow addition/deletion
  7820. * For IPV4 src/dest addresses, the first A_UINT32 is used
  7821. * and the subsequent 3 A_UINT32 will be padding bytes.
  7822. * For IPV6 src/dest Addresses, all A_UINT32 are used.
  7823. * dword10 -b'31:0 - L4 src port (15:0): 16-bit Source Port numbers range
  7824. * from 0 to 65535 but only 0 to 1023 are designated as
  7825. * well-known ports. Refer to [RFC1700] for more details.
  7826. * This field is valid only if
  7827. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7828. * - L4 dest port (31:16): 16-bit Destination Port numbers
  7829. * range from 0 to 65535 but only 0 to 1023 are designated
  7830. * as well-known ports. Refer to [RFC1700] for more details.
  7831. * This field is valid only if
  7832. * (valid_ip_proto(l4_proto) && (ipsec_valid == 0))
  7833. * - SPI (31:0): Security Parameters Index is an
  7834. * identification tag added to the header while using IPsec
  7835. * for tunneling the IP traffici.
  7836. * Valid only if IPSec_valid bit (in DWORD1) is set to 1.
  7837. * dword11 -b'7:0 - l4_proto: This carries L4 protocol numbers, which are
  7838. * Assigned Internet Protocol Numbers.
  7839. * l4_proto numbers for standard protocol like UDP/TCP
  7840. * protocol at l4 layer, e.g. l4_proto = 6 for TCP,
  7841. * l4_proto = 17 for UDP etc.
  7842. * b'31:8 - reserved: Reserved for future use.
  7843. *
  7844. */
  7845. PREPACK struct htt_h2t_msg_rx_fse_operation_t {
  7846. A_UINT32 msg_type:8,
  7847. pdev_id:8,
  7848. reserved0:16;
  7849. A_UINT32 ipsec_valid:1,
  7850. operation:7,
  7851. reserved1:24;
  7852. A_UINT32 ip_src_addr_31_0;
  7853. A_UINT32 ip_src_addr_63_32;
  7854. A_UINT32 ip_src_addr_95_64;
  7855. A_UINT32 ip_src_addr_127_96;
  7856. A_UINT32 ip_dest_addr_31_0;
  7857. A_UINT32 ip_dest_addr_63_32;
  7858. A_UINT32 ip_dest_addr_95_64;
  7859. A_UINT32 ip_dest_addr_127_96;
  7860. union {
  7861. A_UINT32 spi;
  7862. struct {
  7863. A_UINT32 l4_src_port:16,
  7864. l4_dest_port:16;
  7865. } ip;
  7866. } u;
  7867. A_UINT32 l4_proto:8,
  7868. reserved:24;
  7869. } POSTPACK;
  7870. /**
  7871. * @brief Host-->target HTT RX Full monitor mode register configuration message
  7872. *
  7873. * MSG_TYPE => HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE
  7874. *
  7875. * @details
  7876. * The host will send this Full monitor mode register configuration message.
  7877. * This message can be sent per SOC or per PDEV which is differentiated
  7878. * by pdev id values.
  7879. *
  7880. * |31 16|15 11|10 8|7 3|2|1|0|
  7881. * |-------------------------------------------------------------|
  7882. * | reserved | pdev_id | MSG_TYPE |
  7883. * |-------------------------------------------------------------|
  7884. * | reserved |Release Ring |N|Z|E|
  7885. * |-------------------------------------------------------------|
  7886. *
  7887. * where E is 1-bit full monitor mode enable/disable.
  7888. * Z is 1-bit additional descriptor for zero mpdu enable/disable
  7889. * N is 1-bit additional descriptor for non zero mdpu enable/disable
  7890. *
  7891. * The following field definitions describe the format of the full monitor
  7892. * mode configuration message sent from the host to target for each pdev.
  7893. *
  7894. * Header fields:
  7895. * dword0 - b'7:0 - msg_type: This will be set to
  7896. * 0x17 (HTT_H2T_MSG_TYPE_RX_FULL_MONITOR_MODE)
  7897. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  7898. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  7899. * specified pdev's LMAC ring.
  7900. * b'31:16 - reserved : Reserved for future use.
  7901. * dword1 - b'0 - full_monitor_mode enable: This indicates that the full
  7902. * monitor mode rxdma register is to be enabled or disabled.
  7903. * b'1 - addnl_descs_zero_mpdus_end: This indicates that the
  7904. * additional descriptors at ppdu end for zero mpdus
  7905. * enabled or disabled.
  7906. * b'2 - addnl_descs_non_zero_mpdus_end: This indicates that the
  7907. * additional descriptors at ppdu end for non zero mpdus
  7908. * enabled or disabled.
  7909. * b'10:3 - release_ring: This indicates the destination ring
  7910. * selection for the descriptor at the end of PPDU
  7911. * 0 - REO ring select
  7912. * 1 - FW ring select
  7913. * 2 - SW ring select
  7914. * 3 - Release ring select
  7915. * Refer to htt_rx_full_mon_release_ring.
  7916. * b'31:11 - reserved for future use
  7917. */
  7918. PREPACK struct htt_h2t_msg_rx_full_monitor_mode_t {
  7919. A_UINT32 msg_type:8,
  7920. pdev_id:8,
  7921. reserved0:16;
  7922. A_UINT32 full_monitor_mode_enable:1,
  7923. addnl_descs_zero_mpdus_end:1,
  7924. addnl_descs_non_zero_mpdus_end:1,
  7925. release_ring:8,
  7926. reserved1:21;
  7927. } POSTPACK;
  7928. /**
  7929. * Enumeration for full monitor mode destination ring select
  7930. * 0 - REO destination ring select
  7931. * 1 - FW destination ring select
  7932. * 2 - SW destination ring select
  7933. * 3 - Release destination ring select
  7934. */
  7935. enum htt_rx_full_mon_release_ring {
  7936. HTT_RX_MON_RING_REO,
  7937. HTT_RX_MON_RING_FW,
  7938. HTT_RX_MON_RING_SW,
  7939. HTT_RX_MON_RING_RELEASE,
  7940. };
  7941. #define HTT_RX_FULL_MONITOR_MODE_SETUP_SZ (sizeof(struct htt_h2t_msg_rx_full_monitor_mode_t))
  7942. /* DWORD 0: Pdev ID */
  7943. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M 0x0000ff00
  7944. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S 8
  7945. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_GET(_var) \
  7946. (((_var) & HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_M) >> \
  7947. HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)
  7948. #define HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_SET(_var, _val) \
  7949. do { \
  7950. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID, _val); \
  7951. ((_var) |= ((_val) << HTT_RX_FULL_MONITOR_MODE_OPERATION_PDEV_ID_S)); \
  7952. } while (0)
  7953. /* DWORD 1:ENABLE */
  7954. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_M 0x00000001
  7955. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_S 0
  7956. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_SET(word, enable) \
  7957. do { \
  7958. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ENABLE, enable); \
  7959. (word) |= ((enable) << HTT_RX_FULL_MONITOR_MODE_ENABLE_S); \
  7960. } while (0)
  7961. #define HTT_RX_FULL_MONITOR_MODE_ENABLE_GET(word) \
  7962. (((word) & HTT_RX_FULL_MONITOR_MODE_ENABLE_M) >> HTT_RX_FULL_MONITOR_MODE_ENABLE_S)
  7963. /* DWORD 1:ZERO_MPDU */
  7964. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M 0x00000002
  7965. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S 1
  7966. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_SET(word, zerompdu) \
  7967. do { \
  7968. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU, zerompdu); \
  7969. (word) |= ((zerompdu) << HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S); \
  7970. } while (0)
  7971. #define HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_GET(word) \
  7972. (((word) & HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_ZERO_MPDU_S)
  7973. /* DWORD 1:NON_ZERO_MPDU */
  7974. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M 0x00000004
  7975. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S 2
  7976. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_SET(word, nonzerompdu) \
  7977. do { \
  7978. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU, nonzerompdu); \
  7979. (word) |= ((nonzerompdu) << HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S); \
  7980. } while (0)
  7981. #define HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_GET(word) \
  7982. (((word) & HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_M) >> HTT_RX_FULL_MONITOR_MODE_NON_ZERO_MPDU_S)
  7983. /* DWORD 1:RELEASE_RINGS */
  7984. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M 0x000007f8
  7985. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S 3
  7986. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_SET(word, releaserings) \
  7987. do { \
  7988. HTT_CHECK_SET_VAL(HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS, releaserings); \
  7989. (word) |= ((releaserings) << HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S); \
  7990. } while (0)
  7991. #define HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_GET(word) \
  7992. (((word) & HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_M) >> HTT_RX_FULL_MONITOR_MODE_RELEASE_RINGS_S)
  7993. /**
  7994. * Enumeration for IP Protocol or IPSEC Protocol
  7995. * IPsec describes the framework for providing security at IP layer.
  7996. * IPsec is defined for both versions of IP: IPV4 and IPV6.
  7997. */
  7998. enum htt_rx_flow_proto {
  7999. HTT_RX_FLOW_IP_PROTO,
  8000. HTT_RX_FLOW_IPSEC_PROTO,
  8001. };
  8002. /**
  8003. * Enumeration for FSE Cache Invalidation
  8004. * 0 - No Cache Invalidation required
  8005. * 1 - Cache invalidate only one entry given by IP src/dest address at DWORD2:9
  8006. * 2 - Complete FSE Cache Invalidation
  8007. * 3 - FSE Disable
  8008. * 4 - FSE Enable
  8009. */
  8010. enum htt_rx_fse_operation {
  8011. HTT_RX_FSE_CACHE_INVALIDATE_NONE,
  8012. HTT_RX_FSE_CACHE_INVALIDATE_ENTRY,
  8013. HTT_RX_FSE_CACHE_INVALIDATE_FULL,
  8014. HTT_RX_FSE_DISABLE,
  8015. HTT_RX_FSE_ENABLE,
  8016. };
  8017. /* DWORD 0: Pdev ID */
  8018. #define HTT_RX_FSE_OPERATION_PDEV_ID_M 0x0000ff00
  8019. #define HTT_RX_FSE_OPERATION_PDEV_ID_S 8
  8020. #define HTT_RX_FSE_OPERATION_PDEV_ID_GET(_var) \
  8021. (((_var) & HTT_RX_FSE_OPERATION_PDEV_ID_M) >> \
  8022. HTT_RX_FSE_OPERATION_PDEV_ID_S)
  8023. #define HTT_RX_FSE_OPERATION_PDEV_ID_SET(_var, _val) \
  8024. do { \
  8025. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_PDEV_ID, _val); \
  8026. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_PDEV_ID_S)); \
  8027. } while (0)
  8028. /* DWORD 1:IP PROTO or IPSEC */
  8029. #define HTT_RX_FSE_IPSEC_VALID_M 0x00000001
  8030. #define HTT_RX_FSE_IPSEC_VALID_S 0
  8031. #define HTT_RX_FSE_IPSEC_VALID_SET(word, ipsec_valid) \
  8032. do { \
  8033. HTT_CHECK_SET_VAL(HTT_RX_FSE_IPSEC_VALID, ipsec_valid); \
  8034. (word) |= ((ipsec_valid) << HTT_RX_FSE_IPSEC_VALID_S); \
  8035. } while (0)
  8036. #define HTT_RX_FSE_IPSEC_VALID_GET(word) \
  8037. (((word) & HTT_RX_FSE_IPSEC_VALID_M) >> HTT_RX_FSE_IPSEC_VALID_S)
  8038. /* DWORD 1:FSE Operation */
  8039. #define HTT_RX_FSE_OPERATION_M 0x000000fe
  8040. #define HTT_RX_FSE_OPERATION_S 1
  8041. #define HTT_RX_FSE_OPERATION_SET(word, op_val) \
  8042. do { \
  8043. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION, op_val); \
  8044. (word) |= ((op_val) << HTT_RX_FSE_OPERATION_S); \
  8045. } while (0)
  8046. #define HTT_RX_FSE_OPERATION_GET(word) \
  8047. (((word) & HTT_RX_FSE_OPERATION_M) >> HTT_RX_FSE_OPERATION_S)
  8048. /* DWORD 2-9:IP Address */
  8049. #define HTT_RX_FSE_OPERATION_IP_ADDR_M 0xffffffff
  8050. #define HTT_RX_FSE_OPERATION_IP_ADDR_S 0
  8051. #define HTT_RX_FSE_OPERATION_IP_ADDR_GET(_var) \
  8052. (((_var) & HTT_RX_FSE_OPERATION_IP_ADDR_M) >> \
  8053. HTT_RX_FSE_OPERATION_IP_ADDR_S)
  8054. #define HTT_RX_FSE_OPERATION_IP_ADDR_SET(_var, _val) \
  8055. do { \
  8056. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_IP_ADDR, _val); \
  8057. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_IP_ADDR_S)); \
  8058. } while (0)
  8059. /* DWORD 10:Source Port Number */
  8060. #define HTT_RX_FSE_SOURCEPORT_M 0x0000ffff
  8061. #define HTT_RX_FSE_SOURCEPORT_S 0
  8062. #define HTT_RX_FSE_SOURCEPORT_SET(word, sport) \
  8063. do { \
  8064. HTT_CHECK_SET_VAL(HTT_RX_FSE_SOURCEPORT, sport); \
  8065. (word) |= ((sport) << HTT_RX_FSE_SOURCEPORT_S); \
  8066. } while (0)
  8067. #define HTT_RX_FSE_SOURCEPORT_GET(word) \
  8068. (((word) & HTT_RX_FSE_SOURCEPORT_M) >> HTT_RX_FSE_SOURCEPORT_S)
  8069. /* DWORD 11:Destination Port Number */
  8070. #define HTT_RX_FSE_DESTPORT_M 0xffff0000
  8071. #define HTT_RX_FSE_DESTPORT_S 16
  8072. #define HTT_RX_FSE_DESTPORT_SET(word, dport) \
  8073. do { \
  8074. HTT_CHECK_SET_VAL(HTT_RX_FSE_DESTPORT, dport); \
  8075. (word) |= ((dport) << HTT_RX_FSE_DESTPORT_S); \
  8076. } while (0)
  8077. #define HTT_RX_FSE_DESTPORT_GET(word) \
  8078. (((word) & HTT_RX_FSE_DESTPORT_M) >> HTT_RX_FSE_DESTPORT_S)
  8079. /* DWORD 10-11:SPI (In case of IPSEC) */
  8080. #define HTT_RX_FSE_OPERATION_SPI_M 0xffffffff
  8081. #define HTT_RX_FSE_OPERATION_SPI_S 0
  8082. #define HTT_RX_FSE_OPERATION_SPI_GET(_var) \
  8083. (((_var) & HTT_RX_FSE_OPERATION_SPI_ADDR_M) >> \
  8084. HTT_RX_FSE_OPERATION_SPI_ADDR_S)
  8085. #define HTT_RX_FSE_OPERATION_SPI_SET(_var, _val) \
  8086. do { \
  8087. HTT_CHECK_SET_VAL(HTT_RX_FSE_OPERATION_SPI, _val); \
  8088. ((_var) |= ((_val) << HTT_RX_FSE_OPERATION_SPI_S)); \
  8089. } while (0)
  8090. /* DWORD 12:L4 PROTO */
  8091. #define HTT_RX_FSE_L4_PROTO_M 0x000000ff
  8092. #define HTT_RX_FSE_L4_PROTO_S 0
  8093. #define HTT_RX_FSE_L4_PROTO_SET(word, proto_val) \
  8094. do { \
  8095. HTT_CHECK_SET_VAL(HTT_RX_FSE_L4_PROTO, proto_val); \
  8096. (word) |= ((proto_val) << HTT_RX_FSE_L4_PROTO_S); \
  8097. } while (0)
  8098. #define HTT_RX_FSE_L4_PROTO_GET(word) \
  8099. (((word) & HTT_RX_FSE_L4_PROTO_M) >> HTT_RX_FSE_L4_PROTO_S)
  8100. /**
  8101. * @brief host --> target Receive to configure the RxOLE 3-tuple Hash
  8102. *
  8103. * MSG_TYPE => HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG
  8104. *
  8105. * |31 24|23 |15 8|7 2|1|0|
  8106. * |----------------+----------------+----------------+----------------|
  8107. * | reserved | pdev_id | msg_type |
  8108. * |---------------------------------+----------------+----------------|
  8109. * | reserved |E|F|
  8110. * |---------------------------------+----------------+----------------|
  8111. * Where E = Configure the target to provide the 3-tuple hash value in
  8112. * toeplitz_hash_2_or_4 field of rx_msdu_start tlv
  8113. * F = Configure the target to provide the 3-tuple hash value in
  8114. * flow_id_toeplitz field of rx_msdu_start tlv
  8115. *
  8116. * The following field definitions describe the format of the 3 tuple hash value
  8117. * message sent from the host to target as part of initialization sequence.
  8118. *
  8119. * Header fields:
  8120. * dword0 - b'7:0 - msg_type: This will be set to
  8121. * 0x16 (HTT_H2T_MSG_TYPE_3_TUPLE_HASH_CFG)
  8122. * b'15:8 - pdev_id: 0 indicates msg is for all LMAC rings, i.e. soc
  8123. * 1, 2, 3 indicates pdev_id 0,1,2 and the msg is for the
  8124. * specified pdev's LMAC ring.
  8125. * b'31:16 - reserved : Reserved for future use
  8126. * dword1 - b'0 - flow_id_toeplitz_field_enable
  8127. * b'1 - toeplitz_hash_2_or_4_field_enable
  8128. * b'31:2 - reserved : Reserved for future use
  8129. * ---------+------+----------------------------------------------------------
  8130. * bit1 | bit0 | Functionality
  8131. * ---------+------+----------------------------------------------------------
  8132. * 0 | 1 | Configure the target to provide the 3 tuple hash value
  8133. * | | in flow_id_toeplitz field
  8134. * ---------+------+----------------------------------------------------------
  8135. * 1 | 0 | Configure the target to provide the 3 tuple hash value
  8136. * | | in toeplitz_hash_2_or_4 field
  8137. * ---------+------+----------------------------------------------------------
  8138. * 1 | 1 | Configure the target to provide the 3 tuple hash value
  8139. * | | in both flow_id_toeplitz & toeplitz_hash_2_or_4 field
  8140. * ---------+------+----------------------------------------------------------
  8141. * 0 | 0 | Configure the target to provide the 5 tuple hash value
  8142. * | | in flow_id_toeplitz field 2 or 4 tuple has value in
  8143. * | | toeplitz_hash_2_or_4 field
  8144. *----------------------------------------------------------------------------
  8145. */
  8146. PREPACK struct htt_h2t_msg_rx_3_tuple_hash_cfg_t {
  8147. A_UINT32 msg_type :8,
  8148. pdev_id :8,
  8149. reserved0 :16;
  8150. A_UINT32 flow_id_toeplitz_field_enable :1,
  8151. toeplitz_hash_2_or_4_field_enable :1,
  8152. reserved1 :30;
  8153. } POSTPACK;
  8154. /* DWORD0 : pdev_id configuration Macros */
  8155. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_M 0xff00
  8156. #define HTT_H2T_3_TUPLE_HASH_PDEV_ID_S 8
  8157. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_GET(_var) \
  8158. (((_var) & HTT_H2T_3_TUPLE_HASH_PDEV_ID_M) >> \
  8159. HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)
  8160. #define HTT_RX_3_TUPLE_HASH_PDEV_ID_SET(_var, _val) \
  8161. do { \
  8162. HTT_CHECK_SET_VAL(HTT_H2T_3_TUPLE_HASH_PDEV_ID, _val); \
  8163. ((_var) |= ((_val) << HTT_H2T_3_TUPLE_HASH_PDEV_ID_S)); \
  8164. } while (0)
  8165. /* DWORD1: rx 3 tuple hash value reception field configuration Macros */
  8166. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M 0x1
  8167. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S 0
  8168. #define HTT_FLOW_ID_TOEPLITZ_FIELD_CONFIG_GET(_var) \
  8169. (((_var) & HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_M) >> \
  8170. HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)
  8171. #define HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_SET(_var, _val) \
  8172. do { \
  8173. HTT_CHECK_SET_VAL(HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG, _val); \
  8174. ((_var) |= ((_val) << HTT_H2T_FLOW_ID_TOEPLITZ_FIELD_CONFIG_S)); \
  8175. } while (0)
  8176. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M 0x2
  8177. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S 1
  8178. #define HTT_TOEPLITZ_2_OR_4_FIELD_CONFIG_GET(_var) \
  8179. (((_var) & HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_M) >> \
  8180. HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)
  8181. #define HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_SET(_var, _val) \
  8182. do { \
  8183. HTT_CHECK_SET_VAL(HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG, _val); \
  8184. ((_var) |= ((_val) << HTT_H2T_TOEPLITZ_2_OR_4_FIELD_CONFIG_S)); \
  8185. } while (0)
  8186. #define HTT_3_TUPLE_HASH_CFG_REQ_BYTES 8
  8187. /**
  8188. * @brief host --> target Host PA Address Size
  8189. *
  8190. * MSG_TYPE => HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE
  8191. *
  8192. * @details
  8193. * The HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE message is sent by the host to
  8194. * provide the physical start address and size of each of the memory
  8195. * areas within host DDR that the target FW may need to access.
  8196. *
  8197. * For example, the host can use this message to allow the target FW
  8198. * to set up access to the host's pools of TQM link descriptors.
  8199. * The message would appear as follows:
  8200. *
  8201. * |31 24|23 16|15 8|7 0|
  8202. * |----------------+----------------+----------------+----------------|
  8203. * | reserved | num_entries | msg_type |
  8204. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8205. * | mem area 0 size |
  8206. * |----------------+----------------+----------------+----------------|
  8207. * | mem area 0 physical_address_lo |
  8208. * |----------------+----------------+----------------+----------------|
  8209. * | mem area 0 physical_address_hi |
  8210. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8211. * | mem area 1 size |
  8212. * |----------------+----------------+----------------+----------------|
  8213. * | mem area 1 physical_address_lo |
  8214. * |----------------+----------------+----------------+----------------|
  8215. * | mem area 1 physical_address_hi |
  8216. * |----------------+----------------+----------------+----------------|
  8217. * ...
  8218. * |-=-=-=-=-=-=-=-=+-=-=-=-=-=-=-=-=+=-=-=-=-=-=-=-=-+=-=-=-=-=-=-=-=-|
  8219. * | mem area N size |
  8220. * |----------------+----------------+----------------+----------------|
  8221. * | mem area N physical_address_lo |
  8222. * |----------------+----------------+----------------+----------------|
  8223. * | mem area N physical_address_hi |
  8224. * |----------------+----------------+----------------+----------------|
  8225. *
  8226. * The message is interpreted as follows:
  8227. * dword0 - b'0:7 - msg_type: This will be set to
  8228. * 0x18 (HTT_H2T_MSG_TYPE_HOST_PADDR_SIZE)
  8229. * b'8:15 - number_entries: Indicated the number of host memory
  8230. * areas specified within the remainder of the message
  8231. * b'16:31 - reserved.
  8232. * dword1 - b'0:31 - memory area 0 size in bytes
  8233. * dword2 - b'0:31 - memory area 0 physical address, lower 32 bits
  8234. * dword3 - b'0:31 - memory area 0 physical address, upper 32 bits
  8235. * and similar for memory area 1 through memory area N.
  8236. */
  8237. PREPACK struct htt_h2t_host_paddr_size {
  8238. A_UINT32 msg_type: 8,
  8239. num_entries: 8,
  8240. reserved: 16;
  8241. } POSTPACK;
  8242. PREPACK struct htt_h2t_host_paddr_size_entry_t {
  8243. A_UINT32 size;
  8244. A_UINT32 physical_address_lo;
  8245. A_UINT32 physical_address_hi;
  8246. } POSTPACK;
  8247. #define HTT_H2T_HOST_PADDR_SIZE_ENTRY_SIZE (sizeof(struct htt_h2t_host_paddr_size_entry_t))
  8248. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M 0x0000FF00
  8249. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S 8
  8250. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_GET(_var) \
  8251. (((_var) & HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_M) >> \
  8252. HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)
  8253. #define HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_SET(_var, _val) \
  8254. do { \
  8255. HTT_CHECK_SET_VAL(HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES, _val); \
  8256. ((_var) |= ((_val) << HTT_H2T_HOST_PADDR_SIZE_NUM_ENTRIES_S)); \
  8257. } while (0)
  8258. /**
  8259. * @brief host --> target Host RXDMA RXOLE PPE register configuration
  8260. *
  8261. * MSG_TYPE => HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG
  8262. *
  8263. * @details
  8264. * The HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG message is sent by the host to
  8265. * provide the PPE DS register confiuration for RXOLE and RXDMA.
  8266. *
  8267. * The message would appear as follows:
  8268. *
  8269. * |31 19|18 |17 |16 |15 |14 |13 9|8|7 0|
  8270. * |---------------------------------+---+---+----------+-+-----------|
  8271. * | reserved |IFO|DNO|DRO|IBO|MIO| RDI |O| msg_type |
  8272. * |---------------------+---+---+---+---+---+----------+-+-----------|
  8273. *
  8274. *
  8275. * The message is interpreted as follows:
  8276. * dword0 - b'0:7 - msg_type: This will be set to
  8277. * 0x19 (HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG)
  8278. * b'8 - override bit to drive MSDUs to PPE ring
  8279. * b'9:13 - REO destination ring indication
  8280. * b'14 - Multi buffer msdu override enable bit
  8281. * b'15 - Intra BSS override
  8282. * b'16 - Decap raw override
  8283. * b'17 - Decap Native wifi override
  8284. * b'18 - IP frag override
  8285. * b'19:31 - reserved
  8286. */
  8287. PREPACK struct htt_h2t_msg_type_rxdma_rxole_ppe_cfg_t {
  8288. A_UINT32 msg_type: 8, /* HTT_H2T_MSG_TYPE_RXDMA_RXOLE_PPE_CFG */
  8289. override: 1,
  8290. reo_destination_indication: 5,
  8291. multi_buffer_msdu_override_en: 1,
  8292. intra_bss_override: 1,
  8293. decap_raw_override: 1,
  8294. decap_nwifi_override: 1,
  8295. ip_frag_override: 1,
  8296. reserved: 13;
  8297. } POSTPACK;
  8298. /* DWORD 0: Override */
  8299. #define HTT_PPE_CFG_OVERRIDE_M 0x00000100
  8300. #define HTT_PPE_CFG_OVERRIDE_S 8
  8301. #define HTT_PPE_CFG_OVERRIDE_GET(_var) \
  8302. (((_var) & HTT_PPE_CFG_OVERRIDE_M) >> \
  8303. HTT_PPE_CFG_OVERRIDE_S)
  8304. #define HTT_PPE_CFG_OVERRIDE_SET(_var, _val) \
  8305. do { \
  8306. HTT_CHECK_SET_VAL(HTT_PPE_CFG_OVERRIDE, _val); \
  8307. ((_var) |= ((_val) << HTT_PPE_CFG_OVERRIDE_S)); \
  8308. } while (0)
  8309. /* DWORD 0: REO Destination Indication*/
  8310. #define HTT_PPE_CFG_REO_DEST_IND_M 0x00003E00
  8311. #define HTT_PPE_CFG_REO_DEST_IND_S 9
  8312. #define HTT_PPE_CFG_REO_DEST_IND_GET(_var) \
  8313. (((_var) & HTT_PPE_CFG_REO_DEST_IND_M) >> \
  8314. HTT_PPE_CFG_REO_DEST_IND_S)
  8315. #define HTT_PPE_CFG_REO_DEST_IND_SET(_var, _val) \
  8316. do { \
  8317. HTT_CHECK_SET_VAL(HTT_PPE_CFG_REO_DEST_IND, _val); \
  8318. ((_var) |= ((_val) << HTT_PPE_CFG_REO_DEST_IND_S)); \
  8319. } while (0)
  8320. /* DWORD 0: Multi buffer MSDU override */
  8321. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M 0x00004000
  8322. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S 14
  8323. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_GET(_var) \
  8324. (((_var) & HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_M) >> \
  8325. HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)
  8326. #define HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_SET(_var, _val) \
  8327. do { \
  8328. HTT_CHECK_SET_VAL(HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN, _val); \
  8329. ((_var) |= ((_val) << HTT_PPE_CFG_MULTI_BUF_MSDU_OVERRIDE_EN_S)); \
  8330. } while (0)
  8331. /* DWORD 0: Intra BSS override */
  8332. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M 0x00008000
  8333. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S 15
  8334. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_GET(_var) \
  8335. (((_var) & HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_M) >> \
  8336. HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)
  8337. #define HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_SET(_var, _val) \
  8338. do { \
  8339. HTT_CHECK_SET_VAL(HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN, _val); \
  8340. ((_var) |= ((_val) << HTT_PPE_CFG_INTRA_BSS_OVERRIDE_EN_S)); \
  8341. } while (0)
  8342. /* DWORD 0: Decap RAW override */
  8343. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M 0x00010000
  8344. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S 16
  8345. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_GET(_var) \
  8346. (((_var) & HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_M) >> \
  8347. HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)
  8348. #define HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_SET(_var, _val) \
  8349. do { \
  8350. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN, _val); \
  8351. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_RAW_OVERRIDE_EN_S)); \
  8352. } while (0)
  8353. /* DWORD 0: Decap NWIFI override */
  8354. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M 0x00020000
  8355. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S 17
  8356. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_GET(_var) \
  8357. (((_var) & HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_M) >> \
  8358. HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)
  8359. #define HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_SET(_var, _val) \
  8360. do { \
  8361. HTT_CHECK_SET_VAL(HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN, _val); \
  8362. ((_var) |= ((_val) << HTT_PPE_CFG_DECAP_NWIFI_OVERRIDE_EN_S)); \
  8363. } while (0)
  8364. /* DWORD 0: IP frag override */
  8365. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M 0x00040000
  8366. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S 18
  8367. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_GET(_var) \
  8368. (((_var) & HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_M) >> \
  8369. HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)
  8370. #define HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_SET(_var, _val) \
  8371. do { \
  8372. HTT_CHECK_SET_VAL(HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN, _val); \
  8373. ((_var) |= ((_val) << HTT_PPE_CFG_IP_FRAG_OVERRIDE_EN_S)); \
  8374. } while (0)
  8375. /*
  8376. * MSG_TYPE => HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG
  8377. *
  8378. * @details
  8379. * The following field definitions describe the format of the HTT host
  8380. * to target FW VDEV TX RX stats retrieve message.
  8381. * The message specifies the type of stats the host wants to retrieve.
  8382. *
  8383. * |31 27|26 25|24 17|16|15 8|7 0|
  8384. * |-----------------------------------------------------------|
  8385. * | rsvd | R | Periodic Int| E| pdev_id | msg type |
  8386. * |-----------------------------------------------------------|
  8387. * | vdev_id lower bitmask |
  8388. * |-----------------------------------------------------------|
  8389. * | vdev_id upper bitmask |
  8390. * |-----------------------------------------------------------|
  8391. * Header fields:
  8392. * Where:
  8393. * dword0 - b'7:0 - msg_type: This will be set to
  8394. * 0x1a (HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG)
  8395. * b'15:8 - pdev id
  8396. * b'16(E) - Enable/Disable the vdev HW stats
  8397. * b'17:24(PI) - Periodic Interval, units = 8 ms, e.g. 125 -> 1000 ms
  8398. * b'25:26(R) - Reset stats bits
  8399. * 0: don't reset stats
  8400. * 1: reset stats once
  8401. * 2: reset stats at the start of each periodic interval
  8402. * b'27:31 - reserved for future use
  8403. * dword1 - b'0:31 - vdev_id lower bitmask
  8404. * dword2 - b'0:31 - vdev_id upper bitmask
  8405. */
  8406. PREPACK struct htt_h2t_vdevs_txrx_stats_cfg {
  8407. A_UINT32 msg_type :8,
  8408. pdev_id :8,
  8409. enable :1,
  8410. periodic_interval :8,
  8411. reset_stats_bits :2,
  8412. reserved0 :5;
  8413. A_UINT32 vdev_id_lower_bitmask;
  8414. A_UINT32 vdev_id_upper_bitmask;
  8415. } POSTPACK;
  8416. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M 0xFF00
  8417. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S 8
  8418. #define HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_GET(_var) \
  8419. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_M) >> \
  8420. HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)
  8421. #define HTT_RX_VDEVS_TXRX_STATS_PDEV_ID_SET(_var, _val) \
  8422. do { \
  8423. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID, _val); \
  8424. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PDEV_ID_S)); \
  8425. } while (0)
  8426. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M 0x10000
  8427. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S 16
  8428. #define HTT_H2T_VDEVS_TXRX_STATS_ENABLE_GET(_var) \
  8429. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_ENABLE_M) >> \
  8430. HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)
  8431. #define HTT_RX_VDEVS_TXRX_STATS_ENABLE_SET(_var, _val) \
  8432. do { \
  8433. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_ENABLE, _val); \
  8434. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_ENABLE_S)); \
  8435. } while (0)
  8436. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M 0x1FE0000
  8437. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S 17
  8438. #define HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_GET(_var) \
  8439. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_M) >> \
  8440. HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)
  8441. #define HTT_RX_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_SET(_var, _val) \
  8442. do { \
  8443. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL, _val); \
  8444. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_PERIODIC_INTERVAL_S)); \
  8445. } while (0)
  8446. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M 0x6000000
  8447. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S 25
  8448. #define HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_GET(_var) \
  8449. (((_var) & HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_M) >> \
  8450. HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)
  8451. #define HTT_RX_VDEVS_TXRX_STATS_RESET_STATS_BITS_SET(_var, _val) \
  8452. do { \
  8453. HTT_CHECK_SET_VAL(HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS, _val); \
  8454. ((_var) |= ((_val) << HTT_H2T_VDEVS_TXRX_STATS_RESET_STATS_BITS_S)); \
  8455. } while (0)
  8456. /*
  8457. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ
  8458. *
  8459. * @details
  8460. * The SAWF_DEF_QUEUES_MAP_REQ message is sent by the host to link
  8461. * the default MSDU queues for one of the TIDs within the specified peer
  8462. * to the specified service class.
  8463. * The TID is indirectly specified - each service class is associated
  8464. * with a TID. All default MSDU queues for this peer-TID will be
  8465. * linked to the service class in question.
  8466. *
  8467. * |31 16|15 8|7 0|
  8468. * |------------------------------+--------------+--------------|
  8469. * | peer ID | svc class ID | msg type |
  8470. * |------------------------------------------------------------|
  8471. * Header fields:
  8472. * dword0 - b'7:0 - msg_type: This will be set to
  8473. * 0x1c (HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ)
  8474. * b'15:8 - service class ID
  8475. * b'31:16 - peer ID
  8476. */
  8477. PREPACK struct htt_h2t_sawf_def_queues_map_req {
  8478. A_UINT32 msg_type :8,
  8479. svc_class_id :8,
  8480. peer_id :16;
  8481. } POSTPACK;
  8482. #define HTT_SAWF_DEF_QUEUES_MAP_REQ_BYTES 4
  8483. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8484. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S 8
  8485. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_GET(_var) \
  8486. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_M) >> \
  8487. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S)
  8488. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_SET(_var, _val) \
  8489. do { \
  8490. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID, _val); \
  8491. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_SVC_CLASS_ID_S));\
  8492. } while (0)
  8493. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M 0xFFFF0000
  8494. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S 16
  8495. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_GET(_var) \
  8496. (((_var) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_M) >> \
  8497. HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)
  8498. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_SET(_var, _val) \
  8499. do { \
  8500. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID, _val); \
  8501. ((_var) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REQ_PEER_ID_S)); \
  8502. } while (0)
  8503. /*
  8504. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ
  8505. *
  8506. * @details
  8507. * The SAWF_DEF_QUEUES_UNMAP_REQ message is sent by the host to
  8508. * remove the linkage of the specified peer-TID's MSDU queues to
  8509. * service classes.
  8510. *
  8511. * |31 16|15 8|7 0|
  8512. * |------------------------------+--------------+--------------|
  8513. * | peer ID | svc class ID | msg type |
  8514. * |------------------------------------------------------------|
  8515. * Header fields:
  8516. * dword0 - b'7:0 - msg_type: This will be set to
  8517. * 0x1d (HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ)
  8518. * b'15:8 - service class ID
  8519. * b'31:16 - peer ID
  8520. * A HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD
  8521. * value for peer ID indicates that the target should
  8522. * apply the UNMAP_REQ to all peers.
  8523. */
  8524. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_PEER_ID_WILDCARD 0xff
  8525. PREPACK struct htt_h2t_sawf_def_queues_unmap_req {
  8526. A_UINT32 msg_type :8,
  8527. svc_class_id :8,
  8528. peer_id :16;
  8529. } POSTPACK;
  8530. #define HTT_SAWF_DEF_QUEUES_UNMAP_REQ_BYTES 4
  8531. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M 0x0000FF00
  8532. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S 8
  8533. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_GET(word0) \
  8534. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_M) >> \
  8535. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)
  8536. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_SET(word0, _val) \
  8537. do { \
  8538. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID, _val); \
  8539. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_SVC_CLASS_ID_S)); \
  8540. } while (0)
  8541. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M 0xFFFF0000
  8542. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S 16
  8543. #define HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_GET(word0) \
  8544. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_M) >> \
  8545. HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)
  8546. #define HTT_RX_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_SET(word0, _val) \
  8547. do { \
  8548. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID, _val); \
  8549. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_UNMAP_REQ_PEER_ID_S)); \
  8550. } while (0)
  8551. /*
  8552. * MSG_TYPE => HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ
  8553. *
  8554. * @details
  8555. * The SAWF_DEF_QUEUES_MAP_REPORT_REQ message is sent by the host to
  8556. * request the target to report what service class the default MSDU queues
  8557. * of the specified TIDs within the peer are linked to.
  8558. * The target will respond with a SAWF_DEF_QUEUES_MAP_REPORT_CONF message
  8559. * to report what service class (if any) the default MSDU queues for
  8560. * each of the specified TIDs are linked to.
  8561. *
  8562. * |31 16|15 8|7 1| 0|
  8563. * |------------------------------+--------------+--------------|
  8564. * | peer ID | TID mask | msg type |
  8565. * |------------------------------------------------------------|
  8566. * | reserved |ETO|
  8567. * |------------------------------------------------------------|
  8568. * Header fields:
  8569. * dword0 - b'7:0 - msg_type: This will be set to
  8570. * 0x1e (HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ)
  8571. * b'15:8 - TID mask
  8572. * b'31:16 - peer ID
  8573. * dword1 - b'0 - "Existing Tids Only" flag
  8574. * If this flag is set, the DEF_QUEUES_MAP_REPORT_CONF
  8575. * message generated by this REQ will only show the
  8576. * mapping for TIDs that actually exist in the target's
  8577. * peer object.
  8578. * Any TIDs that are covered by a MAP_REQ but which
  8579. * do not actually exist will be shown as being
  8580. * unmapped (i.e. svc class ID 0xff).
  8581. * If this flag is cleared, the MAP_REPORT_CONF message
  8582. * will consider not only the mapping of TIDs currently
  8583. * existing in the peer, but also the mapping that will
  8584. * be applied for any TID objects created within this
  8585. * peer in the future.
  8586. * b'31:1 - reserved for future use
  8587. */
  8588. PREPACK struct htt_h2t_sawf_def_queues_map_report_req {
  8589. A_UINT32 msg_type :8,
  8590. tid_mask :8,
  8591. peer_id :16;
  8592. A_UINT32 existing_tids_only:1,
  8593. reserved :31;
  8594. } POSTPACK;
  8595. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_REQ_BYTES 8
  8596. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M 0x0000FF00
  8597. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S 8
  8598. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_GET(word0) \
  8599. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_M) >> \
  8600. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S)
  8601. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_SET(word0, _val) \
  8602. do { \
  8603. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK, _val); \
  8604. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_TID_MASK_S));\
  8605. } while (0)
  8606. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M 0xFFFF0000
  8607. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S 16
  8608. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_GET(word0) \
  8609. (((word0) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_M) >> \
  8610. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)
  8611. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_SET(word0, _val) \
  8612. do { \
  8613. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID, _val); \
  8614. ((word0) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_PEER_ID_S)); \
  8615. } while (0)
  8616. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M 0x00000001
  8617. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S 0
  8618. #define HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_GET(word1) \
  8619. (((word1) & HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_M) >> \
  8620. HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)
  8621. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_SET(word1, _val) \
  8622. do { \
  8623. HTT_CHECK_SET_VAL(HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY, _val); \
  8624. ((word1) |= ((_val) << HTT_H2T_SAWF_DEF_QUEUES_MAP_REPORT_REQ_EXISTING_TIDS_ONLY_S)); \
  8625. } while (0)
  8626. /*=== target -> host messages ===============================================*/
  8627. enum htt_t2h_msg_type {
  8628. HTT_T2H_MSG_TYPE_VERSION_CONF = 0x0,
  8629. HTT_T2H_MSG_TYPE_RX_IND = 0x1,
  8630. HTT_T2H_MSG_TYPE_RX_FLUSH = 0x2,
  8631. HTT_T2H_MSG_TYPE_PEER_MAP = 0x3,
  8632. HTT_T2H_MSG_TYPE_PEER_UNMAP = 0x4,
  8633. HTT_T2H_MSG_TYPE_RX_ADDBA = 0x5,
  8634. HTT_T2H_MSG_TYPE_RX_DELBA = 0x6,
  8635. HTT_T2H_MSG_TYPE_TX_COMPL_IND = 0x7,
  8636. HTT_T2H_MSG_TYPE_PKTLOG = 0x8,
  8637. HTT_T2H_MSG_TYPE_STATS_CONF = 0x9,
  8638. HTT_T2H_MSG_TYPE_RX_FRAG_IND = 0xa,
  8639. HTT_T2H_MSG_TYPE_SEC_IND = 0xb,
  8640. DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND = 0xc, /* no longer used */
  8641. HTT_T2H_MSG_TYPE_TX_INSPECT_IND = 0xd,
  8642. HTT_T2H_MSG_TYPE_MGMT_TX_COMPL_IND = 0xe,
  8643. /* only used for HL, add HTT MSG for HTT CREDIT update */
  8644. HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND = 0xf,
  8645. HTT_T2H_MSG_TYPE_RX_PN_IND = 0x10,
  8646. HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND = 0x11,
  8647. HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND = 0x12,
  8648. /* 0x13 is reserved for RX_RING_LOW_IND (RX Full reordering related) */
  8649. HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE = 0x14,
  8650. HTT_T2H_MSG_TYPE_CHAN_CHANGE = 0x15,
  8651. HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR = 0x16,
  8652. HTT_T2H_MSG_TYPE_RATE_REPORT = 0x17,
  8653. HTT_T2H_MSG_TYPE_FLOW_POOL_MAP = 0x18,
  8654. HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP = 0x19,
  8655. HTT_T2H_MSG_TYPE_SRING_SETUP_DONE = 0x1a,
  8656. HTT_T2H_MSG_TYPE_MAP_FLOW_INFO = 0x1b,
  8657. HTT_T2H_MSG_TYPE_EXT_STATS_CONF = 0x1c,
  8658. HTT_T2H_MSG_TYPE_PPDU_STATS_IND = 0x1d,
  8659. HTT_T2H_MSG_TYPE_PEER_MAP_V2 = 0x1e,
  8660. HTT_T2H_MSG_TYPE_PEER_UNMAP_V2 = 0x1f,
  8661. HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND = 0x20,
  8662. HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE = 0x21,
  8663. HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND = 0x22,
  8664. HTT_T2H_MSG_TYPE_PEER_STATS_IND = 0x23,
  8665. HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND = 0x24,
  8666. /* TX_OFFLOAD_DELIVER_IND:
  8667. * Forward the target's locally-generated packets to the host,
  8668. * to provide to the monitor mode interface.
  8669. */
  8670. HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND = 0x25,
  8671. HTT_T2H_MSG_TYPE_CHAN_CALDATA = 0x26,
  8672. HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND = 0x27,
  8673. HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND = 0x28,
  8674. HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP = 0x29,
  8675. HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP = 0x2a,
  8676. HTT_T2H_MSG_TYPE_PEER_MAP_V3 = 0x2b,
  8677. HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND = 0x2c,
  8678. HTT_T2H_MSG_TYPE_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d,
  8679. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF = 0x2d, /* alias */
  8680. HTT_T2H_MSG_TYPE_SAWF_MSDUQ_INFO_IND = 0x2e,
  8681. HTT_T2H_SAWF_MSDUQ_INFO_IND = 0x2e, /* alias */
  8682. HTT_T2H_MSG_TYPE_STREAMING_STATS_IND = 0x2f,
  8683. HTT_T2H_PPDU_ID_FMT_IND = 0x30,
  8684. HTT_T2H_MSG_TYPE_TEST,
  8685. /* keep this last */
  8686. HTT_T2H_NUM_MSGS
  8687. };
  8688. /*
  8689. * HTT target to host message type -
  8690. * stored in bits 7:0 of the first word of the message
  8691. */
  8692. #define HTT_T2H_MSG_TYPE_M 0xff
  8693. #define HTT_T2H_MSG_TYPE_S 0
  8694. #define HTT_T2H_MSG_TYPE_SET(word, msg_type) \
  8695. do { \
  8696. HTT_CHECK_SET_VAL(HTT_T2H_MSG_TYPE, msg_type); \
  8697. (word) |= ((msg_type) << HTT_T2H_MSG_TYPE_S); \
  8698. } while (0)
  8699. #define HTT_T2H_MSG_TYPE_GET(word) \
  8700. (((word) & HTT_T2H_MSG_TYPE_M) >> HTT_T2H_MSG_TYPE_S)
  8701. /**
  8702. * @brief target -> host version number confirmation message definition
  8703. *
  8704. * MSG_TYPE => HTT_T2H_MSG_TYPE_VERSION_CONF
  8705. *
  8706. * |31 24|23 16|15 8|7 0|
  8707. * |----------------+----------------+----------------+----------------|
  8708. * | reserved | major number | minor number | msg type |
  8709. * |-------------------------------------------------------------------|
  8710. * : option request TLV (optional) |
  8711. * :...................................................................:
  8712. *
  8713. * The VER_CONF message may consist of a single 4-byte word, or may be
  8714. * extended with TLVs that specify HTT options selected by the target.
  8715. * The following option TLVs may be appended to the VER_CONF message:
  8716. * - LL_BUS_ADDR_SIZE
  8717. * - HL_SUPPRESS_TX_COMPL_IND
  8718. * - MAX_TX_QUEUE_GROUPS
  8719. * These TLVs may appear in an arbitrary order. Any number of these TLVs
  8720. * may be appended to the VER_CONF message (but only one TLV of each type).
  8721. *
  8722. * Header fields:
  8723. * - MSG_TYPE
  8724. * Bits 7:0
  8725. * Purpose: identifies this as a version number confirmation message
  8726. * Value: 0x0 (HTT_T2H_MSG_TYPE_VERSION_CONF)
  8727. * - VER_MINOR
  8728. * Bits 15:8
  8729. * Purpose: Specify the minor number of the HTT message library version
  8730. * in use by the target firmware.
  8731. * The minor number specifies the specific revision within a range
  8732. * of fundamentally compatible HTT message definition revisions.
  8733. * Compatible revisions involve adding new messages or perhaps
  8734. * adding new fields to existing messages, in a backwards-compatible
  8735. * manner.
  8736. * Incompatible revisions involve changing the message type values,
  8737. * or redefining existing messages.
  8738. * Value: minor number
  8739. * - VER_MAJOR
  8740. * Bits 15:8
  8741. * Purpose: Specify the major number of the HTT message library version
  8742. * in use by the target firmware.
  8743. * The major number specifies the family of minor revisions that are
  8744. * fundamentally compatible with each other, but not with prior or
  8745. * later families.
  8746. * Value: major number
  8747. */
  8748. #define HTT_VER_CONF_MINOR_M 0x0000ff00
  8749. #define HTT_VER_CONF_MINOR_S 8
  8750. #define HTT_VER_CONF_MAJOR_M 0x00ff0000
  8751. #define HTT_VER_CONF_MAJOR_S 16
  8752. #define HTT_VER_CONF_MINOR_SET(word, value) \
  8753. do { \
  8754. HTT_CHECK_SET_VAL(HTT_VER_CONF_MINOR, value); \
  8755. (word) |= (value) << HTT_VER_CONF_MINOR_S; \
  8756. } while (0)
  8757. #define HTT_VER_CONF_MINOR_GET(word) \
  8758. (((word) & HTT_VER_CONF_MINOR_M) >> HTT_VER_CONF_MINOR_S)
  8759. #define HTT_VER_CONF_MAJOR_SET(word, value) \
  8760. do { \
  8761. HTT_CHECK_SET_VAL(HTT_VER_CONF_MAJOR, value); \
  8762. (word) |= (value) << HTT_VER_CONF_MAJOR_S; \
  8763. } while (0)
  8764. #define HTT_VER_CONF_MAJOR_GET(word) \
  8765. (((word) & HTT_VER_CONF_MAJOR_M) >> HTT_VER_CONF_MAJOR_S)
  8766. #define HTT_VER_CONF_BYTES 4
  8767. /**
  8768. * @brief - target -> host HTT Rx In order indication message
  8769. *
  8770. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IN_ORD_PADDR_IND
  8771. *
  8772. * @details
  8773. *
  8774. * |31 24|23 |15|14|13|12|11|10|9|8|7|6|5|4 0|
  8775. * |----------------+-------------------+---------------------+---------------|
  8776. * | peer ID | P| F| O| ext TID | msg type |
  8777. * |--------------------------------------------------------------------------|
  8778. * | MSDU count | Reserved | vdev id |
  8779. * |--------------------------------------------------------------------------|
  8780. * | MSDU 0 bus address (bits 31:0) |
  8781. #if HTT_PADDR64
  8782. * | MSDU 0 bus address (bits 63:32) |
  8783. #endif
  8784. * |--------------------------------------------------------------------------|
  8785. * | MSDU info | MSDU 0 FW Desc | MSDU 0 Length |
  8786. * |--------------------------------------------------------------------------|
  8787. * | MSDU 1 bus address (bits 31:0) |
  8788. #if HTT_PADDR64
  8789. * | MSDU 1 bus address (bits 63:32) |
  8790. #endif
  8791. * |--------------------------------------------------------------------------|
  8792. * | MSDU info | MSDU 1 FW Desc | MSDU 1 Length |
  8793. * |--------------------------------------------------------------------------|
  8794. */
  8795. /** @brief - MSDU info byte for TCP_CHECKSUM_OFFLOAD use
  8796. *
  8797. * @details
  8798. * bits
  8799. * | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
  8800. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8801. * | reserved | is IP | is UDP | is TCP | is IPv6 |IP chksum| TCP/UDP |
  8802. * | | frag | | | | fail |chksum fail|
  8803. * |-----+----+-------+--------+--------+---------+---------+-----------|
  8804. * (see fw_rx_msdu_info def in wal_rx_desc.h)
  8805. */
  8806. struct htt_rx_in_ord_paddr_ind_hdr_t
  8807. {
  8808. A_UINT32 /* word 0 */
  8809. msg_type: 8,
  8810. ext_tid: 5,
  8811. offload: 1,
  8812. frag: 1,
  8813. pktlog: 1, /* tell host whether to store MSDUs referenced in this message in pktlog */
  8814. peer_id: 16;
  8815. A_UINT32 /* word 1 */
  8816. vap_id: 8,
  8817. /* NOTE:
  8818. * This reserved_1 field is not truly reserved - certain targets use
  8819. * this field internally to store debug information, and do not zero
  8820. * out the contents of the field before uploading the message to the
  8821. * host. Thus, any host-target communication supported by this field
  8822. * is limited to using values that are never used by the debug
  8823. * information stored by certain targets in the reserved_1 field.
  8824. * In particular, the targets in question don't use the value 0x3
  8825. * within bits 7:6 of this field (i.e. bits 15:14 of the A_UINT32),
  8826. * so this previously-unused value within these bits is available to
  8827. * use as the host / target PKT_CAPTURE_MODE flag.
  8828. */
  8829. reserved_1: 8, /* reserved_1a: 6, pkt_capture_mode: 2, */
  8830. /* if pkt_capture_mode == 0x3, host should
  8831. * send rx frames to monitor mode interface
  8832. */
  8833. msdu_cnt: 16;
  8834. };
  8835. struct htt_rx_in_ord_paddr_ind_msdu32_t
  8836. {
  8837. A_UINT32 dma_addr;
  8838. A_UINT32
  8839. length: 16,
  8840. fw_desc: 8,
  8841. msdu_info:8;
  8842. };
  8843. struct htt_rx_in_ord_paddr_ind_msdu64_t
  8844. {
  8845. A_UINT32 dma_addr_lo;
  8846. A_UINT32 dma_addr_hi;
  8847. A_UINT32
  8848. length: 16,
  8849. fw_desc: 8,
  8850. msdu_info:8;
  8851. };
  8852. #if HTT_PADDR64
  8853. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu64_t
  8854. #else
  8855. #define htt_rx_in_ord_paddr_ind_msdu_t htt_rx_in_ord_paddr_ind_msdu32_t
  8856. #endif
  8857. #define HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_hdr_t))
  8858. #define HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS (HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES >> 2)
  8859. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTE_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_BYTES
  8860. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORD_OFFSET HTT_RX_IN_ORD_PADDR_IND_HDR_DWORDS
  8861. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu64_t))
  8862. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_64 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_64 >> 2)
  8863. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 (sizeof(struct htt_rx_in_ord_paddr_ind_msdu32_t))
  8864. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS_32 (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES_32 >> 2)
  8865. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES (sizeof(struct htt_rx_in_ord_paddr_ind_msdu_t))
  8866. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_DWORDS (HTT_RX_IN_ORD_PADDR_IND_MSDU_BYTES >> 2)
  8867. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M 0x00001f00
  8868. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S 8
  8869. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M 0x00002000
  8870. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S 13
  8871. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_M 0x00004000
  8872. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_S 14
  8873. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M 0x00008000
  8874. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S 15
  8875. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M 0xffff0000
  8876. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S 16
  8877. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M 0x000000ff
  8878. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S 0
  8879. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M 0x0000c000
  8880. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S 14
  8881. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M 0xffff0000
  8882. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S 16
  8883. /* for systems using 64-bit format for bus addresses */
  8884. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M 0xffffffff
  8885. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S 0
  8886. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M 0xffffffff
  8887. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S 0
  8888. /* for systems using 32-bit format for bus addresses */
  8889. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_M 0xffffffff
  8890. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_S 0
  8891. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M 0x0000ffff
  8892. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S 0
  8893. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M 0x00ff0000
  8894. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S 16
  8895. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M 0xff000000
  8896. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S 24
  8897. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_SET(word, value) \
  8898. do { \
  8899. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_EXT_TID, value); \
  8900. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S; \
  8901. } while (0)
  8902. #define HTT_RX_IN_ORD_PADDR_IND_EXT_TID_GET(word) \
  8903. (((word) & HTT_RX_IN_ORD_PADDR_IND_EXT_TID_M) >> HTT_RX_IN_ORD_PADDR_IND_EXT_TID_S)
  8904. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_SET(word, value) \
  8905. do { \
  8906. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PEER_ID, value); \
  8907. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S; \
  8908. } while (0)
  8909. #define HTT_RX_IN_ORD_PADDR_IND_PEER_ID_GET(word) \
  8910. (((word) & HTT_RX_IN_ORD_PADDR_IND_PEER_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_PEER_ID_S)
  8911. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_SET(word, value) \
  8912. do { \
  8913. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_VAP_ID, value); \
  8914. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S; \
  8915. } while (0)
  8916. #define HTT_RX_IN_ORD_PADDR_IND_VAP_ID_GET(word) \
  8917. (((word) & HTT_RX_IN_ORD_PADDR_IND_VAP_ID_M) >> HTT_RX_IN_ORD_PADDR_IND_VAP_ID_S)
  8918. /*
  8919. * If the PKT_CAPTURE_MODE flags value is MONITOR (0x3), the host should
  8920. * deliver the rx frames to the monitor mode interface.
  8921. * The HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET macro
  8922. * sets the PKT_CAPTURE_MODE flags value to MONITOR, and the
  8923. * HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET macro
  8924. * checks whether the PKT_CAPTURE_MODE flags value is MONITOR.
  8925. */
  8926. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR 0x3
  8927. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR_SET(word) \
  8928. do { \
  8929. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE, HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR); \
  8930. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S; \
  8931. } while (0)
  8932. #define HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_IS_MONITOR_SET(word) \
  8933. ((((word) & HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_M) >> HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_S) == \
  8934. HTT_RX_IN_ORD_PADDR_IND_PKT_CAPTURE_MODE_MONITOR)
  8935. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_SET(word, value) \
  8936. do { \
  8937. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT, value); \
  8938. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S; \
  8939. } while (0)
  8940. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_GET(word) \
  8941. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_CNT_S)
  8942. /* for systems using 64-bit format for bus addresses */
  8943. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_SET(word, value) \
  8944. do { \
  8945. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_HI, value); \
  8946. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S; \
  8947. } while (0)
  8948. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_GET(word) \
  8949. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_HI_S)
  8950. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_SET(word, value) \
  8951. do { \
  8952. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR_LO, value); \
  8953. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S; \
  8954. } while (0)
  8955. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_GET(word) \
  8956. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_LO_S)
  8957. /* for systems using 32-bit format for bus addresses */
  8958. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_SET(word, value) \
  8959. do { \
  8960. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PADDR, value); \
  8961. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PADDR_S; \
  8962. } while (0)
  8963. #define HTT_RX_IN_ORD_PADDR_IND_PADDR_GET(word) \
  8964. (((word) & HTT_RX_IN_ORD_PADDR_IND_PADDR_M) >> HTT_RX_IN_ORD_PADDR_IND_PADDR_S)
  8965. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_SET(word, value) \
  8966. do { \
  8967. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN, value); \
  8968. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S; \
  8969. } while (0)
  8970. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_GET(word) \
  8971. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_LEN_S)
  8972. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_SET(word, value) \
  8973. do { \
  8974. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_FW_DESC, value); \
  8975. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S; \
  8976. } while (0)
  8977. #define HTT_RX_IN_ORD_PADDR_IND_FW_DESC_GET(word) \
  8978. (((word) & HTT_RX_IN_ORD_PADDR_IND_FW_DESC_M) >> HTT_RX_IN_ORD_PADDR_IND_FW_DESC_S)
  8979. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_SET(word, value) \
  8980. do { \
  8981. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO, value); \
  8982. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S; \
  8983. } while (0)
  8984. #define HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_GET(word) \
  8985. (((word) & HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_M) >> HTT_RX_IN_ORD_PADDR_IND_MSDU_INFO_S)
  8986. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_SET(word, value) \
  8987. do { \
  8988. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_OFFLOAD, value); \
  8989. (word) |= (value) << HTT_RX_IN_ORD_IND_OFFLOAD_S; \
  8990. } while (0)
  8991. #define HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_GET(word) \
  8992. (((word) & HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_M) >> HTT_RX_IN_ORD_PADDR_IND_OFFLOAD_S)
  8993. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_SET(word, value) \
  8994. do { \
  8995. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_IND_FRAG, value); \
  8996. (word) |= (value) << HTT_RX_IN_ORD_IND_FRAG_S; \
  8997. } while (0)
  8998. #define HTT_RX_IN_ORD_PADDR_IND_FRAG_GET(word) \
  8999. (((word) & HTT_RX_IN_ORD_PADDR_IND_FRAG_M) >> HTT_RX_IN_ORD_PADDR_IND_FRAG_S)
  9000. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_SET(word, value) \
  9001. do { \
  9002. HTT_CHECK_SET_VAL(HTT_RX_IN_ORD_PADDR_IND_PKTLOG, value); \
  9003. (word) |= (value) << HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S; \
  9004. } while (0)
  9005. #define HTT_RX_IN_ORD_PADDR_IND_PKTLOG_GET(word) \
  9006. (((word) & HTT_RX_IN_ORD_PADDR_IND_PKTLOG_M) >> HTT_RX_IN_ORD_PADDR_IND_PKTLOG_S)
  9007. /* definitions used within target -> host rx indication message */
  9008. PREPACK struct htt_rx_ind_hdr_prefix_t
  9009. {
  9010. A_UINT32 /* word 0 */
  9011. msg_type: 8,
  9012. ext_tid: 5,
  9013. release_valid: 1,
  9014. flush_valid: 1,
  9015. reserved0: 1,
  9016. peer_id: 16;
  9017. A_UINT32 /* word 1 */
  9018. flush_start_seq_num: 6,
  9019. flush_end_seq_num: 6,
  9020. release_start_seq_num: 6,
  9021. release_end_seq_num: 6,
  9022. num_mpdu_ranges: 8;
  9023. } POSTPACK;
  9024. #define HTT_RX_IND_HDR_PREFIX_BYTES (sizeof(struct htt_rx_ind_hdr_prefix_t))
  9025. #define HTT_RX_IND_HDR_PREFIX_SIZE32 (HTT_RX_IND_HDR_PREFIX_BYTES >> 2)
  9026. #define HTT_TGT_RSSI_INVALID 0x80
  9027. PREPACK struct htt_rx_ppdu_desc_t
  9028. {
  9029. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI_CMB 0
  9030. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_SUBMICROSEC 0
  9031. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR_CODE 0
  9032. #define HTT_RX_IND_PPDU_OFFSET_WORD_PHY_ERR 0
  9033. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE 0
  9034. #define HTT_RX_IND_PPDU_OFFSET_WORD_LEGACY_RATE_SEL 0
  9035. #define HTT_RX_IND_PPDU_OFFSET_WORD_END_VALID 0
  9036. #define HTT_RX_IND_PPDU_OFFSET_WORD_START_VALID 0
  9037. A_UINT32 /* word 0 */
  9038. rssi_cmb: 8,
  9039. timestamp_submicrosec: 8,
  9040. phy_err_code: 8,
  9041. phy_err: 1,
  9042. legacy_rate: 4,
  9043. legacy_rate_sel: 1,
  9044. end_valid: 1,
  9045. start_valid: 1;
  9046. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI0 1
  9047. union {
  9048. A_UINT32 /* word 1 */
  9049. rssi0_pri20: 8,
  9050. rssi0_ext20: 8,
  9051. rssi0_ext40: 8,
  9052. rssi0_ext80: 8;
  9053. A_UINT32 rssi0; /* access all 20/40/80 per-bandwidth RSSIs together */
  9054. } u0;
  9055. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI1 2
  9056. union {
  9057. A_UINT32 /* word 2 */
  9058. rssi1_pri20: 8,
  9059. rssi1_ext20: 8,
  9060. rssi1_ext40: 8,
  9061. rssi1_ext80: 8;
  9062. A_UINT32 rssi1; /* access all 20/40/80 per-bandwidth RSSIs together */
  9063. } u1;
  9064. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI2 3
  9065. union {
  9066. A_UINT32 /* word 3 */
  9067. rssi2_pri20: 8,
  9068. rssi2_ext20: 8,
  9069. rssi2_ext40: 8,
  9070. rssi2_ext80: 8;
  9071. A_UINT32 rssi2; /* access all 20/40/80 per-bandwidth RSSIs together */
  9072. } u2;
  9073. #define HTT_RX_IND_PPDU_OFFSET_WORD_RSSI3 4
  9074. union {
  9075. A_UINT32 /* word 4 */
  9076. rssi3_pri20: 8,
  9077. rssi3_ext20: 8,
  9078. rssi3_ext40: 8,
  9079. rssi3_ext80: 8;
  9080. A_UINT32 rssi3; /* access all 20/40/80 per-bandwidth RSSIs together */
  9081. } u3;
  9082. #define HTT_RX_IND_PPDU_OFFSET_WORD_TSF32 5
  9083. A_UINT32 tsf32; /* word 5 */
  9084. #define HTT_RX_IND_PPDU_OFFSET_WORD_TIMESTAMP_MICROSEC 6
  9085. A_UINT32 timestamp_microsec; /* word 6 */
  9086. #define HTT_RX_IND_PPDU_OFFSET_WORD_PREAMBLE_TYPE 7
  9087. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A1 7
  9088. A_UINT32 /* word 7 */
  9089. vht_sig_a1: 24,
  9090. preamble_type: 8;
  9091. #define HTT_RX_IND_PPDU_OFFSET_WORD_VHT_SIG_A2 8
  9092. #define HTT_RX_IND_PPDU_OFFSET_WORD_SA_ANT_MATRIX 8
  9093. A_UINT32 /* word 8 */
  9094. vht_sig_a2: 24,
  9095. /* sa_ant_matrix
  9096. * For cases where a single rx chain has options to be connected to
  9097. * different rx antennas, show which rx antennas were in use during
  9098. * receipt of a given PPDU.
  9099. * This sa_ant_matrix provides a bitmask of the antennas used while
  9100. * receiving this frame.
  9101. */
  9102. sa_ant_matrix: 8;
  9103. } POSTPACK;
  9104. #define HTT_RX_PPDU_DESC_BYTES (sizeof(struct htt_rx_ppdu_desc_t))
  9105. #define HTT_RX_PPDU_DESC_SIZE32 (HTT_RX_PPDU_DESC_BYTES >> 2)
  9106. PREPACK struct htt_rx_ind_hdr_suffix_t
  9107. {
  9108. A_UINT32 /* word 0 */
  9109. fw_rx_desc_bytes: 16,
  9110. reserved0: 16;
  9111. } POSTPACK;
  9112. #define HTT_RX_IND_HDR_SUFFIX_BYTES (sizeof(struct htt_rx_ind_hdr_suffix_t))
  9113. #define HTT_RX_IND_HDR_SUFFIX_SIZE32 (HTT_RX_IND_HDR_SUFFIX_BYTES >> 2)
  9114. PREPACK struct htt_rx_ind_hdr_t
  9115. {
  9116. struct htt_rx_ind_hdr_prefix_t prefix;
  9117. struct htt_rx_ppdu_desc_t rx_ppdu_desc;
  9118. struct htt_rx_ind_hdr_suffix_t suffix;
  9119. } POSTPACK;
  9120. #define HTT_RX_IND_HDR_BYTES (sizeof(struct htt_rx_ind_hdr_t))
  9121. #define HTT_RX_IND_HDR_SIZE32 (HTT_RX_IND_HDR_BYTES >> 2)
  9122. /* confirm that HTT_RX_IND_HDR_BYTES is a multiple of 4 */
  9123. A_COMPILE_TIME_ASSERT(HTT_RX_IND_hdr_size_quantum,
  9124. (HTT_RX_IND_HDR_BYTES & 0x3) == 0);
  9125. /*
  9126. * HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET:
  9127. * the offset into the HTT rx indication message at which the
  9128. * FW rx PPDU descriptor resides
  9129. */
  9130. #define HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET HTT_RX_IND_HDR_PREFIX_BYTES
  9131. /*
  9132. * HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET:
  9133. * the offset into the HTT rx indication message at which the
  9134. * header suffix (FW rx MSDU byte count) resides
  9135. */
  9136. #define HTT_RX_IND_HDR_SUFFIX_BYTE_OFFSET \
  9137. (HTT_RX_IND_FW_RX_PPDU_DESC_BYTE_OFFSET + HTT_RX_PPDU_DESC_BYTES)
  9138. /*
  9139. * HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET:
  9140. * the offset into the HTT rx indication message at which the per-MSDU
  9141. * information starts
  9142. * Bytes 0-7 are the message header; bytes 8-11 contain the length of the
  9143. * per-MSDU information portion of the message. The per-MSDU info itself
  9144. * starts at byte 12.
  9145. */
  9146. #define HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET HTT_RX_IND_HDR_BYTES
  9147. /**
  9148. * @brief target -> host rx indication message definition
  9149. *
  9150. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_IND
  9151. *
  9152. * @details
  9153. * The following field definitions describe the format of the rx indication
  9154. * message sent from the target to the host.
  9155. * The message consists of three major sections:
  9156. * 1. a fixed-length header
  9157. * 2. a variable-length list of firmware rx MSDU descriptors
  9158. * 3. one or more 4-octet MPDU range information elements
  9159. * The fixed length header itself has two sub-sections
  9160. * 1. the message meta-information, including identification of the
  9161. * sender and type of the received data, and a 4-octet flush/release IE
  9162. * 2. the firmware rx PPDU descriptor
  9163. *
  9164. * The format of the message is depicted below.
  9165. * in this depiction, the following abbreviations are used for information
  9166. * elements within the message:
  9167. * - SV - start valid: this flag is set if the FW rx PPDU descriptor
  9168. * elements associated with the PPDU start are valid.
  9169. * Specifically, the following fields are valid only if SV is set:
  9170. * RSSI (all variants), L, legacy rate, preamble type, service,
  9171. * VHT-SIG-A
  9172. * - EV - end valid: this flag is set if the FW rx PPDU descriptor
  9173. * elements associated with the PPDU end are valid.
  9174. * Specifically, the following fields are valid only if EV is set:
  9175. * P, PHY err code, TSF, microsec / sub-microsec timestamp
  9176. * - L - Legacy rate selector - if legacy rates are used, this flag
  9177. * indicates whether the rate is from a CCK (L == 1) or OFDM
  9178. * (L == 0) PHY.
  9179. * - P - PHY error flag - boolean indication of whether the rx frame had
  9180. * a PHY error
  9181. *
  9182. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  9183. * |----------------+-------------------+---------------------+---------------|
  9184. * | peer ID | |RV|FV| ext TID | msg type |
  9185. * |--------------------------------------------------------------------------|
  9186. * | num | release | release | flush | flush |
  9187. * | MPDU | end | start | end | start |
  9188. * | ranges | seq num | seq num | seq num | seq num |
  9189. * |==========================================================================|
  9190. * |S|E|L| legacy |P| PHY err code | sub-microsec | combined |
  9191. * |V|V| | rate | | | timestamp | RSSI |
  9192. * |--------------------------------------------------------------------------|
  9193. * | RSSI rx0 ext80 | RSSI rx0 ext40 | RSSI rx0 ext20 | RSSI rx0 pri20|
  9194. * |--------------------------------------------------------------------------|
  9195. * | RSSI rx1 ext80 | RSSI rx1 ext40 | RSSI rx1 ext20 | RSSI rx1 pri20|
  9196. * |--------------------------------------------------------------------------|
  9197. * | RSSI rx2 ext80 | RSSI rx2 ext40 | RSSI rx2 ext20 | RSSI rx2 pri20|
  9198. * |--------------------------------------------------------------------------|
  9199. * | RSSI rx3 ext80 | RSSI rx3 ext40 | RSSI rx3 ext20 | RSSI rx3 pri20|
  9200. * |--------------------------------------------------------------------------|
  9201. * | TSF LSBs |
  9202. * |--------------------------------------------------------------------------|
  9203. * | microsec timestamp |
  9204. * |--------------------------------------------------------------------------|
  9205. * | preamble type | HT-SIG / VHT-SIG-A1 |
  9206. * |--------------------------------------------------------------------------|
  9207. * | service | HT-SIG / VHT-SIG-A2 |
  9208. * |==========================================================================|
  9209. * | reserved | FW rx desc bytes |
  9210. * |--------------------------------------------------------------------------|
  9211. * | MSDU Rx | MSDU Rx | MSDU Rx | MSDU Rx |
  9212. * | desc B3 | desc B2 | desc B1 | desc B0 |
  9213. * |--------------------------------------------------------------------------|
  9214. * : : :
  9215. * |--------------------------------------------------------------------------|
  9216. * | alignment | MSDU Rx |
  9217. * | padding | desc Bn |
  9218. * |--------------------------------------------------------------------------|
  9219. * | reserved | MPDU range status | MPDU count |
  9220. * |--------------------------------------------------------------------------|
  9221. * : reserved : MPDU range status : MPDU count :
  9222. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - :
  9223. *
  9224. * Header fields:
  9225. * - MSG_TYPE
  9226. * Bits 7:0
  9227. * Purpose: identifies this as an rx indication message
  9228. * Value: 0x1 (HTT_T2H_MSG_TYPE_RX_IND)
  9229. * - EXT_TID
  9230. * Bits 12:8
  9231. * Purpose: identify the traffic ID of the rx data, including
  9232. * special "extended" TID values for multicast, broadcast, and
  9233. * non-QoS data frames
  9234. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  9235. * - FLUSH_VALID (FV)
  9236. * Bit 13
  9237. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  9238. * is valid
  9239. * Value:
  9240. * 1 -> flush IE is valid and needs to be processed
  9241. * 0 -> flush IE is not valid and should be ignored
  9242. * - REL_VALID (RV)
  9243. * Bit 13
  9244. * Purpose: indicate whether the release IE (start/end sequence numbers)
  9245. * is valid
  9246. * Value:
  9247. * 1 -> release IE is valid and needs to be processed
  9248. * 0 -> release IE is not valid and should be ignored
  9249. * - PEER_ID
  9250. * Bits 31:16
  9251. * Purpose: Identify, by ID, which peer sent the rx data
  9252. * Value: ID of the peer who sent the rx data
  9253. * - FLUSH_SEQ_NUM_START
  9254. * Bits 5:0
  9255. * Purpose: Indicate the start of a series of MPDUs to flush
  9256. * Not all MPDUs within this series are necessarily valid - the host
  9257. * must check each sequence number within this range to see if the
  9258. * corresponding MPDU is actually present.
  9259. * This field is only valid if the FV bit is set.
  9260. * Value:
  9261. * The sequence number for the first MPDUs to check to flush.
  9262. * The sequence number is masked by 0x3f.
  9263. * - FLUSH_SEQ_NUM_END
  9264. * Bits 11:6
  9265. * Purpose: Indicate the end of a series of MPDUs to flush
  9266. * Value:
  9267. * The sequence number one larger than the sequence number of the
  9268. * last MPDU to check to flush.
  9269. * The sequence number is masked by 0x3f.
  9270. * Not all MPDUs within this series are necessarily valid - the host
  9271. * must check each sequence number within this range to see if the
  9272. * corresponding MPDU is actually present.
  9273. * This field is only valid if the FV bit is set.
  9274. * - REL_SEQ_NUM_START
  9275. * Bits 17:12
  9276. * Purpose: Indicate the start of a series of MPDUs to release.
  9277. * All MPDUs within this series are present and valid - the host
  9278. * need not check each sequence number within this range to see if
  9279. * the corresponding MPDU is actually present.
  9280. * This field is only valid if the RV bit is set.
  9281. * Value:
  9282. * The sequence number for the first MPDUs to check to release.
  9283. * The sequence number is masked by 0x3f.
  9284. * - REL_SEQ_NUM_END
  9285. * Bits 23:18
  9286. * Purpose: Indicate the end of a series of MPDUs to release.
  9287. * Value:
  9288. * The sequence number one larger than the sequence number of the
  9289. * last MPDU to check to release.
  9290. * The sequence number is masked by 0x3f.
  9291. * All MPDUs within this series are present and valid - the host
  9292. * need not check each sequence number within this range to see if
  9293. * the corresponding MPDU is actually present.
  9294. * This field is only valid if the RV bit is set.
  9295. * - NUM_MPDU_RANGES
  9296. * Bits 31:24
  9297. * Purpose: Indicate how many ranges of MPDUs are present.
  9298. * Each MPDU range consists of a series of contiguous MPDUs within the
  9299. * rx frame sequence which all have the same MPDU status.
  9300. * Value: 1-63 (typically a small number, like 1-3)
  9301. *
  9302. * Rx PPDU descriptor fields:
  9303. * - RSSI_CMB
  9304. * Bits 7:0
  9305. * Purpose: Combined RSSI from all active rx chains, across the active
  9306. * bandwidth.
  9307. * Value: RSSI dB units w.r.t. noise floor
  9308. * - TIMESTAMP_SUBMICROSEC
  9309. * Bits 15:8
  9310. * Purpose: high-resolution timestamp
  9311. * Value:
  9312. * Sub-microsecond time of PPDU reception.
  9313. * This timestamp ranges from [0,MAC clock MHz).
  9314. * This timestamp can be used in conjunction with TIMESTAMP_MICROSEC
  9315. * to form a high-resolution, large range rx timestamp.
  9316. * - PHY_ERR_CODE
  9317. * Bits 23:16
  9318. * Purpose:
  9319. * If the rx frame processing resulted in a PHY error, indicate what
  9320. * type of rx PHY error occurred.
  9321. * Value:
  9322. * This field is valid if the "P" (PHY_ERR) flag is set.
  9323. * TBD: document/specify the values for this field
  9324. * - PHY_ERR
  9325. * Bit 24
  9326. * Purpose: indicate whether the rx PPDU had a PHY error
  9327. * Value: 0 -> no rx PHY error, 1 -> rx PHY error encountered
  9328. * - LEGACY_RATE
  9329. * Bits 28:25
  9330. * Purpose:
  9331. * If the rx frame used a legacy rate rather than a HT or VHT rate,
  9332. * specify which rate was used.
  9333. * Value:
  9334. * The LEGACY_RATE field's value depends on the "L" (LEGACY_RATE_SEL)
  9335. * flag.
  9336. * If LEGACY_RATE_SEL is 0:
  9337. * 0x8: OFDM 48 Mbps
  9338. * 0x9: OFDM 24 Mbps
  9339. * 0xA: OFDM 12 Mbps
  9340. * 0xB: OFDM 6 Mbps
  9341. * 0xC: OFDM 54 Mbps
  9342. * 0xD: OFDM 36 Mbps
  9343. * 0xE: OFDM 18 Mbps
  9344. * 0xF: OFDM 9 Mbps
  9345. * If LEGACY_RATE_SEL is 1:
  9346. * 0x8: CCK 11 Mbps long preamble
  9347. * 0x9: CCK 5.5 Mbps long preamble
  9348. * 0xA: CCK 2 Mbps long preamble
  9349. * 0xB: CCK 1 Mbps long preamble
  9350. * 0xC: CCK 11 Mbps short preamble
  9351. * 0xD: CCK 5.5 Mbps short preamble
  9352. * 0xE: CCK 2 Mbps short preamble
  9353. * - LEGACY_RATE_SEL
  9354. * Bit 29
  9355. * Purpose: if rx used a legacy rate, specify whether it was OFDM or CCK
  9356. * Value:
  9357. * This field is valid if the PREAMBLE_TYPE field indicates the rx
  9358. * used a legacy rate.
  9359. * 0 -> OFDM, 1 -> CCK
  9360. * - END_VALID
  9361. * Bit 30
  9362. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9363. * the start of the PPDU are valid. Specifically, the following
  9364. * fields are only valid if END_VALID is set:
  9365. * PHY_ERR, PHY_ERR_CODE, TSF32, TIMESTAMP_MICROSEC,
  9366. * TIMESTAMP_SUBMICROSEC
  9367. * Value:
  9368. * 0 -> rx PPDU desc end fields are not valid
  9369. * 1 -> rx PPDU desc end fields are valid
  9370. * - START_VALID
  9371. * Bit 31
  9372. * Purpose: Indicate whether the FW rx PPDU desc fields associated with
  9373. * the end of the PPDU are valid. Specifically, the following
  9374. * fields are only valid if START_VALID is set:
  9375. * RSSI, LEGACY_RATE_SEL, LEGACY_RATE, PREAMBLE_TYPE, SERVICE,
  9376. * VHT-SIG-A
  9377. * Value:
  9378. * 0 -> rx PPDU desc start fields are not valid
  9379. * 1 -> rx PPDU desc start fields are valid
  9380. * - RSSI0_PRI20
  9381. * Bits 7:0
  9382. * Purpose: RSSI from chain 0 on the primary 20 MHz channel
  9383. * Value: RSSI dB units w.r.t. noise floor
  9384. *
  9385. * - RSSI0_EXT20
  9386. * Bits 7:0
  9387. * Purpose: RSSI from chain 0 on the bonded extension 20 MHz channel
  9388. * (if the rx bandwidth was >= 40 MHz)
  9389. * Value: RSSI dB units w.r.t. noise floor
  9390. * - RSSI0_EXT40
  9391. * Bits 7:0
  9392. * Purpose: RSSI from chain 0 on the bonded extension 40 MHz channel
  9393. * (if the rx bandwidth was >= 80 MHz)
  9394. * Value: RSSI dB units w.r.t. noise floor
  9395. * - RSSI0_EXT80
  9396. * Bits 7:0
  9397. * Purpose: RSSI from chain 0 on the bonded extension 80 MHz channel
  9398. * (if the rx bandwidth was >= 160 MHz)
  9399. * Value: RSSI dB units w.r.t. noise floor
  9400. *
  9401. * - RSSI1_PRI20
  9402. * Bits 7:0
  9403. * Purpose: RSSI from chain 1 on the primary 20 MHz channel
  9404. * Value: RSSI dB units w.r.t. noise floor
  9405. * - RSSI1_EXT20
  9406. * Bits 7:0
  9407. * Purpose: RSSI from chain 1 on the bonded extension 20 MHz channel
  9408. * (if the rx bandwidth was >= 40 MHz)
  9409. * Value: RSSI dB units w.r.t. noise floor
  9410. * - RSSI1_EXT40
  9411. * Bits 7:0
  9412. * Purpose: RSSI from chain 1 on the bonded extension 40 MHz channel
  9413. * (if the rx bandwidth was >= 80 MHz)
  9414. * Value: RSSI dB units w.r.t. noise floor
  9415. * - RSSI1_EXT80
  9416. * Bits 7:0
  9417. * Purpose: RSSI from chain 1 on the bonded extension 80 MHz channel
  9418. * (if the rx bandwidth was >= 160 MHz)
  9419. * Value: RSSI dB units w.r.t. noise floor
  9420. *
  9421. * - RSSI2_PRI20
  9422. * Bits 7:0
  9423. * Purpose: RSSI from chain 2 on the primary 20 MHz channel
  9424. * Value: RSSI dB units w.r.t. noise floor
  9425. * - RSSI2_EXT20
  9426. * Bits 7:0
  9427. * Purpose: RSSI from chain 2 on the bonded extension 20 MHz channel
  9428. * (if the rx bandwidth was >= 40 MHz)
  9429. * Value: RSSI dB units w.r.t. noise floor
  9430. * - RSSI2_EXT40
  9431. * Bits 7:0
  9432. * Purpose: RSSI from chain 2 on the bonded extension 40 MHz channel
  9433. * (if the rx bandwidth was >= 80 MHz)
  9434. * Value: RSSI dB units w.r.t. noise floor
  9435. * - RSSI2_EXT80
  9436. * Bits 7:0
  9437. * Purpose: RSSI from chain 2 on the bonded extension 80 MHz channel
  9438. * (if the rx bandwidth was >= 160 MHz)
  9439. * Value: RSSI dB units w.r.t. noise floor
  9440. *
  9441. * - RSSI3_PRI20
  9442. * Bits 7:0
  9443. * Purpose: RSSI from chain 3 on the primary 20 MHz channel
  9444. * Value: RSSI dB units w.r.t. noise floor
  9445. * - RSSI3_EXT20
  9446. * Bits 7:0
  9447. * Purpose: RSSI from chain 3 on the bonded extension 20 MHz channel
  9448. * (if the rx bandwidth was >= 40 MHz)
  9449. * Value: RSSI dB units w.r.t. noise floor
  9450. * - RSSI3_EXT40
  9451. * Bits 7:0
  9452. * Purpose: RSSI from chain 3 on the bonded extension 40 MHz channel
  9453. * (if the rx bandwidth was >= 80 MHz)
  9454. * Value: RSSI dB units w.r.t. noise floor
  9455. * - RSSI3_EXT80
  9456. * Bits 7:0
  9457. * Purpose: RSSI from chain 3 on the bonded extension 80 MHz channel
  9458. * (if the rx bandwidth was >= 160 MHz)
  9459. * Value: RSSI dB units w.r.t. noise floor
  9460. *
  9461. * - TSF32
  9462. * Bits 31:0
  9463. * Purpose: specify the time the rx PPDU was received, in TSF units
  9464. * Value: 32 LSBs of the TSF
  9465. * - TIMESTAMP_MICROSEC
  9466. * Bits 31:0
  9467. * Purpose: specify the time the rx PPDU was received, in microsecond units
  9468. * Value: PPDU rx time, in microseconds
  9469. * - VHT_SIG_A1
  9470. * Bits 23:0
  9471. * Purpose: Provide the HT-SIG (initial 24 bits) or VHT-SIG-A1 field
  9472. * from the rx PPDU
  9473. * Value:
  9474. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9475. * VHT-SIG-A1 data.
  9476. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9477. * first 24 bits of the HT-SIG data.
  9478. * Otherwise, this field is invalid.
  9479. * Refer to the the 802.11 protocol for the definition of the
  9480. * HT-SIG and VHT-SIG-A1 fields
  9481. * - VHT_SIG_A2
  9482. * Bits 23:0
  9483. * Purpose: Provide the HT-SIG (final 24 bits) or VHT-SIG-A2 field
  9484. * from the rx PPDU
  9485. * Value:
  9486. * If PREAMBLE_TYPE specifies VHT, then this field contains the
  9487. * VHT-SIG-A2 data.
  9488. * If PREAMBLE_TYPE specifies HT, then this field contains the
  9489. * last 24 bits of the HT-SIG data.
  9490. * Otherwise, this field is invalid.
  9491. * Refer to the the 802.11 protocol for the definition of the
  9492. * HT-SIG and VHT-SIG-A2 fields
  9493. * - PREAMBLE_TYPE
  9494. * Bits 31:24
  9495. * Purpose: indicate the PHY format of the received burst
  9496. * Value:
  9497. * 0x4: Legacy (OFDM/CCK)
  9498. * 0x8: HT
  9499. * 0x9: HT with TxBF
  9500. * 0xC: VHT
  9501. * 0xD: VHT with TxBF
  9502. * - SERVICE
  9503. * Bits 31:24
  9504. * Purpose: TBD
  9505. * Value: TBD
  9506. *
  9507. * Rx MSDU descriptor fields:
  9508. * - FW_RX_DESC_BYTES
  9509. * Bits 15:0
  9510. * Purpose: Indicate how many bytes in the Rx indication are used for
  9511. * FW Rx descriptors
  9512. *
  9513. * Payload fields:
  9514. * - MPDU_COUNT
  9515. * Bits 7:0
  9516. * Purpose: Indicate how many sequential MPDUs share the same status.
  9517. * All MPDUs within the indicated list are from the same RA-TA-TID.
  9518. * - MPDU_STATUS
  9519. * Bits 15:8
  9520. * Purpose: Indicate whether the (group of sequential) MPDU(s) were
  9521. * received successfully.
  9522. * Value:
  9523. * 0x1: success
  9524. * 0x2: FCS error
  9525. * 0x3: duplicate error
  9526. * 0x4: replay error
  9527. * 0x5: invalid peer
  9528. */
  9529. /* header fields */
  9530. #define HTT_RX_IND_EXT_TID_M 0x1f00
  9531. #define HTT_RX_IND_EXT_TID_S 8
  9532. #define HTT_RX_IND_FLUSH_VALID_M 0x2000
  9533. #define HTT_RX_IND_FLUSH_VALID_S 13
  9534. #define HTT_RX_IND_REL_VALID_M 0x4000
  9535. #define HTT_RX_IND_REL_VALID_S 14
  9536. #define HTT_RX_IND_PEER_ID_M 0xffff0000
  9537. #define HTT_RX_IND_PEER_ID_S 16
  9538. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_M 0x3f
  9539. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_S 0
  9540. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_M 0xfc0
  9541. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_S 6
  9542. #define HTT_RX_IND_REL_SEQ_NUM_START_M 0x3f000
  9543. #define HTT_RX_IND_REL_SEQ_NUM_START_S 12
  9544. #define HTT_RX_IND_REL_SEQ_NUM_END_M 0xfc0000
  9545. #define HTT_RX_IND_REL_SEQ_NUM_END_S 18
  9546. #define HTT_RX_IND_NUM_MPDU_RANGES_M 0xff000000
  9547. #define HTT_RX_IND_NUM_MPDU_RANGES_S 24
  9548. /* rx PPDU descriptor fields */
  9549. #define HTT_RX_IND_RSSI_CMB_M 0x000000ff
  9550. #define HTT_RX_IND_RSSI_CMB_S 0
  9551. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M 0x0000ff00
  9552. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S 8
  9553. #define HTT_RX_IND_PHY_ERR_CODE_M 0x00ff0000
  9554. #define HTT_RX_IND_PHY_ERR_CODE_S 16
  9555. #define HTT_RX_IND_PHY_ERR_M 0x01000000
  9556. #define HTT_RX_IND_PHY_ERR_S 24
  9557. #define HTT_RX_IND_LEGACY_RATE_M 0x1e000000
  9558. #define HTT_RX_IND_LEGACY_RATE_S 25
  9559. #define HTT_RX_IND_LEGACY_RATE_SEL_M 0x20000000
  9560. #define HTT_RX_IND_LEGACY_RATE_SEL_S 29
  9561. #define HTT_RX_IND_END_VALID_M 0x40000000
  9562. #define HTT_RX_IND_END_VALID_S 30
  9563. #define HTT_RX_IND_START_VALID_M 0x80000000
  9564. #define HTT_RX_IND_START_VALID_S 31
  9565. #define HTT_RX_IND_RSSI_PRI20_M 0x000000ff
  9566. #define HTT_RX_IND_RSSI_PRI20_S 0
  9567. #define HTT_RX_IND_RSSI_EXT20_M 0x0000ff00
  9568. #define HTT_RX_IND_RSSI_EXT20_S 8
  9569. #define HTT_RX_IND_RSSI_EXT40_M 0x00ff0000
  9570. #define HTT_RX_IND_RSSI_EXT40_S 16
  9571. #define HTT_RX_IND_RSSI_EXT80_M 0xff000000
  9572. #define HTT_RX_IND_RSSI_EXT80_S 24
  9573. #define HTT_RX_IND_VHT_SIG_A1_M 0x00ffffff
  9574. #define HTT_RX_IND_VHT_SIG_A1_S 0
  9575. #define HTT_RX_IND_VHT_SIG_A2_M 0x00ffffff
  9576. #define HTT_RX_IND_VHT_SIG_A2_S 0
  9577. #define HTT_RX_IND_PREAMBLE_TYPE_M 0xff000000
  9578. #define HTT_RX_IND_PREAMBLE_TYPE_S 24
  9579. #define HTT_RX_IND_SERVICE_M 0xff000000
  9580. #define HTT_RX_IND_SERVICE_S 24
  9581. #define HTT_RX_IND_SA_ANT_MATRIX_M 0xff000000
  9582. #define HTT_RX_IND_SA_ANT_MATRIX_S 24
  9583. /* rx MSDU descriptor fields */
  9584. #define HTT_RX_IND_FW_RX_DESC_BYTES_M 0xffff
  9585. #define HTT_RX_IND_FW_RX_DESC_BYTES_S 0
  9586. /* payload fields */
  9587. #define HTT_RX_IND_MPDU_COUNT_M 0xff
  9588. #define HTT_RX_IND_MPDU_COUNT_S 0
  9589. #define HTT_RX_IND_MPDU_STATUS_M 0xff00
  9590. #define HTT_RX_IND_MPDU_STATUS_S 8
  9591. #define HTT_RX_IND_EXT_TID_SET(word, value) \
  9592. do { \
  9593. HTT_CHECK_SET_VAL(HTT_RX_IND_EXT_TID, value); \
  9594. (word) |= (value) << HTT_RX_IND_EXT_TID_S; \
  9595. } while (0)
  9596. #define HTT_RX_IND_EXT_TID_GET(word) \
  9597. (((word) & HTT_RX_IND_EXT_TID_M) >> HTT_RX_IND_EXT_TID_S)
  9598. #define HTT_RX_IND_FLUSH_VALID_SET(word, value) \
  9599. do { \
  9600. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_VALID, value); \
  9601. (word) |= (value) << HTT_RX_IND_FLUSH_VALID_S; \
  9602. } while (0)
  9603. #define HTT_RX_IND_FLUSH_VALID_GET(word) \
  9604. (((word) & HTT_RX_IND_FLUSH_VALID_M) >> HTT_RX_IND_FLUSH_VALID_S)
  9605. #define HTT_RX_IND_REL_VALID_SET(word, value) \
  9606. do { \
  9607. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_VALID, value); \
  9608. (word) |= (value) << HTT_RX_IND_REL_VALID_S; \
  9609. } while (0)
  9610. #define HTT_RX_IND_REL_VALID_GET(word) \
  9611. (((word) & HTT_RX_IND_REL_VALID_M) >> HTT_RX_IND_REL_VALID_S)
  9612. #define HTT_RX_IND_PEER_ID_SET(word, value) \
  9613. do { \
  9614. HTT_CHECK_SET_VAL(HTT_RX_IND_PEER_ID, value); \
  9615. (word) |= (value) << HTT_RX_IND_PEER_ID_S; \
  9616. } while (0)
  9617. #define HTT_RX_IND_PEER_ID_GET(word) \
  9618. (((word) & HTT_RX_IND_PEER_ID_M) >> HTT_RX_IND_PEER_ID_S)
  9619. #define HTT_RX_IND_FW_RX_DESC_BYTES_SET(word, value) \
  9620. do { \
  9621. HTT_CHECK_SET_VAL(HTT_RX_IND_FW_RX_DESC_BYTES, value); \
  9622. (word) |= (value) << HTT_RX_IND_FW_RX_DESC_BYTES_S; \
  9623. } while (0)
  9624. #define HTT_RX_IND_FW_RX_DESC_BYTES_GET(word) \
  9625. (((word) & HTT_RX_IND_FW_RX_DESC_BYTES_M) >> HTT_RX_IND_FW_RX_DESC_BYTES_S)
  9626. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_SET(word, value) \
  9627. do { \
  9628. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_START, value); \
  9629. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_START_S; \
  9630. } while (0)
  9631. #define HTT_RX_IND_FLUSH_SEQ_NUM_START_GET(word) \
  9632. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_START_M) >> \
  9633. HTT_RX_IND_FLUSH_SEQ_NUM_START_S)
  9634. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_SET(word, value) \
  9635. do { \
  9636. HTT_CHECK_SET_VAL(HTT_RX_IND_FLUSH_SEQ_NUM_END, value); \
  9637. (word) |= (value) << HTT_RX_IND_FLUSH_SEQ_NUM_END_S; \
  9638. } while (0)
  9639. #define HTT_RX_IND_FLUSH_SEQ_NUM_END_GET(word) \
  9640. (((word) & HTT_RX_IND_FLUSH_SEQ_NUM_END_M) >> \
  9641. HTT_RX_IND_FLUSH_SEQ_NUM_END_S)
  9642. #define HTT_RX_IND_REL_SEQ_NUM_START_SET(word, value) \
  9643. do { \
  9644. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_START, value); \
  9645. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_START_S; \
  9646. } while (0)
  9647. #define HTT_RX_IND_REL_SEQ_NUM_START_GET(word) \
  9648. (((word) & HTT_RX_IND_REL_SEQ_NUM_START_M) >> \
  9649. HTT_RX_IND_REL_SEQ_NUM_START_S)
  9650. #define HTT_RX_IND_REL_SEQ_NUM_END_SET(word, value) \
  9651. do { \
  9652. HTT_CHECK_SET_VAL(HTT_RX_IND_REL_SEQ_NUM_END, value); \
  9653. (word) |= (value) << HTT_RX_IND_REL_SEQ_NUM_END_S; \
  9654. } while (0)
  9655. #define HTT_RX_IND_REL_SEQ_NUM_END_GET(word) \
  9656. (((word) & HTT_RX_IND_REL_SEQ_NUM_END_M) >> \
  9657. HTT_RX_IND_REL_SEQ_NUM_END_S)
  9658. #define HTT_RX_IND_NUM_MPDU_RANGES_SET(word, value) \
  9659. do { \
  9660. HTT_CHECK_SET_VAL(HTT_RX_IND_NUM_MPDU_RANGES, value); \
  9661. (word) |= (value) << HTT_RX_IND_NUM_MPDU_RANGES_S; \
  9662. } while (0)
  9663. #define HTT_RX_IND_NUM_MPDU_RANGES_GET(word) \
  9664. (((word) & HTT_RX_IND_NUM_MPDU_RANGES_M) >> \
  9665. HTT_RX_IND_NUM_MPDU_RANGES_S)
  9666. /* FW rx PPDU descriptor fields */
  9667. #define HTT_RX_IND_RSSI_CMB_SET(word, value) \
  9668. do { \
  9669. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_CMB, value); \
  9670. (word) |= (value) << HTT_RX_IND_RSSI_CMB_S; \
  9671. } while (0)
  9672. #define HTT_RX_IND_RSSI_CMB_GET(word) \
  9673. (((word) & HTT_RX_IND_RSSI_CMB_M) >> \
  9674. HTT_RX_IND_RSSI_CMB_S)
  9675. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_SET(word, value) \
  9676. do { \
  9677. HTT_CHECK_SET_VAL(HTT_RX_IND_TIMESTAMP_SUBMICROSEC, value); \
  9678. (word) |= (value) << HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S; \
  9679. } while (0)
  9680. #define HTT_RX_IND_TIMESTAMP_SUBMICROSEC_GET(word) \
  9681. (((word) & HTT_RX_IND_TIMESTAMP_SUBMICROSEC_M) >> \
  9682. HTT_RX_IND_TIMESTAMP_SUBMICROSEC_S)
  9683. #define HTT_RX_IND_PHY_ERR_CODE_SET(word, value) \
  9684. do { \
  9685. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR_CODE, value); \
  9686. (word) |= (value) << HTT_RX_IND_PHY_ERR_CODE_S; \
  9687. } while (0)
  9688. #define HTT_RX_IND_PHY_ERR_CODE_GET(word) \
  9689. (((word) & HTT_RX_IND_PHY_ERR_CODE_M) >> \
  9690. HTT_RX_IND_PHY_ERR_CODE_S)
  9691. #define HTT_RX_IND_PHY_ERR_SET(word, value) \
  9692. do { \
  9693. HTT_CHECK_SET_VAL(HTT_RX_IND_PHY_ERR, value); \
  9694. (word) |= (value) << HTT_RX_IND_PHY_ERR_S; \
  9695. } while (0)
  9696. #define HTT_RX_IND_PHY_ERR_GET(word) \
  9697. (((word) & HTT_RX_IND_PHY_ERR_M) >> \
  9698. HTT_RX_IND_PHY_ERR_S)
  9699. #define HTT_RX_IND_LEGACY_RATE_SET(word, value) \
  9700. do { \
  9701. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE, value); \
  9702. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_S; \
  9703. } while (0)
  9704. #define HTT_RX_IND_LEGACY_RATE_GET(word) \
  9705. (((word) & HTT_RX_IND_LEGACY_RATE_M) >> \
  9706. HTT_RX_IND_LEGACY_RATE_S)
  9707. #define HTT_RX_IND_LEGACY_RATE_SEL_SET(word, value) \
  9708. do { \
  9709. HTT_CHECK_SET_VAL(HTT_RX_IND_LEGACY_RATE_SEL, value); \
  9710. (word) |= (value) << HTT_RX_IND_LEGACY_RATE_SEL_S; \
  9711. } while (0)
  9712. #define HTT_RX_IND_LEGACY_RATE_SEL_GET(word) \
  9713. (((word) & HTT_RX_IND_LEGACY_RATE_SEL_M) >> \
  9714. HTT_RX_IND_LEGACY_RATE_SEL_S)
  9715. #define HTT_RX_IND_END_VALID_SET(word, value) \
  9716. do { \
  9717. HTT_CHECK_SET_VAL(HTT_RX_IND_END_VALID, value); \
  9718. (word) |= (value) << HTT_RX_IND_END_VALID_S; \
  9719. } while (0)
  9720. #define HTT_RX_IND_END_VALID_GET(word) \
  9721. (((word) & HTT_RX_IND_END_VALID_M) >> \
  9722. HTT_RX_IND_END_VALID_S)
  9723. #define HTT_RX_IND_START_VALID_SET(word, value) \
  9724. do { \
  9725. HTT_CHECK_SET_VAL(HTT_RX_IND_START_VALID, value); \
  9726. (word) |= (value) << HTT_RX_IND_START_VALID_S; \
  9727. } while (0)
  9728. #define HTT_RX_IND_START_VALID_GET(word) \
  9729. (((word) & HTT_RX_IND_START_VALID_M) >> \
  9730. HTT_RX_IND_START_VALID_S)
  9731. #define HTT_RX_IND_RSSI_PRI20_SET(word, value) \
  9732. do { \
  9733. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_PRI20, value); \
  9734. (word) |= (value) << HTT_RX_IND_RSSI_PRI20_S; \
  9735. } while (0)
  9736. #define HTT_RX_IND_RSSI_PRI20_GET(word) \
  9737. (((word) & HTT_RX_IND_RSSI_PRI20_M) >> \
  9738. HTT_RX_IND_RSSI_PRI20_S)
  9739. #define HTT_RX_IND_RSSI_EXT20_SET(word, value) \
  9740. do { \
  9741. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT20, value); \
  9742. (word) |= (value) << HTT_RX_IND_RSSI_EXT20_S; \
  9743. } while (0)
  9744. #define HTT_RX_IND_RSSI_EXT20_GET(word) \
  9745. (((word) & HTT_RX_IND_RSSI_EXT20_M) >> \
  9746. HTT_RX_IND_RSSI_EXT20_S)
  9747. #define HTT_RX_IND_RSSI_EXT40_SET(word, value) \
  9748. do { \
  9749. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT40, value); \
  9750. (word) |= (value) << HTT_RX_IND_RSSI_EXT40_S; \
  9751. } while (0)
  9752. #define HTT_RX_IND_RSSI_EXT40_GET(word) \
  9753. (((word) & HTT_RX_IND_RSSI_EXT40_M) >> \
  9754. HTT_RX_IND_RSSI_EXT40_S)
  9755. #define HTT_RX_IND_RSSI_EXT80_SET(word, value) \
  9756. do { \
  9757. HTT_CHECK_SET_VAL(HTT_RX_IND_RSSI_EXT80, value); \
  9758. (word) |= (value) << HTT_RX_IND_RSSI_EXT80_S; \
  9759. } while (0)
  9760. #define HTT_RX_IND_RSSI_EXT80_GET(word) \
  9761. (((word) & HTT_RX_IND_RSSI_EXT80_M) >> \
  9762. HTT_RX_IND_RSSI_EXT80_S)
  9763. #define HTT_RX_IND_VHT_SIG_A1_SET(word, value) \
  9764. do { \
  9765. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A1, value); \
  9766. (word) |= (value) << HTT_RX_IND_VHT_SIG_A1_S; \
  9767. } while (0)
  9768. #define HTT_RX_IND_VHT_SIG_A1_GET(word) \
  9769. (((word) & HTT_RX_IND_VHT_SIG_A1_M) >> \
  9770. HTT_RX_IND_VHT_SIG_A1_S)
  9771. #define HTT_RX_IND_VHT_SIG_A2_SET(word, value) \
  9772. do { \
  9773. HTT_CHECK_SET_VAL(HTT_RX_IND_VHT_SIG_A2, value); \
  9774. (word) |= (value) << HTT_RX_IND_VHT_SIG_A2_S; \
  9775. } while (0)
  9776. #define HTT_RX_IND_VHT_SIG_A2_GET(word) \
  9777. (((word) & HTT_RX_IND_VHT_SIG_A2_M) >> \
  9778. HTT_RX_IND_VHT_SIG_A2_S)
  9779. #define HTT_RX_IND_PREAMBLE_TYPE_SET(word, value) \
  9780. do { \
  9781. HTT_CHECK_SET_VAL(HTT_RX_IND_PREAMBLE_TYPE, value); \
  9782. (word) |= (value) << HTT_RX_IND_PREAMBLE_TYPE_S; \
  9783. } while (0)
  9784. #define HTT_RX_IND_PREAMBLE_TYPE_GET(word) \
  9785. (((word) & HTT_RX_IND_PREAMBLE_TYPE_M) >> \
  9786. HTT_RX_IND_PREAMBLE_TYPE_S)
  9787. #define HTT_RX_IND_SERVICE_SET(word, value) \
  9788. do { \
  9789. HTT_CHECK_SET_VAL(HTT_RX_IND_SERVICE, value); \
  9790. (word) |= (value) << HTT_RX_IND_SERVICE_S; \
  9791. } while (0)
  9792. #define HTT_RX_IND_SERVICE_GET(word) \
  9793. (((word) & HTT_RX_IND_SERVICE_M) >> \
  9794. HTT_RX_IND_SERVICE_S)
  9795. #define HTT_RX_IND_SA_ANT_MATRIX_SET(word, value) \
  9796. do { \
  9797. HTT_CHECK_SET_VAL(HTT_RX_IND_SA_ANT_MATRIX, value); \
  9798. (word) |= (value) << HTT_RX_IND_SA_ANT_MATRIX_S; \
  9799. } while (0)
  9800. #define HTT_RX_IND_SA_ANT_MATRIX_GET(word) \
  9801. (((word) & HTT_RX_IND_SA_ANT_MATRIX_M) >> \
  9802. HTT_RX_IND_SA_ANT_MATRIX_S)
  9803. #define HTT_RX_IND_MPDU_COUNT_SET(word, value) \
  9804. do { \
  9805. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_COUNT, value); \
  9806. (word) |= (value) << HTT_RX_IND_MPDU_COUNT_S; \
  9807. } while (0)
  9808. #define HTT_RX_IND_MPDU_COUNT_GET(word) \
  9809. (((word) & HTT_RX_IND_MPDU_COUNT_M) >> HTT_RX_IND_MPDU_COUNT_S)
  9810. #define HTT_RX_IND_MPDU_STATUS_SET(word, value) \
  9811. do { \
  9812. HTT_CHECK_SET_VAL(HTT_RX_IND_MPDU_STATUS, value); \
  9813. (word) |= (value) << HTT_RX_IND_MPDU_STATUS_S; \
  9814. } while (0)
  9815. #define HTT_RX_IND_MPDU_STATUS_GET(word) \
  9816. (((word) & HTT_RX_IND_MPDU_STATUS_M) >> HTT_RX_IND_MPDU_STATUS_S)
  9817. #define HTT_RX_IND_HL_BYTES \
  9818. (HTT_RX_IND_HDR_BYTES + \
  9819. 4 /* single FW rx MSDU descriptor */ + \
  9820. 4 /* single MPDU range information element */)
  9821. #define HTT_RX_IND_HL_SIZE32 (HTT_RX_IND_HL_BYTES >> 2)
  9822. /* Could we use one macro entry? */
  9823. #define HTT_WORD_SET(word, field, value) \
  9824. do { \
  9825. HTT_CHECK_SET_VAL(field, value); \
  9826. (word) |= ((value) << field ## _S); \
  9827. } while (0)
  9828. #define HTT_WORD_GET(word, field) \
  9829. (((word) & field ## _M) >> field ## _S)
  9830. PREPACK struct hl_htt_rx_ind_base {
  9831. A_UINT32 rx_ind_msg[HTT_RX_IND_HL_SIZE32]; /* align with LL case rx indication message, but reduced to 5 words */
  9832. } POSTPACK;
  9833. /*
  9834. * HTT_RX_IND_HL_RX_DESC_BASE_OFFSET
  9835. * Currently, we use a resv field in hl_htt_rx_ind_base to store some
  9836. * HL host needed info; refer to fw_rx_desc_base in wal_rx_desc.h.
  9837. * The field is just after the MSDU FW rx desc, and 1 byte ahead of
  9838. * htt_rx_ind_hl_rx_desc_t.
  9839. */
  9840. #define HTT_RX_IND_HL_RX_DESC_BASE_OFFSET (HTT_RX_IND_FW_RX_DESC_BYTE_OFFSET + 1)
  9841. struct htt_rx_ind_hl_rx_desc_t {
  9842. A_UINT8 ver;
  9843. A_UINT8 len;
  9844. struct {
  9845. A_UINT8
  9846. first_msdu: 1,
  9847. last_msdu: 1,
  9848. c3_failed: 1,
  9849. c4_failed: 1,
  9850. ipv6: 1,
  9851. tcp: 1,
  9852. udp: 1,
  9853. reserved: 1;
  9854. } flags;
  9855. /* NOTE: no reserved space - don't append any new fields here */
  9856. };
  9857. #define HTT_RX_IND_HL_RX_DESC_VER_OFFSET \
  9858. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9859. + offsetof(struct htt_rx_ind_hl_rx_desc_t, ver))
  9860. #define HTT_RX_IND_HL_RX_DESC_VER 0
  9861. #define HTT_RX_IND_HL_RX_DESC_LEN_OFFSET \
  9862. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9863. + offsetof(struct htt_rx_ind_hl_rx_desc_t, len))
  9864. #define HTT_RX_IND_HL_FLAG_OFFSET \
  9865. (HTT_RX_IND_HL_RX_DESC_BASE_OFFSET \
  9866. + offsetof(struct htt_rx_ind_hl_rx_desc_t, flags))
  9867. #define HTT_RX_IND_HL_FLAG_FIRST_MSDU (0x01 << 0)
  9868. #define HTT_RX_IND_HL_FLAG_LAST_MSDU (0x01 << 1)
  9869. #define HTT_RX_IND_HL_FLAG_C3_FAILED (0x01 << 2) /* L3 checksum failed */
  9870. #define HTT_RX_IND_HL_FLAG_C4_FAILED (0x01 << 3) /* L4 checksum failed */
  9871. #define HTT_RX_IND_HL_FLAG_IPV6 (0x01 << 4) /* is ipv6, or else ipv4 */
  9872. #define HTT_RX_IND_HL_FLAG_TCP (0x01 << 5) /* is tcp */
  9873. #define HTT_RX_IND_HL_FLAG_UDP (0x01 << 6) /* is udp */
  9874. /* This structure is used in HL, the basic descriptor information
  9875. * used by host. the structure is translated by FW from HW desc
  9876. * or generated by FW. But in HL monitor mode, the host would use
  9877. * the same structure with LL.
  9878. */
  9879. PREPACK struct hl_htt_rx_desc_base {
  9880. A_UINT32
  9881. seq_num:12,
  9882. encrypted:1,
  9883. chan_info_present:1,
  9884. resv0:2,
  9885. mcast_bcast:1,
  9886. fragment:1,
  9887. key_id_oct:8,
  9888. resv1:6;
  9889. A_UINT32
  9890. pn_31_0;
  9891. union {
  9892. struct {
  9893. A_UINT16 pn_47_32;
  9894. A_UINT16 pn_63_48;
  9895. } pn16;
  9896. A_UINT32 pn_63_32;
  9897. } u0;
  9898. A_UINT32
  9899. pn_95_64;
  9900. A_UINT32
  9901. pn_127_96;
  9902. } POSTPACK;
  9903. /*
  9904. * Channel information can optionally be appended after hl_htt_rx_desc_base.
  9905. * If so, the len field in htt_rx_ind_hl_rx_desc_t will be updated accordingly,
  9906. * and the chan_info_present flag in hl_htt_rx_desc_base will be set.
  9907. * Please see htt_chan_change_t for description of the fields.
  9908. */
  9909. PREPACK struct htt_chan_info_t
  9910. {
  9911. A_UINT32 primary_chan_center_freq_mhz: 16,
  9912. contig_chan1_center_freq_mhz: 16;
  9913. A_UINT32 contig_chan2_center_freq_mhz: 16,
  9914. phy_mode: 8,
  9915. reserved: 8;
  9916. } POSTPACK;
  9917. #define HTT_CHAN_INFO_SIZE sizeof(struct htt_chan_info_t)
  9918. #define HL_RX_DESC_SIZE (sizeof(struct hl_htt_rx_desc_base))
  9919. #define HL_RX_DESC_SIZE_DWORD (HL_RX_STD_DESC_SIZE >> 2)
  9920. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_M 0xfff
  9921. #define HTT_HL_RX_DESC_MPDU_SEQ_NUM_S 0
  9922. #define HTT_HL_RX_DESC_MPDU_ENC_M 0x1000
  9923. #define HTT_HL_RX_DESC_MPDU_ENC_S 12
  9924. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_M 0x2000
  9925. #define HTT_HL_RX_DESC_CHAN_INFO_PRESENT_S 13
  9926. #define HTT_HL_RX_DESC_MCAST_BCAST_M 0x10000
  9927. #define HTT_HL_RX_DESC_MCAST_BCAST_S 16
  9928. #define HTT_HL_RX_DESC_FRAGMENT_M 0x20000
  9929. #define HTT_HL_RX_DESC_FRAGMENT_S 17
  9930. #define HTT_HL_RX_DESC_KEY_ID_OCT_M 0x3fc0000
  9931. #define HTT_HL_RX_DESC_KEY_ID_OCT_S 18
  9932. #define HTT_HL_RX_DESC_PN_OFFSET offsetof(struct hl_htt_rx_desc_base, pn_31_0)
  9933. #define HTT_HL_RX_DESC_PN_WORD_OFFSET (HTT_HL_RX_DESC_PN_OFFSET >> 2)
  9934. /* Channel information */
  9935. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M 0x0000ffff
  9936. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S 0
  9937. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M 0xffff0000
  9938. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S 16
  9939. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M 0x0000ffff
  9940. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S 0
  9941. #define HTT_CHAN_INFO_PHY_MODE_M 0x00ff0000
  9942. #define HTT_CHAN_INFO_PHY_MODE_S 16
  9943. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_SET(word, value) \
  9944. do { \
  9945. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ, value); \
  9946. (word) |= (value) << HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S; \
  9947. } while (0)
  9948. #define HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_GET(word) \
  9949. (((word) & HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_M) >> HTT_CHAN_INFO_PRIMARY_CHAN_CENTER_FREQ_S)
  9950. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_SET(word, value) \
  9951. do { \
  9952. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ, value); \
  9953. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S; \
  9954. } while (0)
  9955. #define HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_GET(word) \
  9956. (((word) & HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN1_CENTER_FREQ_S)
  9957. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_SET(word, value) \
  9958. do { \
  9959. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ, value); \
  9960. (word) |= (value) << HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S; \
  9961. } while (0)
  9962. #define HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_GET(word) \
  9963. (((word) & HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_M) >> HTT_CHAN_INFO_CONTIG_CHAN2_CENTER_FREQ_S)
  9964. #define HTT_CHAN_INFO_PHY_MODE_SET(word, value) \
  9965. do { \
  9966. HTT_CHECK_SET_VAL(HTT_CHAN_INFO_PHY_MODE, value); \
  9967. (word) |= (value) << HTT_CHAN_INFO_PHY_MODE_S; \
  9968. } while (0)
  9969. #define HTT_CHAN_INFO_PHY_MODE_GET(word) \
  9970. (((word) & HTT_CHAN_INFO_PHY_MODE_M) >> HTT_CHAN_INFO_PHY_MODE_S)
  9971. /*
  9972. * @brief target -> host message definition for FW offloaded pkts
  9973. *
  9974. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_OFFLOAD_DELIVER_IND
  9975. *
  9976. * @details
  9977. * The following field definitions describe the format of the firmware
  9978. * offload deliver message sent from the target to the host.
  9979. *
  9980. * definition for struct htt_tx_offload_deliver_ind_hdr_t
  9981. *
  9982. * |31 20|19 16|15 13|12 8|7 5|4|3|2 0|
  9983. * |----------------------------+--------+-----+---------------+-----+-+-+----|
  9984. * | reserved_1 | msg type |
  9985. * |--------------------------------------------------------------------------|
  9986. * | phy_timestamp_l32 |
  9987. * |--------------------------------------------------------------------------|
  9988. * | WORD2 (see below) |
  9989. * |--------------------------------------------------------------------------|
  9990. * | seqno | framectrl |
  9991. * |--------------------------------------------------------------------------|
  9992. * | reserved_3 | vdev_id | tid_num|
  9993. * |--------------------------------------------------------------------------|
  9994. * | reserved_4 | tx_mpdu_bytes |F|STAT|
  9995. * |--------------------------------------------------------------------------|
  9996. *
  9997. * where:
  9998. * STAT = status
  9999. * F = format (802.3 vs. 802.11)
  10000. *
  10001. * definition for word 2
  10002. *
  10003. * |31 26|25| 24 |23 | 22 |21 19|18 17|16 9|8 6|5 2|1 0|
  10004. * |--------+--+----+---+----+-----+-----+---------------------+----+-----+---|
  10005. * |reserv_2|BF|LDPC|SGI|STBC| BW | NSS | RSSI |RATE| MCS |PR |
  10006. * |--------------------------------------------------------------------------|
  10007. *
  10008. * where:
  10009. * PR = preamble
  10010. * BF = beamformed
  10011. */
  10012. PREPACK struct htt_tx_offload_deliver_ind_hdr_t
  10013. {
  10014. A_UINT32 /* word 0 */
  10015. msg_type:8, /* [ 7: 0] */
  10016. reserved_1:24; /* [31: 8] */
  10017. A_UINT32 phy_timestamp_l32; /* word 1 [31:0] */
  10018. A_UINT32 /* word 2 */
  10019. /* preamble:
  10020. * 0-OFDM,
  10021. * 1-CCk,
  10022. * 2-HT,
  10023. * 3-VHT
  10024. */
  10025. preamble: 2, /* [1:0] */
  10026. /* mcs:
  10027. * In case of HT preamble interpret
  10028. * MCS along with NSS.
  10029. * Valid values for HT are 0 to 7.
  10030. * HT mcs 0 with NSS 2 is mcs 8.
  10031. * Valid values for VHT are 0 to 9.
  10032. */
  10033. mcs: 4, /* [5:2] */
  10034. /* rate:
  10035. * This is applicable only for
  10036. * CCK and OFDM preamble type
  10037. * rate 0: OFDM 48 Mbps,
  10038. * 1: OFDM 24 Mbps,
  10039. * 2: OFDM 12 Mbps
  10040. * 3: OFDM 6 Mbps
  10041. * 4: OFDM 54 Mbps
  10042. * 5: OFDM 36 Mbps
  10043. * 6: OFDM 18 Mbps
  10044. * 7: OFDM 9 Mbps
  10045. * rate 0: CCK 11 Mbps Long
  10046. * 1: CCK 5.5 Mbps Long
  10047. * 2: CCK 2 Mbps Long
  10048. * 3: CCK 1 Mbps Long
  10049. * 4: CCK 11 Mbps Short
  10050. * 5: CCK 5.5 Mbps Short
  10051. * 6: CCK 2 Mbps Short
  10052. */
  10053. rate : 3, /* [ 8: 6] */
  10054. rssi : 8, /* [16: 9] units=dBm */
  10055. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  10056. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  10057. stbc : 1, /* [22] */
  10058. sgi : 1, /* [23] */
  10059. ldpc : 1, /* [24] */
  10060. beamformed: 1, /* [25] */
  10061. reserved_2: 6; /* [31:26] */
  10062. A_UINT32 /* word 3 */
  10063. framectrl:16, /* [15: 0] */
  10064. seqno:16; /* [31:16] */
  10065. A_UINT32 /* word 4 */
  10066. tid_num:5, /* [ 4: 0] actual TID number */
  10067. vdev_id:8, /* [12: 5] */
  10068. reserved_3:19; /* [31:13] */
  10069. A_UINT32 /* word 5 */
  10070. /* status:
  10071. * 0: tx_ok
  10072. * 1: retry
  10073. * 2: drop
  10074. * 3: filtered
  10075. * 4: abort
  10076. * 5: tid delete
  10077. * 6: sw abort
  10078. * 7: dropped by peer migration
  10079. */
  10080. status:3, /* [2:0] */
  10081. format:1, /* [3] 0: 802.3 format, 1: 802.11 format */
  10082. tx_mpdu_bytes:16, /* [19:4] */
  10083. /* Indicates retry count of offloaded/local generated Data tx frames */
  10084. tx_retry_cnt:6, /* [25:20] */
  10085. reserved_4:6; /* [31:26] */
  10086. } POSTPACK;
  10087. /* FW offload deliver ind message header fields */
  10088. /* DWORD one */
  10089. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M 0xffffffff
  10090. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S 0
  10091. /* DWORD two */
  10092. #define HTT_FW_OFFLOAD_IND_PREAMBLE_M 0x00000003
  10093. #define HTT_FW_OFFLOAD_IND_PREAMBLE_S 0
  10094. #define HTT_FW_OFFLOAD_IND_MCS_M 0x0000003c
  10095. #define HTT_FW_OFFLOAD_IND_MCS_S 2
  10096. #define HTT_FW_OFFLOAD_IND_RATE_M 0x000001c0
  10097. #define HTT_FW_OFFLOAD_IND_RATE_S 6
  10098. #define HTT_FW_OFFLOAD_IND_RSSI_M 0x0001fe00
  10099. #define HTT_FW_OFFLOAD_IND_RSSI_S 9
  10100. #define HTT_FW_OFFLOAD_IND_NSS_M 0x00060000
  10101. #define HTT_FW_OFFLOAD_IND_NSS_S 17
  10102. #define HTT_FW_OFFLOAD_IND_BW_M 0x00380000
  10103. #define HTT_FW_OFFLOAD_IND_BW_S 19
  10104. #define HTT_FW_OFFLOAD_IND_STBC_M 0x00400000
  10105. #define HTT_FW_OFFLOAD_IND_STBC_S 22
  10106. #define HTT_FW_OFFLOAD_IND_SGI_M 0x00800000
  10107. #define HTT_FW_OFFLOAD_IND_SGI_S 23
  10108. #define HTT_FW_OFFLOAD_IND_LDPC_M 0x01000000
  10109. #define HTT_FW_OFFLOAD_IND_LDPC_S 24
  10110. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_M 0x02000000
  10111. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_S 25
  10112. /* DWORD three*/
  10113. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_M 0x0000ffff
  10114. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_S 0
  10115. #define HTT_FW_OFFLOAD_IND_SEQNO_M 0xffff0000
  10116. #define HTT_FW_OFFLOAD_IND_SEQNO_S 16
  10117. /* DWORD four */
  10118. #define HTT_FW_OFFLOAD_IND_TID_NUM_M 0x0000001f
  10119. #define HTT_FW_OFFLOAD_IND_TID_NUM_S 0
  10120. #define HTT_FW_OFFLOAD_IND_VDEV_ID_M 0x00001fe0
  10121. #define HTT_FW_OFFLOAD_IND_VDEV_ID_S 5
  10122. /* DWORD five */
  10123. #define HTT_FW_OFFLOAD_IND_STATUS_M 0x00000007
  10124. #define HTT_FW_OFFLOAD_IND_STATUS_S 0
  10125. #define HTT_FW_OFFLOAD_IND_FORMAT_M 0x00000008
  10126. #define HTT_FW_OFFLOAD_IND_FORMAT_S 3
  10127. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M 0x000ffff0
  10128. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S 4
  10129. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M 0x03f00000
  10130. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S 20
  10131. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_SET(word, value) \
  10132. do { \
  10133. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32, value); \
  10134. (word) |= (value) << HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S; \
  10135. } while (0)
  10136. #define HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_GET(word) \
  10137. (((word) & HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_M) >> HTT_FW_OFFLOAD_IND_PHY_TIMESTAMP_L32_S)
  10138. #define HTT_FW_OFFLOAD_IND_PREAMBLE_SET(word, value) \
  10139. do { \
  10140. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_PREAMBLE, value); \
  10141. (word) |= (value) << HTT_FW_OFFLOAD_IND_PREAMBLE_S; \
  10142. } while (0)
  10143. #define HTT_FW_OFFLOAD_IND_PREAMBLE_GET(word) \
  10144. (((word) & HTT_FW_OFFLOAD_IND_PREAMBLE_M) >> HTT_FW_OFFLOAD_IND_PREAMBLE_S)
  10145. #define HTT_FW_OFFLOAD_IND_MCS_SET(word, value) \
  10146. do { \
  10147. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_MCS, value); \
  10148. (word) |= (value) << HTT_FW_OFFLOAD_IND_MCS_S; \
  10149. } while (0)
  10150. #define HTT_FW_OFFLOAD_IND_MCS_GET(word) \
  10151. (((word) & HTT_FW_OFFLOAD_IND_MCS_M) >> HTT_FW_OFFLOAD_IND_MCS_S)
  10152. #define HTT_FW_OFFLOAD_IND_RATE_SET(word, value) \
  10153. do { \
  10154. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RATE, value); \
  10155. (word) |= (value) << HTT_FW_OFFLOAD_IND_RATE_S; \
  10156. } while (0)
  10157. #define HTT_FW_OFFLOAD_IND_RATE_GET(word) \
  10158. (((word) & HTT_FW_OFFLOAD_IND_RATE_M) >> HTT_FW_OFFLOAD_IND_RATE_S)
  10159. #define HTT_FW_OFFLOAD_IND_RSSI_SET(word, value) \
  10160. do { \
  10161. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_RSSI, value); \
  10162. (word) |= (value) << HTT_FW_OFFLOAD_IND_RSSI_S; \
  10163. } while (0)
  10164. #define HTT_FW_OFFLOAD_IND_RSSI_GET(word) \
  10165. (((word) & HTT_FW_OFFLOAD_IND_RSSI_M) >> HTT_FW_OFFLOAD_IND_RSSI_S)
  10166. #define HTT_FW_OFFLOAD_IND_NSS_SET(word, value) \
  10167. do { \
  10168. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_NSS, value); \
  10169. (word) |= (value) << HTT_FW_OFFLOAD_IND_NSS_S; \
  10170. } while (0)
  10171. #define HTT_FW_OFFLOAD_IND_NSS_GET(word) \
  10172. (((word) & HTT_FW_OFFLOAD_IND_NSS_M) >> HTT_FW_OFFLOAD_IND_NSS_S)
  10173. #define HTT_FW_OFFLOAD_IND_BW_SET(word, value) \
  10174. do { \
  10175. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BW, value); \
  10176. (word) |= (value) << HTT_FW_OFFLOAD_IND_BW_S; \
  10177. } while (0)
  10178. #define HTT_FW_OFFLOAD_IND_BW_GET(word) \
  10179. (((word) & HTT_FW_OFFLOAD_IND_BW_M) >> HTT_FW_OFFLOAD_IND_BW_S)
  10180. #define HTT_FW_OFFLOAD_IND_STBC_SET(word, value) \
  10181. do { \
  10182. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STBC, value); \
  10183. (word) |= (value) << HTT_FW_OFFLOAD_IND_STBC_S; \
  10184. } while (0)
  10185. #define HTT_FW_OFFLOAD_IND_STBC_GET(word) \
  10186. (((word) & HTT_FW_OFFLOAD_IND_STBC_M) >> HTT_FW_OFFLOAD_IND_STBC_S)
  10187. #define HTT_FW_OFFLOAD_IND_SGI_SET(word, value) \
  10188. do { \
  10189. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SGI, value); \
  10190. (word) |= (value) << HTT_FW_OFFLOAD_IND_SGI_S; \
  10191. } while (0)
  10192. #define HTT_FW_OFFLOAD_IND_SGI_GET(word) \
  10193. (((word) & HTT_FW_OFFLOAD_IND_SGI_M) >> HTT_FW_OFFLOAD_IND_SGI_S)
  10194. #define HTT_FW_OFFLOAD_IND_LDPC_SET(word, value) \
  10195. do { \
  10196. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_LDPC, value); \
  10197. (word) |= (value) << HTT_FW_OFFLOAD_IND_LDPC_S; \
  10198. } while (0)
  10199. #define HTT_FW_OFFLOAD_IND_LDPC_GET(word) \
  10200. (((word) & HTT_FW_OFFLOAD_IND_LDPC_M) >> HTT_FW_OFFLOAD_IND_LDPC_S)
  10201. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_SET(word, value) \
  10202. do { \
  10203. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_BEAMFORMED, value); \
  10204. (word) |= (value) << HTT_FW_OFFLOAD_IND_BEAMFORMED_S; \
  10205. } while (0)
  10206. #define HTT_FW_OFFLOAD_IND_BEAMFORMED_GET(word) \
  10207. (((word) & HTT_FW_OFFLOAD_IND_BEAMFORMED_M) >> HTT_FW_OFFLOAD_IND_BEAMFORMED_S)
  10208. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_SET(word, value) \
  10209. do { \
  10210. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FRAMECTRL, value); \
  10211. (word) |= (value) << HTT_FW_OFFLOAD_IND_FRAMECTRL_S; \
  10212. } while (0)
  10213. #define HTT_FW_OFFLOAD_IND_FRAMECTRL_GET(word) \
  10214. (((word) & HTT_FW_OFFLOAD_IND_FRAMECTRL_M) >> HTT_FW_OFFLOAD_IND_FRAMECTRL_S)
  10215. #define HTT_FW_OFFLOAD_IND_SEQNO_SET(word, value) \
  10216. do { \
  10217. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_SEQNO, value); \
  10218. (word) |= (value) << HTT_FW_OFFLOAD_IND_SEQNO_S; \
  10219. } while (0)
  10220. #define HTT_FW_OFFLOAD_IND_SEQNO_GET(word) \
  10221. (((word) & HTT_FW_OFFLOAD_IND_SEQNO_M) >> HTT_FW_OFFLOAD_IND_SEQNO_S)
  10222. #define HTT_FW_OFFLOAD_IND_TID_NUM_SET(word, value) \
  10223. do { \
  10224. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TID_NUM, value); \
  10225. (word) |= (value) << HTT_FW_OFFLOAD_IND_TID_NUM_S; \
  10226. } while (0)
  10227. #define HTT_FW_OFFLOAD_IND_TID_NUM_GET(word) \
  10228. (((word) & HTT_FW_OFFLOAD_IND_TID_NUM_M) >> HTT_FW_OFFLOAD_IND_TID_NUM_S)
  10229. #define HTT_FW_OFFLOAD_IND_VDEV_ID_SET(word, value) \
  10230. do { \
  10231. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_VDEV_ID, value); \
  10232. (word) |= (value) << HTT_FW_OFFLOAD_IND_VDEV_ID_S; \
  10233. } while (0)
  10234. #define HTT_FW_OFFLOAD_IND_VDEV_ID_GET(word) \
  10235. (((word) & HTT_FW_OFFLOAD_IND_VDEV_ID_M) >> HTT_FW_OFFLOAD_IND_VDEV_ID_S)
  10236. #define HTT_FW_OFFLOAD_IND_STATUS_SET(word, value) \
  10237. do { \
  10238. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_STATUS, value); \
  10239. (word) |= (value) << HTT_FW_OFFLOAD_IND_STATUS_S; \
  10240. } while (0)
  10241. #define HTT_FW_OFFLOAD_IND_STATUS_GET(word) \
  10242. (((word) & HTT_FW_OFFLOAD_IND_STATUS_M) >> HTT_FW_OFFLOAD_IND_STATUS_M)
  10243. #define HTT_FW_OFFLOAD_IND_FORMAT_SET(word, value) \
  10244. do { \
  10245. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_FORMAT, value); \
  10246. (word) |= (value) << HTT_FW_OFFLOAD_IND_FORMAT_S; \
  10247. } while (0)
  10248. #define HTT_FW_OFFLOAD_IND_FORMAT_GET(word) \
  10249. (((word) & HTT_FW_OFFLOAD_IND_FORMAT_M) >> HTT_FW_OFFLOAD_IND_FORMAT_S)
  10250. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_SET(word, value) \
  10251. do { \
  10252. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES, value); \
  10253. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S; \
  10254. } while (0)
  10255. #define HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_GET(word) \
  10256. (((word) & HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_M) >> HTT_FW_OFFLOAD_IND_TX_MPDU_BYTES_S)
  10257. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_SET(word, value) \
  10258. do { \
  10259. HTT_CHECK_SET_VAL(HTT_FW_OFFLOAD_IND_TX_RETRY_CNT, value); \
  10260. (word) |= (value) << HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S; \
  10261. } while (0)
  10262. #define HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_GET(word) \
  10263. (((word) & HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_M) >> HTT_FW_OFFLOAD_IND_TX_RETRY_CNT_S)
  10264. /*
  10265. * @brief target -> host rx reorder flush message definition
  10266. *
  10267. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FLUSH
  10268. *
  10269. * @details
  10270. * The following field definitions describe the format of the rx flush
  10271. * message sent from the target to the host.
  10272. * The message consists of a 4-octet header, followed by one or more
  10273. * 4-octet payload information elements.
  10274. *
  10275. * |31 24|23 8|7 0|
  10276. * |--------------------------------------------------------------|
  10277. * | TID | peer ID | msg type |
  10278. * |--------------------------------------------------------------|
  10279. * | seq num end | seq num start | MPDU status | reserved |
  10280. * |--------------------------------------------------------------|
  10281. * First DWORD:
  10282. * - MSG_TYPE
  10283. * Bits 7:0
  10284. * Purpose: identifies this as an rx flush message
  10285. * Value: 0x2 (HTT_T2H_MSG_TYPE_RX_FLUSH)
  10286. * - PEER_ID
  10287. * Bits 23:8 (only bits 18:8 actually used)
  10288. * Purpose: identify which peer's rx data is being flushed
  10289. * Value: (rx) peer ID
  10290. * - TID
  10291. * Bits 31:24 (only bits 27:24 actually used)
  10292. * Purpose: Specifies which traffic identifier's rx data is being flushed
  10293. * Value: traffic identifier
  10294. * Second DWORD:
  10295. * - MPDU_STATUS
  10296. * Bits 15:8
  10297. * Purpose:
  10298. * Indicate whether the flushed MPDUs should be discarded or processed.
  10299. * Value:
  10300. * 0x1: send the MPDUs from the rx reorder buffer to subsequent
  10301. * stages of rx processing
  10302. * other: discard the MPDUs
  10303. * It is anticipated that flush messages will always have
  10304. * MPDU status == 1, but the status flag is included for
  10305. * flexibility.
  10306. * - SEQ_NUM_START
  10307. * Bits 23:16
  10308. * Purpose:
  10309. * Indicate the start of a series of consecutive MPDUs being flushed.
  10310. * Not all MPDUs within this range are necessarily valid - the host
  10311. * must check each sequence number within this range to see if the
  10312. * corresponding MPDU is actually present.
  10313. * Value:
  10314. * The sequence number for the first MPDU in the sequence.
  10315. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10316. * - SEQ_NUM_END
  10317. * Bits 30:24
  10318. * Purpose:
  10319. * Indicate the end of a series of consecutive MPDUs being flushed.
  10320. * Value:
  10321. * The sequence number one larger than the sequence number of the
  10322. * last MPDU being flushed.
  10323. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10324. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] inclusive
  10325. * are to be released for further rx processing.
  10326. * Not all MPDUs within this range are necessarily valid - the host
  10327. * must check each sequence number within this range to see if the
  10328. * corresponding MPDU is actually present.
  10329. */
  10330. /* first DWORD */
  10331. #define HTT_RX_FLUSH_PEER_ID_M 0xffff00
  10332. #define HTT_RX_FLUSH_PEER_ID_S 8
  10333. #define HTT_RX_FLUSH_TID_M 0xff000000
  10334. #define HTT_RX_FLUSH_TID_S 24
  10335. /* second DWORD */
  10336. #define HTT_RX_FLUSH_MPDU_STATUS_M 0x0000ff00
  10337. #define HTT_RX_FLUSH_MPDU_STATUS_S 8
  10338. #define HTT_RX_FLUSH_SEQ_NUM_START_M 0x00ff0000
  10339. #define HTT_RX_FLUSH_SEQ_NUM_START_S 16
  10340. #define HTT_RX_FLUSH_SEQ_NUM_END_M 0xff000000
  10341. #define HTT_RX_FLUSH_SEQ_NUM_END_S 24
  10342. #define HTT_RX_FLUSH_BYTES 8
  10343. #define HTT_RX_FLUSH_PEER_ID_SET(word, value) \
  10344. do { \
  10345. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_PEER_ID, value); \
  10346. (word) |= (value) << HTT_RX_FLUSH_PEER_ID_S; \
  10347. } while (0)
  10348. #define HTT_RX_FLUSH_PEER_ID_GET(word) \
  10349. (((word) & HTT_RX_FLUSH_PEER_ID_M) >> HTT_RX_FLUSH_PEER_ID_S)
  10350. #define HTT_RX_FLUSH_TID_SET(word, value) \
  10351. do { \
  10352. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_TID, value); \
  10353. (word) |= (value) << HTT_RX_FLUSH_TID_S; \
  10354. } while (0)
  10355. #define HTT_RX_FLUSH_TID_GET(word) \
  10356. (((word) & HTT_RX_FLUSH_TID_M) >> HTT_RX_FLUSH_TID_S)
  10357. #define HTT_RX_FLUSH_MPDU_STATUS_SET(word, value) \
  10358. do { \
  10359. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_MPDU_STATUS, value); \
  10360. (word) |= (value) << HTT_RX_FLUSH_MPDU_STATUS_S; \
  10361. } while (0)
  10362. #define HTT_RX_FLUSH_MPDU_STATUS_GET(word) \
  10363. (((word) & HTT_RX_FLUSH_MPDU_STATUS_M) >> HTT_RX_FLUSH_MPDU_STATUS_S)
  10364. #define HTT_RX_FLUSH_SEQ_NUM_START_SET(word, value) \
  10365. do { \
  10366. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_START, value); \
  10367. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_START_S; \
  10368. } while (0)
  10369. #define HTT_RX_FLUSH_SEQ_NUM_START_GET(word) \
  10370. (((word) & HTT_RX_FLUSH_SEQ_NUM_START_M) >> HTT_RX_FLUSH_SEQ_NUM_START_S)
  10371. #define HTT_RX_FLUSH_SEQ_NUM_END_SET(word, value) \
  10372. do { \
  10373. HTT_CHECK_SET_VAL(HTT_RX_FLUSH_SEQ_NUM_END, value); \
  10374. (word) |= (value) << HTT_RX_FLUSH_SEQ_NUM_END_S; \
  10375. } while (0)
  10376. #define HTT_RX_FLUSH_SEQ_NUM_END_GET(word) \
  10377. (((word) & HTT_RX_FLUSH_SEQ_NUM_END_M) >> HTT_RX_FLUSH_SEQ_NUM_END_S)
  10378. /*
  10379. * @brief target -> host rx pn check indication message
  10380. *
  10381. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_PN_IND
  10382. *
  10383. * @details
  10384. * The following field definitions describe the format of the Rx PN check
  10385. * indication message sent from the target to the host.
  10386. * The message consists of a 4-octet header, followed by the start and
  10387. * end sequence numbers to be released, followed by the PN IEs. Each PN
  10388. * IE is one octet containing the sequence number that failed the PN
  10389. * check.
  10390. *
  10391. * |31 24|23 8|7 0|
  10392. * |--------------------------------------------------------------|
  10393. * | TID | peer ID | msg type |
  10394. * |--------------------------------------------------------------|
  10395. * | Reserved | PN IE count | seq num end | seq num start|
  10396. * |--------------------------------------------------------------|
  10397. * l : PN IE 2 | PN IE 1 | PN IE 0 |
  10398. * |--------------------------------------------------------------|
  10399. * First DWORD:
  10400. * - MSG_TYPE
  10401. * Bits 7:0
  10402. * Purpose: Identifies this as an rx pn check indication message
  10403. * Value: 0x10 (HTT_T2H_MSG_TYPE_RX_PN_IND)
  10404. * - PEER_ID
  10405. * Bits 23:8 (only bits 18:8 actually used)
  10406. * Purpose: identify which peer
  10407. * Value: (rx) peer ID
  10408. * - TID
  10409. * Bits 31:24 (only bits 27:24 actually used)
  10410. * Purpose: identify traffic identifier
  10411. * Value: traffic identifier
  10412. * Second DWORD:
  10413. * - SEQ_NUM_START
  10414. * Bits 7:0
  10415. * Purpose:
  10416. * Indicates the starting sequence number of the MPDU in this
  10417. * series of MPDUs that went though PN check.
  10418. * Value:
  10419. * The sequence number for the first MPDU in the sequence.
  10420. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10421. * - SEQ_NUM_END
  10422. * Bits 15:8
  10423. * Purpose:
  10424. * Indicates the ending sequence number of the MPDU in this
  10425. * series of MPDUs that went though PN check.
  10426. * Value:
  10427. * The sequence number one larger then the sequence number of the last
  10428. * MPDU being flushed.
  10429. * This sequence number is the 6 LSBs of the 802.11 sequence number.
  10430. * The range of MPDUs from [SEQ_NUM_START,SEQ_NUM_END-1] have been checked
  10431. * for invalid PN numbers and are ready to be released for further processing.
  10432. * Not all MPDUs within this range are necessarily valid - the host
  10433. * must check each sequence number within this range to see if the
  10434. * corresponding MPDU is actually present.
  10435. * - PN_IE_COUNT
  10436. * Bits 23:16
  10437. * Purpose:
  10438. * Used to determine the variable number of PN information elements in this
  10439. * message
  10440. *
  10441. * PN information elements:
  10442. * - PN_IE_x-
  10443. * Purpose:
  10444. * Each PN information element contains the sequence number of the MPDU that
  10445. * has failed the target PN check.
  10446. * Value:
  10447. * Contains the 6 LSBs of the 802.11 sequence number corresponding to the MPDU
  10448. * that failed the PN check.
  10449. */
  10450. /* first DWORD */
  10451. #define HTT_RX_PN_IND_PEER_ID_M 0xffff00
  10452. #define HTT_RX_PN_IND_PEER_ID_S 8
  10453. #define HTT_RX_PN_IND_TID_M 0xff000000
  10454. #define HTT_RX_PN_IND_TID_S 24
  10455. /* second DWORD */
  10456. #define HTT_RX_PN_IND_SEQ_NUM_START_M 0x000000ff
  10457. #define HTT_RX_PN_IND_SEQ_NUM_START_S 0
  10458. #define HTT_RX_PN_IND_SEQ_NUM_END_M 0x0000ff00
  10459. #define HTT_RX_PN_IND_SEQ_NUM_END_S 8
  10460. #define HTT_RX_PN_IND_PN_IE_CNT_M 0x00ff0000
  10461. #define HTT_RX_PN_IND_PN_IE_CNT_S 16
  10462. #define HTT_RX_PN_IND_BYTES 8
  10463. #define HTT_RX_PN_IND_PEER_ID_SET(word, value) \
  10464. do { \
  10465. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PEER_ID, value); \
  10466. (word) |= (value) << HTT_RX_PN_IND_PEER_ID_S; \
  10467. } while (0)
  10468. #define HTT_RX_PN_IND_PEER_ID_GET(word) \
  10469. (((word) & HTT_RX_PN_IND_PEER_ID_M) >> HTT_RX_PN_IND_PEER_ID_S)
  10470. #define HTT_RX_PN_IND_EXT_TID_SET(word, value) \
  10471. do { \
  10472. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_TID, value); \
  10473. (word) |= (value) << HTT_RX_PN_IND_TID_S; \
  10474. } while (0)
  10475. #define HTT_RX_PN_IND_EXT_TID_GET(word) \
  10476. (((word) & HTT_RX_PN_IND_TID_M) >> HTT_RX_PN_IND_TID_S)
  10477. #define HTT_RX_PN_IND_SEQ_NUM_START_SET(word, value) \
  10478. do { \
  10479. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_START, value); \
  10480. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_START_S; \
  10481. } while (0)
  10482. #define HTT_RX_PN_IND_SEQ_NUM_START_GET(word) \
  10483. (((word) & HTT_RX_PN_IND_SEQ_NUM_START_M) >> HTT_RX_PN_IND_SEQ_NUM_START_S)
  10484. #define HTT_RX_PN_IND_SEQ_NUM_END_SET(word, value) \
  10485. do { \
  10486. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_SEQ_NUM_END, value); \
  10487. (word) |= (value) << HTT_RX_PN_IND_SEQ_NUM_END_S; \
  10488. } while (0)
  10489. #define HTT_RX_PN_IND_SEQ_NUM_END_GET(word) \
  10490. (((word) & HTT_RX_PN_IND_SEQ_NUM_END_M) >> HTT_RX_PN_IND_SEQ_NUM_END_S)
  10491. #define HTT_RX_PN_IND_PN_IE_CNT_SET(word, value) \
  10492. do { \
  10493. HTT_CHECK_SET_VAL(HTT_RX_PN_IND_PN_IE_CNT, value); \
  10494. (word) |= (value) << HTT_RX_PN_IND_PN_IE_CNT_S; \
  10495. } while (0)
  10496. #define HTT_RX_PN_IND_PN_IE_CNT_GET(word) \
  10497. (((word) & HTT_RX_PN_IND_PN_IE_CNT_M) >> HTT_RX_PN_IND_PN_IE_CNT_S)
  10498. /*
  10499. * @brief target -> host rx offload deliver message for LL system
  10500. *
  10501. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFFLOAD_DELIVER_IND
  10502. *
  10503. * @details
  10504. * In a low latency system this message is sent whenever the offload
  10505. * manager flushes out the packets it has coalesced in its coalescing buffer.
  10506. * The DMA of the actual packets into host memory is done before sending out
  10507. * this message. This message indicates only how many MSDUs to reap. The
  10508. * peer ID, vdev ID, tid and MSDU length are copied inline into the header
  10509. * portion of the MSDU while DMA'ing into the host memory. Unlike the packets
  10510. * DMA'd by the MAC directly into host memory these packets do not contain
  10511. * the MAC descriptors in the header portion of the packet. Instead they contain
  10512. * the peer ID, vdev ID, tid and MSDU length. Also when the host receives this
  10513. * message, the packets are delivered directly to the NW stack without going
  10514. * through the regular reorder buffering and PN checking path since it has
  10515. * already been done in target.
  10516. *
  10517. * |31 24|23 16|15 8|7 0|
  10518. * |-----------------------------------------------------------------------|
  10519. * | Total MSDU count | reserved | msg type |
  10520. * |-----------------------------------------------------------------------|
  10521. *
  10522. * @brief target -> host rx offload deliver message for HL system
  10523. *
  10524. * @details
  10525. * In a high latency system this message is sent whenever the offload manager
  10526. * flushes out the packets it has coalesced in its coalescing buffer. The
  10527. * actual packets are also carried along with this message. When the host
  10528. * receives this message, it is expected to deliver these packets to the NW
  10529. * stack directly instead of routing them through the reorder buffering and
  10530. * PN checking path since it has already been done in target.
  10531. *
  10532. * |31 24|23 16|15 8|7 0|
  10533. * |-----------------------------------------------------------------------|
  10534. * | Total MSDU count | reserved | msg type |
  10535. * |-----------------------------------------------------------------------|
  10536. * | peer ID | MSDU length |
  10537. * |-----------------------------------------------------------------------|
  10538. * | MSDU payload | FW Desc | tid | vdev ID |
  10539. * |-----------------------------------------------------------------------|
  10540. * | MSDU payload contd. |
  10541. * |-----------------------------------------------------------------------|
  10542. * | peer ID | MSDU length |
  10543. * |-----------------------------------------------------------------------|
  10544. * | MSDU payload | FW Desc | tid | vdev ID |
  10545. * |-----------------------------------------------------------------------|
  10546. * | MSDU payload contd. |
  10547. * |-----------------------------------------------------------------------|
  10548. *
  10549. */
  10550. /* first DWORD */
  10551. #define HTT_RX_OFFLOAD_DELIVER_IND_HDR_BYTES 4
  10552. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_HDR_BYTES 7
  10553. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M 0xffff0000
  10554. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S 16
  10555. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M 0x0000ffff
  10556. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S 0
  10557. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M 0xffff0000
  10558. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S 16
  10559. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M 0x000000ff
  10560. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S 0
  10561. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M 0x0000ff00
  10562. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S 8
  10563. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M 0x00ff0000
  10564. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S 16
  10565. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_GET(word) \
  10566. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S)
  10567. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_SET(word, value) \
  10568. do { \
  10569. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT, value); \
  10570. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_CNT_S; \
  10571. } while (0)
  10572. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_GET(word) \
  10573. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S)
  10574. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_SET(word, value) \
  10575. do { \
  10576. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN, value); \
  10577. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_LEN_S; \
  10578. } while (0)
  10579. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_GET(word) \
  10580. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S)
  10581. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_SET(word, value) \
  10582. do { \
  10583. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID, value); \
  10584. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_PEER_ID_S; \
  10585. } while (0)
  10586. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_GET(word) \
  10587. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S)
  10588. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_SET(word, value) \
  10589. do { \
  10590. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID, value); \
  10591. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_VDEV_ID_S; \
  10592. } while (0)
  10593. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_GET(word) \
  10594. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S)
  10595. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_SET(word, value) \
  10596. do { \
  10597. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID, value); \
  10598. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_TID_S; \
  10599. } while (0)
  10600. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_GET(word) \
  10601. (((word) & HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_M) >> HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S)
  10602. #define HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_SET(word, value) \
  10603. do { \
  10604. HTT_CHECK_SET_VAL(HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC, value); \
  10605. (word) |= (value) << HTT_RX_OFFLOAD_DELIVER_IND_MSDU_DESC_S; \
  10606. } while (0)
  10607. /**
  10608. * @brief target -> host rx peer map/unmap message definition
  10609. *
  10610. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP
  10611. *
  10612. * @details
  10613. * The following diagram shows the format of the rx peer map message sent
  10614. * from the target to the host. This layout assumes the target operates
  10615. * as little-endian.
  10616. *
  10617. * This message always contains a SW peer ID. The main purpose of the
  10618. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10619. * with, so that the host can use that peer ID to determine which peer
  10620. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10621. * other purposes, such as identifying during tx completions which peer
  10622. * the tx frames in question were transmitted to.
  10623. *
  10624. * In certain generations of chips, the peer map message also contains
  10625. * a HW peer ID. This HW peer ID is used during rx --> tx frame forwarding
  10626. * to identify which peer the frame needs to be forwarded to (i.e. the
  10627. * peer assocated with the Destination MAC Address within the packet),
  10628. * and particularly which vdev needs to transmit the frame (for cases
  10629. * of inter-vdev rx --> tx forwarding). The HW peer id here is the same
  10630. * meaning as AST_INDEX_0.
  10631. * This DA-based peer ID that is provided for certain rx frames
  10632. * (the rx frames that need to be re-transmitted as tx frames)
  10633. * is the ID that the HW uses for referring to the peer in question,
  10634. * rather than the peer ID that the SW+FW use to refer to the peer.
  10635. *
  10636. *
  10637. * |31 24|23 16|15 8|7 0|
  10638. * |-----------------------------------------------------------------------|
  10639. * | SW peer ID | VDEV ID | msg type |
  10640. * |-----------------------------------------------------------------------|
  10641. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10642. * |-----------------------------------------------------------------------|
  10643. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10644. * |-----------------------------------------------------------------------|
  10645. *
  10646. *
  10647. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP
  10648. *
  10649. * The following diagram shows the format of the rx peer unmap message sent
  10650. * from the target to the host.
  10651. *
  10652. * |31 24|23 16|15 8|7 0|
  10653. * |-----------------------------------------------------------------------|
  10654. * | SW peer ID | VDEV ID | msg type |
  10655. * |-----------------------------------------------------------------------|
  10656. *
  10657. * The following field definitions describe the format of the rx peer map
  10658. * and peer unmap messages sent from the target to the host.
  10659. * - MSG_TYPE
  10660. * Bits 7:0
  10661. * Purpose: identifies this as an rx peer map or peer unmap message
  10662. * Value: peer map -> 0x3 (HTT_T2H_MSG_TYPE_PEER_MAP),
  10663. * peer unmap -> 0x4 (HTT_T2H_MSG_TYPE_PEER_UNMAP)
  10664. * - VDEV_ID
  10665. * Bits 15:8
  10666. * Purpose: Indicates which virtual device the peer is associated
  10667. * with.
  10668. * Value: vdev ID (used in the host to look up the vdev object)
  10669. * - PEER_ID (a.k.a. SW_PEER_ID)
  10670. * Bits 31:16
  10671. * Purpose: The peer ID (index) that WAL is allocating (map) or
  10672. * freeing (unmap)
  10673. * Value: (rx) peer ID
  10674. * - MAC_ADDR_L32 (peer map only)
  10675. * Bits 31:0
  10676. * Purpose: Identifies which peer node the peer ID is for.
  10677. * Value: lower 4 bytes of peer node's MAC address
  10678. * - MAC_ADDR_U16 (peer map only)
  10679. * Bits 15:0
  10680. * Purpose: Identifies which peer node the peer ID is for.
  10681. * Value: upper 2 bytes of peer node's MAC address
  10682. * - HW_PEER_ID
  10683. * Bits 31:16
  10684. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10685. * address, so for rx frames marked for rx --> tx forwarding, the
  10686. * host can determine from the HW peer ID provided as meta-data with
  10687. * the rx frame which peer the frame is supposed to be forwarded to.
  10688. * Value: ID used by the MAC HW to identify the peer
  10689. */
  10690. #define HTT_RX_PEER_MAP_VDEV_ID_M 0xff00
  10691. #define HTT_RX_PEER_MAP_VDEV_ID_S 8
  10692. #define HTT_RX_PEER_MAP_PEER_ID_M 0xffff0000
  10693. #define HTT_RX_PEER_MAP_PEER_ID_S 16
  10694. #define HTT_RX_PEER_MAP_SW_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M /* alias */
  10695. #define HTT_RX_PEER_MAP_SW_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S /* alias */
  10696. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  10697. #define HTT_RX_PEER_MAP_MAC_ADDR_L32_S 0
  10698. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_M 0xffff
  10699. #define HTT_RX_PEER_MAP_MAC_ADDR_U16_S 0
  10700. #define HTT_RX_PEER_MAP_HW_PEER_ID_M 0xffff0000
  10701. #define HTT_RX_PEER_MAP_HW_PEER_ID_S 16
  10702. #define HTT_RX_PEER_MAP_VAP_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET /* deprecated */
  10703. #define HTT_RX_PEER_MAP_VDEV_ID_SET(word, value) \
  10704. do { \
  10705. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_VDEV_ID, value); \
  10706. (word) |= (value) << HTT_RX_PEER_MAP_VDEV_ID_S; \
  10707. } while (0)
  10708. #define HTT_RX_PEER_MAP_VAP_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET /* deprecated */
  10709. #define HTT_RX_PEER_MAP_VDEV_ID_GET(word) \
  10710. (((word) & HTT_RX_PEER_MAP_VDEV_ID_M) >> HTT_RX_PEER_MAP_VDEV_ID_S)
  10711. #define HTT_RX_PEER_MAP_PEER_ID_SET(word, value) \
  10712. do { \
  10713. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_PEER_ID, value); \
  10714. (word) |= (value) << HTT_RX_PEER_MAP_PEER_ID_S; \
  10715. } while (0)
  10716. #define HTT_RX_PEER_MAP_PEER_ID_GET(word) \
  10717. (((word) & HTT_RX_PEER_MAP_PEER_ID_M) >> HTT_RX_PEER_MAP_PEER_ID_S)
  10718. #define HTT_RX_PEER_MAP_SW_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET /* alias */
  10719. #define HTT_RX_PEER_MAP_SW_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET /* alias */
  10720. #define HTT_RX_PEER_MAP_HW_PEER_ID_SET(word, value) \
  10721. do { \
  10722. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_HW_PEER_ID, value); \
  10723. (word) |= (value) << HTT_RX_PEER_MAP_HW_PEER_ID_S; \
  10724. } while (0)
  10725. #define HTT_RX_PEER_MAP_HW_PEER_ID_GET(word) \
  10726. (((word) & HTT_RX_PEER_MAP_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_HW_PEER_ID_S)
  10727. #define HTT_RX_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  10728. #define HTT_RX_PEER_MAP_HW_PEER_ID_OFFSET 8 /* bytes */
  10729. #define HTT_RX_PEER_MAP_BYTES 12
  10730. #define HTT_RX_PEER_UNMAP_PEER_ID_M HTT_RX_PEER_MAP_PEER_ID_M
  10731. #define HTT_RX_PEER_UNMAP_PEER_ID_S HTT_RX_PEER_MAP_PEER_ID_S
  10732. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_M HTT_RX_PEER_MAP_SW_PEER_ID_M
  10733. #define HTT_RX_PEER_UNMAP_SW_PEER_ID_S HTT_RX_PEER_MAP_SW_PEER_ID_S
  10734. #define HTT_RX_PEER_UNMAP_PEER_ID_SET HTT_RX_PEER_MAP_PEER_ID_SET
  10735. #define HTT_RX_PEER_UNMAP_PEER_ID_GET HTT_RX_PEER_MAP_PEER_ID_GET
  10736. #define HTT_RX_PEER_UNMAP_VDEV_ID_SET HTT_RX_PEER_MAP_VDEV_ID_SET
  10737. #define HTT_RX_PEER_UNMAP_VDEV_ID_GET HTT_RX_PEER_MAP_VDEV_ID_GET
  10738. #define HTT_RX_PEER_UNMAP_BYTES 4
  10739. /**
  10740. * @brief target -> host rx peer map V2 message definition
  10741. *
  10742. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V2
  10743. *
  10744. * @details
  10745. * The following diagram shows the format of the rx peer map v2 message sent
  10746. * from the target to the host. This layout assumes the target operates
  10747. * as little-endian.
  10748. *
  10749. * This message always contains a SW peer ID. The main purpose of the
  10750. * SW peer ID is to tell the host what peer ID rx packets will be tagged
  10751. * with, so that the host can use that peer ID to determine which peer
  10752. * transmitted the rx frame. This SW peer ID is sometimes also used for
  10753. * other purposes, such as identifying during tx completions which peer
  10754. * the tx frames in question were transmitted to.
  10755. *
  10756. * The peer map v2 message also contains a HW peer ID. This HW peer ID
  10757. * is used during rx --> tx frame forwarding to identify which peer the
  10758. * frame needs to be forwarded to (i.e. the peer assocated with the
  10759. * Destination MAC Address within the packet), and particularly which vdev
  10760. * needs to transmit the frame (for cases of inter-vdev rx --> tx forwarding).
  10761. * This DA-based peer ID that is provided for certain rx frames
  10762. * (the rx frames that need to be re-transmitted as tx frames)
  10763. * is the ID that the HW uses for referring to the peer in question,
  10764. * rather than the peer ID that the SW+FW use to refer to the peer.
  10765. *
  10766. * The HW peer id here is the same meaning as AST_INDEX_0.
  10767. * Some chips support up to 4 AST indices per peer: AST_INDEX_0, AST_INDEX_1,
  10768. * AST_INDEX_2, and AST_INDEX_3. AST 0 is always valid; for AST 1 through
  10769. * AST 3, check the AST_VALID_MASK(3) to see if the corresponding extension
  10770. * AST is valid.
  10771. *
  10772. * |31 28|27 24|23 21|20|19 17|16|15 8|7 0|
  10773. * |-------------------------------------------------------------------------|
  10774. * | SW peer ID | VDEV ID | msg type |
  10775. * |-------------------------------------------------------------------------|
  10776. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  10777. * |-------------------------------------------------------------------------|
  10778. * | HW peer ID / AST index 0 | MAC addr 5 | MAC addr 4 |
  10779. * |-------------------------------------------------------------------------|
  10780. * | Reserved_21_31 |OA|ASTVM|NH| AST Hash Value |
  10781. * |-------------------------------------------------------------------------|
  10782. * | ASTFM3 | ASTFM2 | ASTFM1 | ASTFM0 | AST index 1 |
  10783. * |-------------------------------------------------------------------------|
  10784. * |TID valid low pri| TID valid hi pri | AST index 2 |
  10785. * |-------------------------------------------------------------------------|
  10786. * | LMAC/PMAC_RXPCU AST index | AST index 3 |
  10787. * |-------------------------------------------------------------------------|
  10788. * | Reserved_2 |
  10789. * |-------------------------------------------------------------------------|
  10790. * Where:
  10791. * NH = Next Hop
  10792. * ASTVM = AST valid mask
  10793. * OA = on-chip AST valid bit
  10794. * ASTFM = AST flow mask
  10795. *
  10796. * The following field definitions describe the format of the rx peer map v2
  10797. * messages sent from the target to the host.
  10798. * - MSG_TYPE
  10799. * Bits 7:0
  10800. * Purpose: identifies this as an rx peer map v2 message
  10801. * Value: peer map v2 -> 0x1e (HTT_T2H_MSG_TYPE_PEER_MAP_V2)
  10802. * - VDEV_ID
  10803. * Bits 15:8
  10804. * Purpose: Indicates which virtual device the peer is associated with.
  10805. * Value: vdev ID (used in the host to look up the vdev object)
  10806. * - SW_PEER_ID
  10807. * Bits 31:16
  10808. * Purpose: The peer ID (index) that WAL is allocating
  10809. * Value: (rx) peer ID
  10810. * - MAC_ADDR_L32
  10811. * Bits 31:0
  10812. * Purpose: Identifies which peer node the peer ID is for.
  10813. * Value: lower 4 bytes of peer node's MAC address
  10814. * - MAC_ADDR_U16
  10815. * Bits 15:0
  10816. * Purpose: Identifies which peer node the peer ID is for.
  10817. * Value: upper 2 bytes of peer node's MAC address
  10818. * - HW_PEER_ID / AST_INDEX_0
  10819. * Bits 31:16
  10820. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  10821. * address, so for rx frames marked for rx --> tx forwarding, the
  10822. * host can determine from the HW peer ID provided as meta-data with
  10823. * the rx frame which peer the frame is supposed to be forwarded to.
  10824. * Value: ID used by the MAC HW to identify the peer
  10825. * - AST_HASH_VALUE
  10826. * Bits 15:0
  10827. * Purpose: Indicates AST Hash value is required for the TCL AST index
  10828. * override feature.
  10829. * - NEXT_HOP
  10830. * Bit 16
  10831. * Purpose: Bit indicates that a next_hop AST entry is used for WDS
  10832. * (Wireless Distribution System).
  10833. * - AST_VALID_MASK
  10834. * Bits 19:17
  10835. * Purpose: Indicate if the AST 1 through AST 3 are valid
  10836. * - ONCHIP_AST_VALID_FLAG
  10837. * Bit 20
  10838. * Purpose: Indicate if the on-chip AST index field (ONCHIP_AST_IDX)
  10839. * is valid.
  10840. * - AST_INDEX_1
  10841. * Bits 15:0
  10842. * Purpose: indicate the second AST index for this peer
  10843. * - AST_0_FLOW_MASK
  10844. * Bits 19:16
  10845. * Purpose: identify the which flow the AST 0 entry corresponds to.
  10846. * - AST_1_FLOW_MASK
  10847. * Bits 23:20
  10848. * Purpose: identify the which flow the AST 1 entry corresponds to.
  10849. * - AST_2_FLOW_MASK
  10850. * Bits 27:24
  10851. * Purpose: identify the which flow the AST 2 entry corresponds to.
  10852. * - AST_3_FLOW_MASK
  10853. * Bits 31:28
  10854. * Purpose: identify the which flow the AST 3 entry corresponds to.
  10855. * - AST_INDEX_2
  10856. * Bits 15:0
  10857. * Purpose: indicate the third AST index for this peer
  10858. * - TID_VALID_HI_PRI
  10859. * Bits 23:16
  10860. * Purpose: identify if this peer's TIDs 0-7 support HI priority flow
  10861. * - TID_VALID_LOW_PRI
  10862. * Bits 31:24
  10863. * Purpose: identify if this peer's TIDs 0-7 support Low priority flow
  10864. * - AST_INDEX_3
  10865. * Bits 15:0
  10866. * Purpose: indicate the fourth AST index for this peer
  10867. * - ONCHIP_AST_IDX / RESERVED
  10868. * Bits 31:16
  10869. * Purpose: This field is valid only when split AST feature is enabled.
  10870. * The ONCHIP_AST_VALID_FLAG identifies whether this field is valid.
  10871. * If valid, identifies the HW peer ID corresponding to the peer MAC
  10872. * address, this ast_idx is used for LMAC modules for RXPCU.
  10873. * Value: ID used by the LMAC HW to identify the peer
  10874. */
  10875. #define HTT_RX_PEER_MAP_V2_VDEV_ID_M 0xff00
  10876. #define HTT_RX_PEER_MAP_V2_VDEV_ID_S 8
  10877. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_M 0xffff0000
  10878. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_S 16
  10879. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M 0xffffffff
  10880. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S 0
  10881. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M 0xffff
  10882. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S 0
  10883. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_M 0xffff0000
  10884. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_S 16
  10885. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M 0x0000ffff
  10886. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S 0
  10887. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_M 0x00010000
  10888. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_S 16
  10889. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M 0x000e0000
  10890. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S 17
  10891. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M 0x00100000
  10892. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S 20
  10893. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_M 0xffff
  10894. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_S 0
  10895. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M 0x000f0000
  10896. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S 16
  10897. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M 0x00f00000
  10898. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S 20
  10899. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M 0x0f000000
  10900. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S 24
  10901. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M 0xf0000000
  10902. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S 28
  10903. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_M 0xffff
  10904. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_S 0
  10905. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M 0x00ff0000
  10906. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S 16
  10907. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M 0xff000000
  10908. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S 24
  10909. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_M 0xffff
  10910. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_S 0
  10911. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M 0xffff0000
  10912. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S 16
  10913. #define HTT_RX_PEER_MAP_V2_VDEV_ID_SET(word, value) \
  10914. do { \
  10915. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_VDEV_ID, value); \
  10916. (word) |= (value) << HTT_RX_PEER_MAP_V2_VDEV_ID_S; \
  10917. } while (0)
  10918. #define HTT_RX_PEER_MAP_V2_VDEV_ID_GET(word) \
  10919. (((word) & HTT_RX_PEER_MAP_V2_VDEV_ID_M) >> HTT_RX_PEER_MAP_V2_VDEV_ID_S)
  10920. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET(word, value) \
  10921. do { \
  10922. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_SW_PEER_ID, value); \
  10923. (word) |= (value) << HTT_RX_PEER_MAP_V2_SW_PEER_ID_S; \
  10924. } while (0)
  10925. #define HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET(word) \
  10926. (((word) & HTT_RX_PEER_MAP_V2_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_SW_PEER_ID_S)
  10927. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_SET(word, value) \
  10928. do { \
  10929. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_HW_PEER_ID, value); \
  10930. (word) |= (value) << HTT_RX_PEER_MAP_V2_HW_PEER_ID_S; \
  10931. } while (0)
  10932. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_GET(word) \
  10933. (((word) & HTT_RX_PEER_MAP_V2_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V2_HW_PEER_ID_S)
  10934. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_SET(word, value) \
  10935. do { \
  10936. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_HASH_VALUE, value); \
  10937. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S; \
  10938. } while (0)
  10939. #define HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_GET(word) \
  10940. (((word) & HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_AST_HASH_VALUE_S)
  10941. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_SET(word, value) \
  10942. do { \
  10943. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M, value); \
  10944. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S; \
  10945. } while (0)
  10946. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_GET(word) \
  10947. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_HASH_VALUE_S)
  10948. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_SET(word, value) \
  10949. do { \
  10950. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_NEXT_HOP, value); \
  10951. (word) |= (value) << HTT_RX_PEER_MAP_V2_NEXT_HOP_S; \
  10952. } while (0)
  10953. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_GET(word) \
  10954. (((word) & HTT_RX_PEER_MAP_V2_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V2_NEXT_HOP_S)
  10955. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_SET(word, value) \
  10956. do { \
  10957. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_VALID_MASK, value); \
  10958. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S; \
  10959. } while (0)
  10960. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_GET(word) \
  10961. (((word) & HTT_RX_PEER_MAP_V2_AST_VALID_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_VALID_MASK_S)
  10962. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  10963. do { \
  10964. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M, value); \
  10965. (word) |= (value) << HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S; \
  10966. } while (0)
  10967. #define HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_MASK_GET(word) \
  10968. (((word) & HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V2_ONCHIP_AST_VALID_FLAG_S)
  10969. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_SET(word, value) \
  10970. do { \
  10971. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_1, value); \
  10972. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_1_S; \
  10973. } while (0)
  10974. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_GET(word) \
  10975. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_1_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_1_S)
  10976. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_SET(word, value) \
  10977. do { \
  10978. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK, value); \
  10979. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S; \
  10980. } while (0)
  10981. #define HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_GET(word) \
  10982. (((word) & HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_0_FLOW_MASK_S)
  10983. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_SET(word, value) \
  10984. do { \
  10985. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK, value); \
  10986. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S; \
  10987. } while (0)
  10988. #define HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_GET(word) \
  10989. (((word) & HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_1_FLOW_MASK_S)
  10990. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_SET(word, value) \
  10991. do { \
  10992. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK, value); \
  10993. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S; \
  10994. } while (0)
  10995. #define HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_GET(word) \
  10996. (((word) & HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_2_FLOW_MASK_S)
  10997. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_SET(word, value) \
  10998. do { \
  10999. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK, value); \
  11000. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S; \
  11001. } while (0)
  11002. #define HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_GET(word) \
  11003. (((word) & HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_M) >> HTT_RX_PEER_MAP_V2_AST_3_FLOW_MASK_S)
  11004. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_SET(word, value) \
  11005. do { \
  11006. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_2, value); \
  11007. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_2_S; \
  11008. } while (0)
  11009. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_GET(word) \
  11010. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_2_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_2_S)
  11011. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_SET(word, value) \
  11012. do { \
  11013. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI, value); \
  11014. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S; \
  11015. } while (0)
  11016. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_GET(word) \
  11017. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_S)
  11018. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_SET(word, value) \
  11019. do { \
  11020. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI, value); \
  11021. (word) |= (value) << HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S; \
  11022. } while (0)
  11023. #define HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_GET(word) \
  11024. (((word) & HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_M) >> HTT_RX_PEER_MAP_V2_TID_VALID_LOW_PRI_S)
  11025. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_SET(word, value) \
  11026. do { \
  11027. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V2_AST_INDEX_3, value); \
  11028. (word) |= (value) << HTT_RX_PEER_MAP_V2_AST_INDEX_3_S; \
  11029. } while (0)
  11030. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_GET(word) \
  11031. (((word) & HTT_RX_PEER_MAP_V2_AST_INDEX_3_M) >> HTT_RX_PEER_MAP_V2_AST_INDEX_3_S)
  11032. #define HTT_RX_PEER_MAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11033. #define HTT_RX_PEER_MAP_V2_HW_PEER_ID_OFFSET 8 /* bytes */
  11034. #define HTT_RX_PEER_MAP_V2_AST_HASH_INDEX_OFFSET 12 /* bytes */
  11035. #define HTT_RX_PEER_MAP_V2_NEXT_HOP_OFFSET 12 /* bytes */
  11036. #define HTT_RX_PEER_MAP_V2_AST_VALID_MASK_OFFSET 12 /* bytes */
  11037. #define HTT_RX_PEER_MAP_V2_AST_INDEX_1_OFFSET 16 /* bytes */
  11038. #define HTT_RX_PEER_MAP_V2_AST_X_FLOW_MASK_OFFSET 16 /* bytes */
  11039. #define HTT_RX_PEER_MAP_V2_AST_INDEX_2_OFFSET 20 /* bytes */
  11040. #define HTT_RX_PEER_MAP_V2_TID_VALID_LO_PRI_OFFSET 20 /* bytes */
  11041. #define HTT_RX_PEER_MAP_V2_TID_VALID_HI_PRI_OFFSET 20 /* bytes */
  11042. #define HTT_RX_PEER_MAP_V2_AST_INDEX_3_OFFSET 24 /* bytes */
  11043. #define HTT_RX_PEER_MAP_V2_BYTES 32
  11044. /**
  11045. * @brief target -> host rx peer map V3 message definition
  11046. *
  11047. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_MAP_V3
  11048. *
  11049. * @details
  11050. * The following diagram shows the format of the rx peer map v3 message sent
  11051. * from the target to the host.
  11052. * Format inherits HTT_T2H_MSG_TYPE_PEER_MAP_V2 published above
  11053. * This layout assumes the target operates as little-endian.
  11054. *
  11055. * |31 24|23 20|19|18|17|16|15 8|7 0|
  11056. * |-----------------+--------+--+--+--+--+-----------------+-----------------|
  11057. * | SW peer ID | VDEV ID | msg type |
  11058. * |-----------------+--------------------+-----------------+-----------------|
  11059. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11060. * |-----------------+--------------------+-----------------+-----------------|
  11061. * | Multicast SW peer ID | MAC addr 5 | MAC addr 4 |
  11062. * |-----------------+--------+-----------+-----------------+-----------------|
  11063. * | HTT_MSDU_IDX_ |RESERVED| CACHE_ | |
  11064. * | VALID_MASK |(4bits) | SET_NUM | HW peer ID / AST index |
  11065. * | (8bits) | | (4bits) | |
  11066. * |-----------------+--------+--+--+--+--------------------------------------|
  11067. * | RESERVED |E |O | | |
  11068. * | (13bits) |A |A |NH| on-Chip PMAC_RXPCU AST index |
  11069. * | |V |V | | |
  11070. * |-----------------+--------------------+-----------------------------------|
  11071. * | HTT_MSDU_IDX_ | RESERVED | |
  11072. * | VALID_MASK_EXT | (8bits) | EXT AST index |
  11073. * | (8bits) | | |
  11074. * |-----------------+--------------------+-----------------------------------|
  11075. * | Reserved_2 |
  11076. * |--------------------------------------------------------------------------|
  11077. * | Reserved_3 |
  11078. * |--------------------------------------------------------------------------|
  11079. *
  11080. * Where:
  11081. * EAV = EXT_AST_VALID flag, for "EXT AST index"
  11082. * OAV = ONCHIP_AST_VALID flag, for "on-Chip PMAC_RXPCU AST index"
  11083. * NH = Next Hop
  11084. * The following field definitions describe the format of the rx peer map v3
  11085. * messages sent from the target to the host.
  11086. * - MSG_TYPE
  11087. * Bits 7:0
  11088. * Purpose: identifies this as a peer map v3 message
  11089. * Value: 0x2b (HTT_T2H_MSG_TYPE_PEER_MAP_V3)
  11090. * - VDEV_ID
  11091. * Bits 15:8
  11092. * Purpose: Indicates which virtual device the peer is associated with.
  11093. * - SW_PEER_ID
  11094. * Bits 31:16
  11095. * Purpose: The peer ID (index) that WAL has allocated for this peer.
  11096. * - MAC_ADDR_L32
  11097. * Bits 31:0
  11098. * Purpose: Identifies which peer node the peer ID is for.
  11099. * Value: lower 4 bytes of peer node's MAC address
  11100. * - MAC_ADDR_U16
  11101. * Bits 15:0
  11102. * Purpose: Identifies which peer node the peer ID is for.
  11103. * Value: upper 2 bytes of peer node's MAC address
  11104. * - MULTICAST_SW_PEER_ID
  11105. * Bits 31:16
  11106. * Purpose: The multicast peer ID (index)
  11107. * Value: set to HTT_INVALID_PEER if not valid
  11108. * - HW_PEER_ID / AST_INDEX
  11109. * Bits 15:0
  11110. * Purpose: Identifies the HW peer ID corresponding to the peer MAC
  11111. * address, so for rx frames marked for rx --> tx forwarding, the
  11112. * host can determine from the HW peer ID provided as meta-data with
  11113. * the rx frame which peer the frame is supposed to be forwarded to.
  11114. * - CACHE_SET_NUM
  11115. * Bits 19:16
  11116. * Purpose: Cache Set Number for AST_INDEX
  11117. * Cache set number that should be used to cache the index based
  11118. * search results, for address and flow search.
  11119. * This value should be equal to LSB 4 bits of the hash value
  11120. * of match data, in case of search index points to an entry which
  11121. * may be used in content based search also. The value can be
  11122. * anything when the entry pointed by search index will not be
  11123. * used for content based search.
  11124. * - HTT_MSDU_IDX_VALID_MASK
  11125. * Bits 31:24
  11126. * Purpose: Shows MSDU indexes valid mask for AST_INDEX
  11127. * - ONCHIP_AST_IDX / RESERVED
  11128. * Bits 15:0
  11129. * Purpose: This field is valid only when split AST feature is enabled.
  11130. * The ONCHIP_AST_VALID flag identifies whether this field is valid.
  11131. * If valid, identifies the HW peer ID corresponding to the peer MAC
  11132. * address, this ast_idx is used for LMAC modules for RXPCU.
  11133. * - NEXT_HOP
  11134. * Bits 16
  11135. * Purpose: Flag indicates next_hop AST entry used for WDS
  11136. * (Wireless Distribution System).
  11137. * - ONCHIP_AST_VALID
  11138. * Bits 17
  11139. * Purpose: Flag indicates valid data behind of the ONCHIP_AST_IDX field
  11140. * - EXT_AST_VALID
  11141. * Bits 18
  11142. * Purpose: Flag indicates valid data behind of the EXT_AST_INDEX field
  11143. * - EXT_AST_INDEX
  11144. * Bits 15:0
  11145. * Purpose: This field describes Extended AST index
  11146. * Valid if EXT_AST_VALID flag set
  11147. * - HTT_MSDU_IDX_VALID_MASK_EXT
  11148. * Bits 31:24
  11149. * Purpose: Shows MSDU indexes valid mask for EXT_AST_INDEX
  11150. */
  11151. /* dword 0 */
  11152. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_M 0xffff0000
  11153. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_S 16
  11154. #define HTT_RX_PEER_MAP_V3_VDEV_ID_M 0x0000ff00
  11155. #define HTT_RX_PEER_MAP_V3_VDEV_ID_S 8
  11156. /* dword 1 */
  11157. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_M 0xffffffff
  11158. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_L32_S 0
  11159. /* dword 2 */
  11160. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_M 0x0000ffff
  11161. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_U16_S 0
  11162. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M 0xffff0000
  11163. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S 16
  11164. /* dword 3 */
  11165. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M 0xff000000
  11166. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S 24
  11167. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M 0x000f0000
  11168. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S 16
  11169. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_M 0x0000ffff
  11170. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_S 0
  11171. /* dword 4 */
  11172. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M 0x00040000
  11173. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S 18
  11174. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M 0x00020000
  11175. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S 17
  11176. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_M 0x00010000
  11177. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_S 16
  11178. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_M 0x0000ffff
  11179. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S 0
  11180. /* dword 5 */
  11181. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M 0xff000000
  11182. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S 24
  11183. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M 0x0000ffff
  11184. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S 0
  11185. #define HTT_RX_PEER_MAP_V3_VDEV_ID_SET(word, value) \
  11186. do { \
  11187. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_VDEV_ID, value); \
  11188. (word) |= (value) << HTT_RX_PEER_MAP_V3_VDEV_ID_S; \
  11189. } while (0)
  11190. #define HTT_RX_PEER_MAP_V3_VDEV_ID_GET(word) \
  11191. (((word) & HTT_RX_PEER_MAP_V3_VDEV_ID_M) >> HTT_RX_PEER_MAP_V3_VDEV_ID_S)
  11192. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_SET(word, value) \
  11193. do { \
  11194. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_SW_PEER_ID, value); \
  11195. (word) |= (value) << HTT_RX_PEER_MAP_V3_SW_PEER_ID_S; \
  11196. } while (0)
  11197. #define HTT_RX_PEER_MAP_V3_SW_PEER_ID_GET(word) \
  11198. (((word) & HTT_RX_PEER_MAP_V3_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_SW_PEER_ID_S)
  11199. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_SET(word, value) \
  11200. do { \
  11201. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID, value); \
  11202. (word) |= (value) << HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S; \
  11203. } while (0)
  11204. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_GET(word) \
  11205. (((word) & HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_S)
  11206. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_SET(word, value) \
  11207. do { \
  11208. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_HW_PEER_ID, value); \
  11209. (word) |= (value) << HTT_RX_PEER_MAP_V3_HW_PEER_ID_S; \
  11210. } while (0)
  11211. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_GET(word) \
  11212. (((word) & HTT_RX_PEER_MAP_V3_HW_PEER_ID_M) >> HTT_RX_PEER_MAP_V3_HW_PEER_ID_S)
  11213. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_SET(word, value) \
  11214. do { \
  11215. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_CACHE_SET_NUM, value); \
  11216. (word) |= (value) << HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S; \
  11217. } while (0)
  11218. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_GET(word) \
  11219. (((word) & HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_M) >> HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_S)
  11220. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_SET(word, value) \
  11221. do { \
  11222. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST, value); \
  11223. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S; \
  11224. } while (0)
  11225. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_GET(word) \
  11226. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_S)
  11227. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_SET(word, value) \
  11228. do { \
  11229. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX, value); \
  11230. (word) |= (value) << HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_S; \
  11231. } while (0)
  11232. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_GET(word) \
  11233. (((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)
  11234. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_SET(word, value) \
  11235. do { \
  11236. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_NEXT_HOP, value); \
  11237. (word) |= (value) << HTT_RX_PEER_MAP_V3_NEXT_HOP_S; \
  11238. } while (0)
  11239. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_GET(word) \
  11240. (((word) & HTT_RX_PEER_MAP_V3_NEXT_HOP_M) >> HTT_RX_PEER_MAP_V3_NEXT_HOP_S)
  11241. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_SET(word, value) \
  11242. do { \
  11243. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG, value); \
  11244. (word) |= (value) << HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S; \
  11245. } while (0)
  11246. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_GET(word) \
  11247. (((word) & HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_S)
  11248. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_SET(word, value) \
  11249. do { \
  11250. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG, value); \
  11251. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S; \
  11252. } while (0)
  11253. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_GET(word) \
  11254. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_S)
  11255. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_SET(word, value) \
  11256. do { \
  11257. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_EXT_AST_IDX, value); \
  11258. (word) |= (value) << HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S; \
  11259. } while (0)
  11260. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_GET(word) \
  11261. (((word) & HTT_RX_PEER_MAP_V3_EXT_AST_IDX_M) >> HTT_RX_PEER_MAP_V3_EXT_AST_IDX_S)
  11262. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_SET(word, value) \
  11263. do { \
  11264. HTT_CHECK_SET_VAL(HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST, value); \
  11265. (word) |= (value) << HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S; \
  11266. } while (0)
  11267. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_GET(word) \
  11268. (((word) & HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_M) >> HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_S)
  11269. #define HTT_RX_PEER_MAP_V3_MAC_ADDR_OFFSET 4 /* bytes */
  11270. #define HTT_RX_PEER_MAP_V3_MULTICAST_SW_PEER_ID_OFFSET 8 /* bytes */
  11271. #define HTT_RX_PEER_MAP_V3_HW_PEER_ID_OFFSET 12 /* bytes */
  11272. #define HTT_RX_PEER_MAP_V3_CACHE_SET_NUM_OFFSET 12 /* bytes */
  11273. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_AST_OFFSET 12 /* bytes */
  11274. #define HTT_RX_PEER_MAP_V3_ON_CHIP_PMAC_RXPCU_AST_IDX_OFFSET 16 /* bytes */
  11275. #define HTT_RX_PEER_MAP_V3_NEXT_HOP_OFFSET 16 /* bytes */
  11276. #define HTT_RX_PEER_MAP_V3_ONCHIP_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11277. #define HTT_RX_PEER_MAP_V3_EXT_AST_VALID_FLAG_OFFSET 16 /* bytes */
  11278. #define HTT_RX_PEER_MAP_V3_EXT_AST_IDX_OFFSET 20 /* bytes */
  11279. #define HTT_RX_PEER_MAP_V3_MSDU_IDX_VM_EXT_AST_OFFSET 20 /* bytes */
  11280. #define HTT_RX_PEER_MAP_V3_BYTES 32
  11281. /**
  11282. * @brief target -> host rx peer unmap V2 message definition
  11283. *
  11284. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_UNMAP_V2
  11285. *
  11286. * The following diagram shows the format of the rx peer unmap message sent
  11287. * from the target to the host.
  11288. *
  11289. * |31 24|23 16|15 8|7 0|
  11290. * |-----------------------------------------------------------------------|
  11291. * | SW peer ID | VDEV ID | msg type |
  11292. * |-----------------------------------------------------------------------|
  11293. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11294. * |-----------------------------------------------------------------------|
  11295. * | Reserved_17_31 | Next Hop | MAC addr 5 | MAC addr 4 |
  11296. * |-----------------------------------------------------------------------|
  11297. * | Peer Delete Duration |
  11298. * |-----------------------------------------------------------------------|
  11299. * | Reserved_0 | WDS Free Count |
  11300. * |-----------------------------------------------------------------------|
  11301. * | Reserved_1 |
  11302. * |-----------------------------------------------------------------------|
  11303. * | Reserved_2 |
  11304. * |-----------------------------------------------------------------------|
  11305. *
  11306. *
  11307. * The following field definitions describe the format of the rx peer unmap
  11308. * messages sent from the target to the host.
  11309. * - MSG_TYPE
  11310. * Bits 7:0
  11311. * Purpose: identifies this as an rx peer unmap v2 message
  11312. * Value: peer unmap v2 -> 0x1f (HTT_T2H_MSG_TYPE_PEER_UNMAP_V2)
  11313. * - VDEV_ID
  11314. * Bits 15:8
  11315. * Purpose: Indicates which virtual device the peer is associated
  11316. * with.
  11317. * Value: vdev ID (used in the host to look up the vdev object)
  11318. * - SW_PEER_ID
  11319. * Bits 31:16
  11320. * Purpose: The peer ID (index) that WAL is freeing
  11321. * Value: (rx) peer ID
  11322. * - MAC_ADDR_L32
  11323. * Bits 31:0
  11324. * Purpose: Identifies which peer node the peer ID is for.
  11325. * Value: lower 4 bytes of peer node's MAC address
  11326. * - MAC_ADDR_U16
  11327. * Bits 15:0
  11328. * Purpose: Identifies which peer node the peer ID is for.
  11329. * Value: upper 2 bytes of peer node's MAC address
  11330. * - NEXT_HOP
  11331. * Bits 16
  11332. * Purpose: Bit indicates next_hop AST entry used for WDS
  11333. * (Wireless Distribution System).
  11334. * - PEER_DELETE_DURATION
  11335. * Bits 31:0
  11336. * Purpose: Time taken to delete peer, in msec,
  11337. * Used for monitoring / debugging PEER delete response delay
  11338. * - PEER_WDS_FREE_COUNT
  11339. * Bits 15:0
  11340. * Purpose: Count of WDS entries deleted associated to peer deleted
  11341. */
  11342. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_M HTT_RX_PEER_MAP_V2_VDEV_ID_M
  11343. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_S HTT_RX_PEER_MAP_V2_VDEV_ID_S
  11344. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_M HTT_RX_PEER_MAP_V2_SW_PEER_ID_M
  11345. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_S HTT_RX_PEER_MAP_V2_SW_PEER_ID_S
  11346. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_M HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_M
  11347. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_L32_S HTT_RX_PEER_MAP_V2_MAC_ADDR_L32_S
  11348. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_M HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_M
  11349. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_U16_S HTT_RX_PEER_MAP_V2_MAC_ADDR_U16_S
  11350. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_M HTT_RX_PEER_MAP_V2_NEXT_HOP_M
  11351. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_S HTT_RX_PEER_MAP_V2_NEXT_HOP_S
  11352. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M 0xffffffff
  11353. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S 0
  11354. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M 0x0000ffff
  11355. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S 0
  11356. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_SET HTT_RX_PEER_MAP_V2_VDEV_ID_SET
  11357. #define HTT_RX_PEER_UNMAP_V2_VDEV_ID_GET HTT_RX_PEER_MAP_V2_VDEV_ID_GET
  11358. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_SET HTT_RX_PEER_MAP_V2_SW_PEER_ID_SET
  11359. #define HTT_RX_PEER_UNMAP_V2_SW_PEER_ID_GET HTT_RX_PEER_MAP_V2_SW_PEER_ID_GET
  11360. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_SET HTT_RX_PEER_MAP_V2_NEXT_HOP_SET
  11361. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_GET HTT_RX_PEER_MAP_V2_NEXT_HOP_GET
  11362. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_SET(word, value) \
  11363. do { \
  11364. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION, value); \
  11365. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S; \
  11366. } while (0)
  11367. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_GET(word) \
  11368. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_M) >> HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_S)
  11369. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_SET(word, value) \
  11370. do { \
  11371. HTT_CHECK_SET_VAL(HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT, value); \
  11372. (word) |= (value) << HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S; \
  11373. } while (0)
  11374. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_GET(word) \
  11375. (((word) & HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_M) >> HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_S)
  11376. #define HTT_RX_PEER_UNMAP_V2_MAC_ADDR_OFFSET 4 /* bytes */
  11377. #define HTT_RX_PEER_UNMAP_V2_NEXT_HOP_OFFSET 8 /* bytes */
  11378. #define HTT_RX_PEER_UNMAP_V2_PEER_DELETE_DURATION_OFFSET 12 /* bytes */
  11379. #define HTT_RX_PEER_UNMAP_V2_PEER_WDS_FREE_COUNT_OFFSET 16 /* bytes */
  11380. #define HTT_RX_PEER_UNMAP_V2_BYTES 28
  11381. /**
  11382. * @brief target -> host rx peer mlo map message definition
  11383. *
  11384. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP
  11385. *
  11386. * @details
  11387. * The following diagram shows the format of the rx mlo peer map message sent
  11388. * from the target to the host. This layout assumes the target operates
  11389. * as little-endian.
  11390. *
  11391. * MCC:
  11392. * One HTT_MLO_PEER_MAP is sent after PEER_ASSOC received on first LINK for both STA and SAP.
  11393. *
  11394. * WIN:
  11395. * One HTT_MLO_PEER_MAP is sent after peers are created on all the links for both AP and STA.
  11396. * It will be sent on the Assoc Link.
  11397. *
  11398. * This message always contains a MLO peer ID. The main purpose of the
  11399. * MLO peer ID is to tell the host what peer ID rx packets will be tagged
  11400. * with, so that the host can use that MLO peer ID to determine which peer
  11401. * transmitted the rx frame.
  11402. *
  11403. * |31 |29 27|26 24|23 20|19 17|16|15 8|7 0|
  11404. * |-------------------------------------------------------------------------|
  11405. * |RSVD | PRC |NUMLINK| MLO peer ID | msg type |
  11406. * |-------------------------------------------------------------------------|
  11407. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  11408. * |-------------------------------------------------------------------------|
  11409. * | RSVD_16_31 | MAC addr 5 | MAC addr 4 |
  11410. * |-------------------------------------------------------------------------|
  11411. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 0 |
  11412. * |-------------------------------------------------------------------------|
  11413. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 1 |
  11414. * |-------------------------------------------------------------------------|
  11415. * |CACHE_SET_NUM| TIDMASK |CHIPID|V| Primary TCL AST IDX 2 |
  11416. * |-------------------------------------------------------------------------|
  11417. * |RSVD |
  11418. * |-------------------------------------------------------------------------|
  11419. * |RSVD |
  11420. * |-------------------------------------------------------------------------|
  11421. * | htt_tlv_hdr_t |
  11422. * |-------------------------------------------------------------------------|
  11423. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11424. * |-------------------------------------------------------------------------|
  11425. * | htt_tlv_hdr_t |
  11426. * |-------------------------------------------------------------------------|
  11427. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11428. * |-------------------------------------------------------------------------|
  11429. * | htt_tlv_hdr_t |
  11430. * |-------------------------------------------------------------------------|
  11431. * |RSVD_27_31 |CHIPID| VDEVID | SW peer ID |
  11432. * |-------------------------------------------------------------------------|
  11433. *
  11434. * Where:
  11435. * PRC - Primary REO CHIPID - 3 Bits Bit24,25,26
  11436. * NUMLINK - NUM_LOGICAL_LINKS - 3 Bits Bit27,28,29
  11437. * V (valid) - 1 Bit Bit17
  11438. * CHIPID - 3 Bits
  11439. * TIDMASK - 8 Bits
  11440. * CACHE_SET_NUM - 8 Bits
  11441. *
  11442. * The following field definitions describe the format of the rx MLO peer map
  11443. * messages sent from the target to the host.
  11444. * - MSG_TYPE
  11445. * Bits 7:0
  11446. * Purpose: identifies this as an rx mlo peer map message
  11447. * Value: 0x29 (HTT_T2H_MSG_TYPE_MLO_RX_PEER_MAP)
  11448. *
  11449. * - MLO_PEER_ID
  11450. * Bits 23:8
  11451. * Purpose: The MLO peer ID (index).
  11452. * For MCC, FW will allocate it. For WIN, Host will allocate it.
  11453. * Value: MLO peer ID
  11454. *
  11455. * - NUMLINK
  11456. * Bits: 26:24 (3Bits)
  11457. * Purpose: Indicate the max number of logical links supported per client.
  11458. * Value: number of logical links
  11459. *
  11460. * - PRC
  11461. * Bits: 29:27 (3Bits)
  11462. * Purpose: Indicate the Primary REO CHIPID. The ID can be used to indicate
  11463. * if there is migration of the primary chip.
  11464. * Value: Primary REO CHIPID
  11465. *
  11466. * - MAC_ADDR_L32
  11467. * Bits 31:0
  11468. * Purpose: Identifies which mlo peer node the mlo peer ID is for.
  11469. * Value: lower 4 bytes of peer node's MAC address
  11470. *
  11471. * - MAC_ADDR_U16
  11472. * Bits 15:0
  11473. * Purpose: Identifies which peer node the peer ID is for.
  11474. * Value: upper 2 bytes of peer node's MAC address
  11475. *
  11476. * - PRIMARY_TCL_AST_IDX
  11477. * Bits 15:0
  11478. * Purpose: Primary TCL AST index for this peer.
  11479. *
  11480. * - V
  11481. * 1 Bit Position 16
  11482. * Purpose: If the ast idx is valid.
  11483. *
  11484. * - CHIPID
  11485. * Bits 19:17
  11486. * Purpose: Identifies which chip id of PRIMARY_TCL_AST_IDX
  11487. *
  11488. * - TIDMASK
  11489. * Bits 27:20
  11490. * Purpose: LINK to TID mapping for PRIMARY_TCL_AST_IDX
  11491. *
  11492. * - CACHE_SET_NUM
  11493. * Bits 31:28
  11494. * Purpose: Cache Set Number for PRIMARY_TCL_AST_IDX
  11495. * Cache set number that should be used to cache the index based
  11496. * search results, for address and flow search.
  11497. * This value should be equal to LSB four bits of the hash value
  11498. * of match data, in case of search index points to an entry which
  11499. * may be used in content based search also. The value can be
  11500. * anything when the entry pointed by search index will not be
  11501. * used for content based search.
  11502. *
  11503. * - htt_tlv_hdr_t
  11504. * Purpose: Provide link specific chip,vdev and sw_peer IDs
  11505. *
  11506. * Bits 11:0
  11507. * Purpose: tag equal to MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS.
  11508. *
  11509. * Bits 23:12
  11510. * Purpose: Length, Length of the value that follows the header
  11511. *
  11512. * Bits 31:28
  11513. * Purpose: Reserved.
  11514. *
  11515. *
  11516. * - SW_PEER_ID
  11517. * Bits 15:0
  11518. * Purpose: The peer ID (index) that WAL is allocating
  11519. * Value: (rx) peer ID
  11520. *
  11521. * - VDEV_ID
  11522. * Bits 23:16
  11523. * Purpose: Indicates which virtual device the peer is associated with.
  11524. * Value: vdev ID (used in the host to look up the vdev object)
  11525. *
  11526. * - CHIPID
  11527. * Bits 26:24
  11528. * Purpose: Indicates which Chip id the peer is associated with.
  11529. * Value: chip ID (Provided by Host as part of QMI exchange)
  11530. */
  11531. typedef enum {
  11532. MLO_PEER_MAP_TLV_STRUCT_SOC_VDEV_PEER_IDS,
  11533. } MLO_PEER_MAP_TLV_TAG_ID;
  11534. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M 0x00ffff00
  11535. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S 8
  11536. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M 0x07000000
  11537. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S 24
  11538. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M 0x38000000
  11539. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S 27
  11540. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_M 0xffffffff
  11541. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_L32_S 0
  11542. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_M 0x0000ffff
  11543. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_U16_S 0
  11544. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M 0x0000ffff
  11545. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S 0
  11546. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M 0x00010000
  11547. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S 16
  11548. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M 0x000E0000
  11549. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S 17
  11550. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M 0x00F00000
  11551. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S 20
  11552. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M 0xF0000000
  11553. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S 28
  11554. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_M 0x00000fff
  11555. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_S 0
  11556. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M 0x00fff000
  11557. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S 12
  11558. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M 0x0000ffff
  11559. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S 0
  11560. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_M 0x00ff0000
  11561. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_S 16
  11562. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_M 0x07000000
  11563. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_S 24
  11564. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET(word, value) \
  11565. do { \
  11566. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_MLO_PEER_ID, value); \
  11567. (word) |= (value) << HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S; \
  11568. } while (0)
  11569. #define HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET(word) \
  11570. (((word) & HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S)
  11571. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_SET(word, value) \
  11572. do { \
  11573. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS, value); \
  11574. (word) |= (value) << HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S; \
  11575. } while (0)
  11576. #define HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_GET(word) \
  11577. (((word) & HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_M) >> HTT_RX_MLO_PEER_MAP_NUM_LOGICAL_LINKS_S)
  11578. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_SET(word, value) \
  11579. do { \
  11580. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID, value); \
  11581. (word) |= (value) << HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S; \
  11582. } while (0)
  11583. #define HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_GET(word) \
  11584. (((word) & HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_M) >> HTT_RX_MLO_PEER_PRIMARY_REO_CHIP_ID_S)
  11585. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_SET(word, value) \
  11586. do { \
  11587. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX, value); \
  11588. (word) |= (value) << HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S; \
  11589. } while (0)
  11590. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_GET(word) \
  11591. (((word) & HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_S)
  11592. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_SET(word, value) \
  11593. do { \
  11594. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG, value); \
  11595. (word) |= (value) << HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S; \
  11596. } while (0)
  11597. #define HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_GET(word) \
  11598. (((word) & HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_M) >> HTT_RX_MLO_PEER_MAP_AST_INDEX_VALID_FLAG_S)
  11599. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_SET(word, value) \
  11600. do { \
  11601. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX, value); \
  11602. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S; \
  11603. } while (0)
  11604. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_GET(word) \
  11605. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_AST_INDEX_S)
  11606. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_SET(word, value) \
  11607. do { \
  11608. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX, value); \
  11609. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S; \
  11610. } while (0)
  11611. #define HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_GET(word) \
  11612. (((word) & HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_TIDMASK_AST_INDEX_S)
  11613. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_SET(word, value) \
  11614. do { \
  11615. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX, value); \
  11616. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S; \
  11617. } while (0)
  11618. #define HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_GET(word) \
  11619. (((word) & HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_M) >> HTT_RX_MLO_PEER_MAP_CACHE_SET_NUM_AST_INDEX_S)
  11620. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_SET(word, value) \
  11621. do { \
  11622. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_TAG, value); \
  11623. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_TAG_S; \
  11624. } while (0)
  11625. #define HTT_RX_MLO_PEER_MAP_TLV_TAG_GET(word) \
  11626. (((word) & HTT_RX_MLO_PEER_MAP_TLV_TAG_M) >> HTT_RX_MLO_PEER_MAP_TLV_TAG_S)
  11627. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_SET(word, value) \
  11628. do { \
  11629. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_TLV_LENGTH, value); \
  11630. (word) |= (value) << HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S; \
  11631. } while (0)
  11632. #define HTT_RX_MLO_PEER_MAP_TLV_LENGTH_GET(word) \
  11633. (((word) & HTT_RX_MLO_PEER_MAP_TLV_LENGTH_M) >> HTT_RX_MLO_PEER_MAP_TLV_LENGTH_S)
  11634. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_SET(word, value) \
  11635. do { \
  11636. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_SW_PEER_ID, value); \
  11637. (word) |= (value) << HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S; \
  11638. } while (0)
  11639. #define HTT_RX_MLO_PEER_MAP_SW_PEER_ID_GET(word) \
  11640. (((word) & HTT_RX_MLO_PEER_MAP_SW_PEER_ID_M) >> HTT_RX_MLO_PEER_MAP_SW_PEER_ID_S)
  11641. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_SET(word, value) \
  11642. do { \
  11643. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_VDEV_ID, value); \
  11644. (word) |= (value) << HTT_RX_MLO_PEER_MAP_VDEV_ID_S; \
  11645. } while (0)
  11646. #define HTT_RX_MLO_PEER_MAP_VDEV_ID_GET(word) \
  11647. (((word) & HTT_RX_MLO_PEER_MAP_VDEV_ID_M) >> HTT_RX_MLO_PEER_MAP_VDEV_ID_S)
  11648. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_SET(word, value) \
  11649. do { \
  11650. HTT_CHECK_SET_VAL(HTT_RX_MLO_PEER_MAP_CHIP_ID, value); \
  11651. (word) |= (value) << HTT_RX_MLO_PEER_MAP_CHIP_ID_S; \
  11652. } while (0)
  11653. #define HTT_RX_MLO_PEER_MAP_CHIP_ID_GET(word) \
  11654. (((word) & HTT_RX_MLO_PEER_MAP_CHIP_ID_M) >> HTT_RX_MLO_PEER_MAP_CHIP_ID_S)
  11655. #define HTT_RX_MLO_PEER_MAP_MAC_ADDR_OFFSET 4 /* bytes */
  11656. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_0_OFFSET 12 /* bytes */
  11657. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_1_OFFSET 16 /* bytes */
  11658. #define HTT_RX_MLO_PEER_MAP_PRIMARY_AST_INDEX_2_OFFSET 20 /* bytes */
  11659. #define HTT_RX_MLO_PEER_MAP_TLV_OFFSET 32 /* bytes */
  11660. #define HTT_RX_MLO_PEER_MAP_FIXED_BYTES 8*4 /* 8 Dwords. Does not include the TLV header and the TLV */
  11661. /* MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_RX_PEER_UNMAP
  11662. *
  11663. * The following diagram shows the format of the rx mlo peer unmap message sent
  11664. * from the target to the host.
  11665. *
  11666. * |31 24|23 16|15 8|7 0|
  11667. * |-----------------------------------------------------------------------|
  11668. * | RSVD_24_31 | MLO peer ID | msg type |
  11669. * |-----------------------------------------------------------------------|
  11670. */
  11671. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_M HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_M
  11672. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_S HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_S
  11673. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_SET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_SET
  11674. #define HTT_RX_MLO_PEER_UNMAP_MLO_PEER_ID_GET HTT_RX_MLO_PEER_MAP_MLO_PEER_ID_GET
  11675. /**
  11676. * @brief target -> host message specifying security parameters
  11677. *
  11678. * MSG_TYPE => HTT_T2H_MSG_TYPE_SEC_IND
  11679. *
  11680. * @details
  11681. * The following diagram shows the format of the security specification
  11682. * message sent from the target to the host.
  11683. * This security specification message tells the host whether a PN check is
  11684. * necessary on rx data frames, and if so, how large the PN counter is.
  11685. * This message also tells the host about the security processing to apply
  11686. * to defragmented rx frames - specifically, whether a Message Integrity
  11687. * Check is required, and the Michael key to use.
  11688. *
  11689. * |31 24|23 16|15|14 8|7 0|
  11690. * |-----------------------------------------------------------------------|
  11691. * | peer ID | U| security type | msg type |
  11692. * |-----------------------------------------------------------------------|
  11693. * | Michael Key K0 |
  11694. * |-----------------------------------------------------------------------|
  11695. * | Michael Key K1 |
  11696. * |-----------------------------------------------------------------------|
  11697. * | WAPI RSC Low0 |
  11698. * |-----------------------------------------------------------------------|
  11699. * | WAPI RSC Low1 |
  11700. * |-----------------------------------------------------------------------|
  11701. * | WAPI RSC Hi0 |
  11702. * |-----------------------------------------------------------------------|
  11703. * | WAPI RSC Hi1 |
  11704. * |-----------------------------------------------------------------------|
  11705. *
  11706. * The following field definitions describe the format of the security
  11707. * indication message sent from the target to the host.
  11708. * - MSG_TYPE
  11709. * Bits 7:0
  11710. * Purpose: identifies this as a security specification message
  11711. * Value: 0xb (HTT_T2H_MSG_TYPE_SEC_IND)
  11712. * - SEC_TYPE
  11713. * Bits 14:8
  11714. * Purpose: specifies which type of security applies to the peer
  11715. * Value: htt_sec_type enum value
  11716. * - UNICAST
  11717. * Bit 15
  11718. * Purpose: whether this security is applied to unicast or multicast data
  11719. * Value: 1 -> unicast, 0 -> multicast
  11720. * - PEER_ID
  11721. * Bits 31:16
  11722. * Purpose: The ID number for the peer the security specification is for
  11723. * Value: peer ID
  11724. * - MICHAEL_KEY_K0
  11725. * Bits 31:0
  11726. * Purpose: 4-byte word that forms the 1st half of the TKIP Michael key
  11727. * Value: Michael Key K0 (if security type is TKIP)
  11728. * - MICHAEL_KEY_K1
  11729. * Bits 31:0
  11730. * Purpose: 4-byte word that forms the 2nd half of the TKIP Michael key
  11731. * Value: Michael Key K1 (if security type is TKIP)
  11732. * - WAPI_RSC_LOW0
  11733. * Bits 31:0
  11734. * Purpose: 4-byte word that forms the 1st quarter of the 16 byte WAPI RSC
  11735. * Value: WAPI RSC Low0 (if security type is WAPI)
  11736. * - WAPI_RSC_LOW1
  11737. * Bits 31:0
  11738. * Purpose: 4-byte word that forms the 2nd quarter of the 16 byte WAPI RSC
  11739. * Value: WAPI RSC Low1 (if security type is WAPI)
  11740. * - WAPI_RSC_HI0
  11741. * Bits 31:0
  11742. * Purpose: 4-byte word that forms the 3rd quarter of the 16 byte WAPI RSC
  11743. * Value: WAPI RSC Hi0 (if security type is WAPI)
  11744. * - WAPI_RSC_HI1
  11745. * Bits 31:0
  11746. * Purpose: 4-byte word that forms the 4th quarter of the 16 byte WAPI RSC
  11747. * Value: WAPI RSC Hi1 (if security type is WAPI)
  11748. */
  11749. #define HTT_SEC_IND_SEC_TYPE_M 0x00007f00
  11750. #define HTT_SEC_IND_SEC_TYPE_S 8
  11751. #define HTT_SEC_IND_UNICAST_M 0x00008000
  11752. #define HTT_SEC_IND_UNICAST_S 15
  11753. #define HTT_SEC_IND_PEER_ID_M 0xffff0000
  11754. #define HTT_SEC_IND_PEER_ID_S 16
  11755. #define HTT_SEC_IND_SEC_TYPE_SET(word, value) \
  11756. do { \
  11757. HTT_CHECK_SET_VAL(HTT_SEC_IND_SEC_TYPE, value); \
  11758. (word) |= (value) << HTT_SEC_IND_SEC_TYPE_S; \
  11759. } while (0)
  11760. #define HTT_SEC_IND_SEC_TYPE_GET(word) \
  11761. (((word) & HTT_SEC_IND_SEC_TYPE_M) >> HTT_SEC_IND_SEC_TYPE_S)
  11762. #define HTT_SEC_IND_UNICAST_SET(word, value) \
  11763. do { \
  11764. HTT_CHECK_SET_VAL(HTT_SEC_IND_UNICAST, value); \
  11765. (word) |= (value) << HTT_SEC_IND_UNICAST_S; \
  11766. } while (0)
  11767. #define HTT_SEC_IND_UNICAST_GET(word) \
  11768. (((word) & HTT_SEC_IND_UNICAST_M) >> HTT_SEC_IND_UNICAST_S)
  11769. #define HTT_SEC_IND_PEER_ID_SET(word, value) \
  11770. do { \
  11771. HTT_CHECK_SET_VAL(HTT_SEC_IND_PEER_ID, value); \
  11772. (word) |= (value) << HTT_SEC_IND_PEER_ID_S; \
  11773. } while (0)
  11774. #define HTT_SEC_IND_PEER_ID_GET(word) \
  11775. (((word) & HTT_SEC_IND_PEER_ID_M) >> HTT_SEC_IND_PEER_ID_S)
  11776. #define HTT_SEC_IND_BYTES 28
  11777. /**
  11778. * @brief target -> host rx ADDBA / DELBA message definitions
  11779. *
  11780. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_ADDBA
  11781. *
  11782. * @details
  11783. * The following diagram shows the format of the rx ADDBA message sent
  11784. * from the target to the host:
  11785. *
  11786. * |31 20|19 16|15 8|7 0|
  11787. * |---------------------------------------------------------------------|
  11788. * | peer ID | TID | window size | msg type |
  11789. * |---------------------------------------------------------------------|
  11790. *
  11791. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_DELBA
  11792. *
  11793. * The following diagram shows the format of the rx DELBA message sent
  11794. * from the target to the host:
  11795. *
  11796. * |31 20|19 16|15 10|9 8|7 0|
  11797. * |---------------------------------------------------------------------|
  11798. * | peer ID | TID | window size | IR| msg type |
  11799. * |---------------------------------------------------------------------|
  11800. *
  11801. * The following field definitions describe the format of the rx ADDBA
  11802. * and DELBA messages sent from the target to the host.
  11803. * - MSG_TYPE
  11804. * Bits 7:0
  11805. * Purpose: identifies this as an rx ADDBA or DELBA message
  11806. * Value: ADDBA -> 0x5 (HTT_T2H_MSG_TYPE_RX_ADDBA),
  11807. * DELBA -> 0x6 (HTT_T2H_MSG_TYPE_RX_DELBA)
  11808. * - IR (initiator / recipient)
  11809. * Bits 9:8 (DELBA only)
  11810. * Purpose: specify whether the DELBA handshake was initiated by the
  11811. * local STA/AP, or by the peer STA/AP
  11812. * Value:
  11813. * 0 - unspecified
  11814. * 1 - initiator (a.k.a. originator)
  11815. * 2 - recipient (a.k.a. responder)
  11816. * 3 - unused / reserved
  11817. * - WIN_SIZE
  11818. * Bits 15:8 for ADDBA, bits 15:10 for DELBA
  11819. * Purpose: Specifies the length of the block ack window (max = 64).
  11820. * Value:
  11821. * block ack window length specified by the received ADDBA/DELBA
  11822. * management message.
  11823. * - TID
  11824. * Bits 19:16
  11825. * Purpose: Specifies which traffic identifier the ADDBA / DELBA is for.
  11826. * Value:
  11827. * TID specified by the received ADDBA or DELBA management message.
  11828. * - PEER_ID
  11829. * Bits 31:20
  11830. * Purpose: Identifies which peer sent the ADDBA / DELBA.
  11831. * Value:
  11832. * ID (hash value) used by the host for fast, direct lookup of
  11833. * host SW peer info, including rx reorder states.
  11834. */
  11835. #define HTT_RX_ADDBA_WIN_SIZE_M 0xff00
  11836. #define HTT_RX_ADDBA_WIN_SIZE_S 8
  11837. #define HTT_RX_ADDBA_TID_M 0xf0000
  11838. #define HTT_RX_ADDBA_TID_S 16
  11839. #define HTT_RX_ADDBA_PEER_ID_M 0xfff00000
  11840. #define HTT_RX_ADDBA_PEER_ID_S 20
  11841. #define HTT_RX_ADDBA_WIN_SIZE_SET(word, value) \
  11842. do { \
  11843. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_WIN_SIZE, value); \
  11844. (word) |= (value) << HTT_RX_ADDBA_WIN_SIZE_S; \
  11845. } while (0)
  11846. #define HTT_RX_ADDBA_WIN_SIZE_GET(word) \
  11847. (((word) & HTT_RX_ADDBA_WIN_SIZE_M) >> HTT_RX_ADDBA_WIN_SIZE_S)
  11848. #define HTT_RX_ADDBA_TID_SET(word, value) \
  11849. do { \
  11850. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_TID, value); \
  11851. (word) |= (value) << HTT_RX_ADDBA_TID_S; \
  11852. } while (0)
  11853. #define HTT_RX_ADDBA_TID_GET(word) \
  11854. (((word) & HTT_RX_ADDBA_TID_M) >> HTT_RX_ADDBA_TID_S)
  11855. #define HTT_RX_ADDBA_PEER_ID_SET(word, value) \
  11856. do { \
  11857. HTT_CHECK_SET_VAL(HTT_RX_ADDBA_PEER_ID, value); \
  11858. (word) |= (value) << HTT_RX_ADDBA_PEER_ID_S; \
  11859. } while (0)
  11860. #define HTT_RX_ADDBA_PEER_ID_GET(word) \
  11861. (((word) & HTT_RX_ADDBA_PEER_ID_M) >> HTT_RX_ADDBA_PEER_ID_S)
  11862. #define HTT_RX_ADDBA_BYTES 4
  11863. #define HTT_RX_DELBA_INITIATOR_M 0x00000300
  11864. #define HTT_RX_DELBA_INITIATOR_S 8
  11865. #define HTT_RX_DELBA_WIN_SIZE_M 0x0000FC00
  11866. #define HTT_RX_DELBA_WIN_SIZE_S 10
  11867. #define HTT_RX_DELBA_TID_M HTT_RX_ADDBA_TID_M
  11868. #define HTT_RX_DELBA_TID_S HTT_RX_ADDBA_TID_S
  11869. #define HTT_RX_DELBA_PEER_ID_M HTT_RX_ADDBA_PEER_ID_M
  11870. #define HTT_RX_DELBA_PEER_ID_S HTT_RX_ADDBA_PEER_ID_S
  11871. #define HTT_RX_DELBA_TID_SET HTT_RX_ADDBA_TID_SET
  11872. #define HTT_RX_DELBA_TID_GET HTT_RX_ADDBA_TID_GET
  11873. #define HTT_RX_DELBA_PEER_ID_SET HTT_RX_ADDBA_PEER_ID_SET
  11874. #define HTT_RX_DELBA_PEER_ID_GET HTT_RX_ADDBA_PEER_ID_GET
  11875. #define HTT_RX_DELBA_INITIATOR_SET(word, value) \
  11876. do { \
  11877. HTT_CHECK_SET_VAL(HTT_RX_DELBA_INITIATOR, value); \
  11878. (word) |= (value) << HTT_RX_DELBA_INITIATOR_S; \
  11879. } while (0)
  11880. #define HTT_RX_DELBA_INITIATOR_GET(word) \
  11881. (((word) & HTT_RX_DELBA_INITIATOR_M) >> HTT_RX_DELBA_INITIATOR_S)
  11882. #define HTT_RX_DELBA_WIN_SIZE_SET(word, value) \
  11883. do { \
  11884. HTT_CHECK_SET_VAL(HTT_RX_DELBA_WIN_SIZE, value); \
  11885. (word) |= (value) << HTT_RX_DELBA_WIN_SIZE_S; \
  11886. } while (0)
  11887. #define HTT_RX_DELBA_WIN_SIZE_GET(word) \
  11888. (((word) & HTT_RX_DELBA_WIN_SIZE_M) >> HTT_RX_DELBA_WIN_SIZE_S)
  11889. #define HTT_RX_DELBA_BYTES 4
  11890. /**
  11891. * @brief tx queue group information element definition
  11892. *
  11893. * @details
  11894. * The following diagram shows the format of the tx queue group
  11895. * information element, which can be included in target --> host
  11896. * messages to specify the number of tx "credits" (tx descriptors
  11897. * for LL, or tx buffers for HL) available to a particular group
  11898. * of host-side tx queues, and which host-side tx queues belong to
  11899. * the group.
  11900. *
  11901. * |31|30 24|23 16|15|14|13 0|
  11902. * |------------------------------------------------------------------------|
  11903. * | X| reserved | tx queue grp ID | A| S| credit count |
  11904. * |------------------------------------------------------------------------|
  11905. * | vdev ID mask | AC mask |
  11906. * |------------------------------------------------------------------------|
  11907. *
  11908. * The following definitions describe the fields within the tx queue group
  11909. * information element:
  11910. * - credit_count
  11911. * Bits 13:1
  11912. * Purpose: specify how many tx credits are available to the tx queue group
  11913. * Value: An absolute or relative, positive or negative credit value
  11914. * The 'A' bit specifies whether the value is absolute or relative.
  11915. * The 'S' bit specifies whether the value is positive or negative.
  11916. * A negative value can only be relative, not absolute.
  11917. * An absolute value replaces any prior credit value the host has for
  11918. * the tx queue group in question.
  11919. * A relative value is added to the prior credit value the host has for
  11920. * the tx queue group in question.
  11921. * - sign
  11922. * Bit 14
  11923. * Purpose: specify whether the credit count is positive or negative
  11924. * Value: 0 -> positive, 1 -> negative
  11925. * - absolute
  11926. * Bit 15
  11927. * Purpose: specify whether the credit count is absolute or relative
  11928. * Value: 0 -> relative, 1 -> absolute
  11929. * - txq_group_id
  11930. * Bits 23:16
  11931. * Purpose: indicate which tx queue group's credit and/or membership are
  11932. * being specified
  11933. * Value: 0 to max_tx_queue_groups-1
  11934. * - reserved
  11935. * Bits 30:16
  11936. * Value: 0x0
  11937. * - eXtension
  11938. * Bit 31
  11939. * Purpose: specify whether another tx queue group info element follows
  11940. * Value: 0 -> no more tx queue group information elements
  11941. * 1 -> another tx queue group information element immediately follows
  11942. * - ac_mask
  11943. * Bits 15:0
  11944. * Purpose: specify which Access Categories belong to the tx queue group
  11945. * Value: bit-OR of masks for the ACs (WMM and extension) that belong to
  11946. * the tx queue group.
  11947. * The AC bit-mask values are obtained by left-shifting by the
  11948. * corresponding HTT_AC_WMM enum values, e.g. (1 << HTT_AC_WMM_BE) == 0x1
  11949. * - vdev_id_mask
  11950. * Bits 31:16
  11951. * Purpose: specify which vdev's tx queues belong to the tx queue group
  11952. * Value: bit-OR of masks based on the IDs of the vdevs whose tx queues
  11953. * belong to the tx queue group.
  11954. * For example, if vdev IDs 1 and 4 belong to a tx queue group, the
  11955. * vdev_id_mask would be (1 << 1) | (1 << 4) = 0x12
  11956. */
  11957. PREPACK struct htt_txq_group {
  11958. A_UINT32
  11959. credit_count: 14,
  11960. sign: 1,
  11961. absolute: 1,
  11962. tx_queue_group_id: 8,
  11963. reserved0: 7,
  11964. extension: 1;
  11965. A_UINT32
  11966. ac_mask: 16,
  11967. vdev_id_mask: 16;
  11968. } POSTPACK;
  11969. /* first word */
  11970. #define HTT_TXQ_GROUP_CREDIT_COUNT_S 0
  11971. #define HTT_TXQ_GROUP_CREDIT_COUNT_M 0x00003fff
  11972. #define HTT_TXQ_GROUP_SIGN_S 14
  11973. #define HTT_TXQ_GROUP_SIGN_M 0x00004000
  11974. #define HTT_TXQ_GROUP_ABS_S 15
  11975. #define HTT_TXQ_GROUP_ABS_M 0x00008000
  11976. #define HTT_TXQ_GROUP_ID_S 16
  11977. #define HTT_TXQ_GROUP_ID_M 0x00ff0000
  11978. #define HTT_TXQ_GROUP_EXT_S 31
  11979. #define HTT_TXQ_GROUP_EXT_M 0x80000000
  11980. /* second word */
  11981. #define HTT_TXQ_GROUP_AC_MASK_S 0
  11982. #define HTT_TXQ_GROUP_AC_MASK_M 0x0000ffff
  11983. #define HTT_TXQ_GROUP_VDEV_ID_MASK_S 16
  11984. #define HTT_TXQ_GROUP_VDEV_ID_MASK_M 0xffff0000
  11985. #define HTT_TXQ_GROUP_CREDIT_COUNT_SET(_info, _val) \
  11986. do { \
  11987. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_CREDIT_COUNT, _val); \
  11988. ((_info) |= ((_val) << HTT_TXQ_GROUP_CREDIT_COUNT_S)); \
  11989. } while (0)
  11990. #define HTT_TXQ_GROUP_CREDIT_COUNT_GET(_info) \
  11991. (((_info) & HTT_TXQ_GROUP_CREDIT_COUNT_M) >> HTT_TXQ_GROUP_CREDIT_COUNT_S)
  11992. #define HTT_TXQ_GROUP_SIGN_SET(_info, _val) \
  11993. do { \
  11994. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_SIGN, _val); \
  11995. ((_info) |= ((_val) << HTT_TXQ_GROUP_SIGN_S)); \
  11996. } while (0)
  11997. #define HTT_TXQ_GROUP_SIGN_GET(_info) \
  11998. (((_info) & HTT_TXQ_GROUP_SIGN_M) >> HTT_TXQ_GROUP_SIGN_S)
  11999. #define HTT_TXQ_GROUP_ABS_SET(_info, _val) \
  12000. do { \
  12001. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ABS, _val); \
  12002. ((_info) |= ((_val) << HTT_TXQ_GROUP_ABS_S)); \
  12003. } while (0)
  12004. #define HTT_TXQ_GROUP_ABS_GET(_info) \
  12005. (((_info) & HTT_TXQ_GROUP_ABS_M) >> HTT_TXQ_GROUP_ABS_S)
  12006. #define HTT_TXQ_GROUP_ID_SET(_info, _val) \
  12007. do { \
  12008. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_ID, _val); \
  12009. ((_info) |= ((_val) << HTT_TXQ_GROUP_ID_S)); \
  12010. } while (0)
  12011. #define HTT_TXQ_GROUP_ID_GET(_info) \
  12012. (((_info) & HTT_TXQ_GROUP_ID_M) >> HTT_TXQ_GROUP_ID_S)
  12013. #define HTT_TXQ_GROUP_EXT_SET(_info, _val) \
  12014. do { \
  12015. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_EXT, _val); \
  12016. ((_info) |= ((_val) << HTT_TXQ_GROUP_EXT_S)); \
  12017. } while (0)
  12018. #define HTT_TXQ_GROUP_EXT_GET(_info) \
  12019. (((_info) & HTT_TXQ_GROUP_EXT_M) >> HTT_TXQ_GROUP_EXT_S)
  12020. #define HTT_TXQ_GROUP_AC_MASK_SET(_info, _val) \
  12021. do { \
  12022. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_AC_MASK, _val); \
  12023. ((_info) |= ((_val) << HTT_TXQ_GROUP_AC_MASK_S)); \
  12024. } while (0)
  12025. #define HTT_TXQ_GROUP_AC_MASK_GET(_info) \
  12026. (((_info) & HTT_TXQ_GROUP_AC_MASK_M) >> HTT_TXQ_GROUP_AC_MASK_S)
  12027. #define HTT_TXQ_GROUP_VDEV_ID_MASK_SET(_info, _val) \
  12028. do { \
  12029. HTT_CHECK_SET_VAL(HTT_TXQ_GROUP_VDEV_ID_MASK, _val); \
  12030. ((_info) |= ((_val) << HTT_TXQ_GROUP_VDEV_ID_MASK_S)); \
  12031. } while (0)
  12032. #define HTT_TXQ_GROUP_VDEV_ID_MASK_GET(_info) \
  12033. (((_info) & HTT_TXQ_GROUP_VDEV_ID_MASK_M) >> HTT_TXQ_GROUP_VDEV_ID_MASK_S)
  12034. /**
  12035. * @brief target -> host TX completion indication message definition
  12036. *
  12037. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_COMPL_IND
  12038. *
  12039. * @details
  12040. * The following diagram shows the format of the TX completion indication sent
  12041. * from the target to the host
  12042. *
  12043. * |31 30|29|28|27|26|25|24|23 16| 15 |14 11|10 8|7 0|
  12044. * |-------------------------------------------------------------------|
  12045. * header: |rsvd |A4|A3|A2|TP|A1|A0| num | t_i| tid |status| msg_type |
  12046. * |-------------------------------------------------------------------|
  12047. * payload:| MSDU1 ID | MSDU0 ID |
  12048. * |-------------------------------------------------------------------|
  12049. * : MSDU3 ID | MSDU2 ID :
  12050. * |-------------------------------------------------------------------|
  12051. * | struct htt_tx_compl_ind_append_retries |
  12052. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12053. * | struct htt_tx_compl_ind_append_tx_tstamp |
  12054. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12055. * | MSDU1 ACK RSSI | MSDU0 ACK RSSI |
  12056. * |-------------------------------------------------------------------|
  12057. * : MSDU3 ACK RSSI | MSDU2 ACK RSSI :
  12058. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12059. * | MSDU0 tx_tsf64_low |
  12060. * |-------------------------------------------------------------------|
  12061. * | MSDU0 tx_tsf64_high |
  12062. * |-------------------------------------------------------------------|
  12063. * | MSDU1 tx_tsf64_low |
  12064. * |-------------------------------------------------------------------|
  12065. * | MSDU1 tx_tsf64_high |
  12066. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12067. * | phy_timestamp |
  12068. * |-------------------------------------------------------------------|
  12069. * | rate specs (see below) |
  12070. * |-------------------------------------------------------------------|
  12071. * | seqctrl | framectrl |
  12072. * |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
  12073. * Where:
  12074. * A0 = append (a.k.a. append0)
  12075. * A1 = append1
  12076. * TP = MSDU tx power presence
  12077. * A2 = append2
  12078. * A3 = append3
  12079. * A4 = append4
  12080. *
  12081. * The following field definitions describe the format of the TX completion
  12082. * indication sent from the target to the host
  12083. * Header fields:
  12084. * - msg_type
  12085. * Bits 7:0
  12086. * Purpose: identifies this as HTT TX completion indication
  12087. * Value: 0x7 (HTT_T2H_MSG_TYPE_TX_COMPL_IND)
  12088. * - status
  12089. * Bits 10:8
  12090. * Purpose: the TX completion status of payload fragmentations descriptors
  12091. * Value: could be HTT_TX_COMPL_IND_STAT_OK or HTT_TX_COMPL_IND_STAT_DISCARD
  12092. * - tid
  12093. * Bits 14:11
  12094. * Purpose: the tid associated with those fragmentation descriptors. It is
  12095. * valid or not, depending on the tid_invalid bit.
  12096. * Value: 0 to 15
  12097. * - tid_invalid
  12098. * Bits 15:15
  12099. * Purpose: this bit indicates whether the tid field is valid or not
  12100. * Value: 0 indicates valid; 1 indicates invalid
  12101. * - num
  12102. * Bits 23:16
  12103. * Purpose: the number of payload in this indication
  12104. * Value: 1 to 255
  12105. * - append (a.k.a. append0)
  12106. * Bits 24:24
  12107. * Purpose: append the struct htt_tx_compl_ind_append_retries which contains
  12108. * the number of tx retries for one MSDU at the end of this message
  12109. * Value: 0 indicates no appending; 1 indicates appending
  12110. * - append1
  12111. * Bits 25:25
  12112. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tstamp which
  12113. * contains the timestamp info for each TX msdu id in payload.
  12114. * The order of the timestamps matches the order of the MSDU IDs.
  12115. * Note that a big-endian host needs to account for the reordering
  12116. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12117. * conversion) when determining which tx timestamp corresponds to
  12118. * which MSDU ID.
  12119. * Value: 0 indicates no appending; 1 indicates appending
  12120. * - msdu_tx_power_presence
  12121. * Bits 26:26
  12122. * Purpose: Indicate whether the TX_COMPL_IND includes a tx power report
  12123. * for each MSDU referenced by the TX_COMPL_IND message.
  12124. * The tx power is reported in 0.5 dBm units.
  12125. * The order of the per-MSDU tx power reports matches the order
  12126. * of the MSDU IDs.
  12127. * Note that a big-endian host needs to account for the reordering
  12128. * of MSDU IDs within each 4-byte MSDU ID pair (during endianness
  12129. * conversion) when determining which Tx Power corresponds to
  12130. * which MSDU ID.
  12131. * Value: 0 indicates MSDU tx power reports are not appended,
  12132. * 1 indicates MSDU tx power reports are appended
  12133. * - append2
  12134. * Bits 27:27
  12135. * Purpose: Indicate whether data ACK RSSI is appended for each MSDU in
  12136. * TX_COMP_IND message. The order of the per-MSDU ACK RSSI report
  12137. * matches the order of the MSDU IDs. Although the ACK RSSI is the
  12138. * same for all MSDUs witin a single PPDU, the RSSI is duplicated
  12139. * for each MSDU, for convenience.
  12140. * The ACK RSSI values are valid when status is COMPLETE_OK (and
  12141. * this append2 bit is set).
  12142. * The ACK RSSI values are SNR in dB, i.e. are the RSSI in units of
  12143. * dB above the noise floor.
  12144. * Value: 0 indicates MSDU ACK RSSI values are not appended,
  12145. * 1 indicates MSDU ACK RSSI values are appended.
  12146. * - append3
  12147. * Bits 28:28
  12148. * Purpose: Append the struct htt_tx_compl_ind_append_tx_tsf64 which
  12149. * contains the tx tsf info based on wlan global TSF for
  12150. * each TX msdu id in payload.
  12151. * The order of the tx tsf matches the order of the MSDU IDs.
  12152. * The struct htt_tx_compl_ind_append_tx_tsf64 contains two 32-bits
  12153. * values to indicate the the lower 32 bits and higher 32 bits of
  12154. * the tx tsf.
  12155. * The tx_tsf64 here represents the time MSDU was acked and the
  12156. * tx_tsf64 has microseconds units.
  12157. * Value: 0 indicates no appending; 1 indicates appending
  12158. * - append4
  12159. * Bits 29:29
  12160. * Purpose: Indicate whether data frame control fields and fields required
  12161. * for radio tap header are appended for each MSDU in TX_COMP_IND
  12162. * message. The order of the this message matches the order of
  12163. * the MSDU IDs.
  12164. * Value: 0 indicates frame control fields and fields required for
  12165. * radio tap header values are not appended,
  12166. * 1 indicates frame control fields and fields required for
  12167. * radio tap header values are appended.
  12168. * Payload fields:
  12169. * - hmsdu_id
  12170. * Bits 15:0
  12171. * Purpose: this ID is used to track the Tx buffer in host
  12172. * Value: 0 to "size of host MSDU descriptor pool - 1"
  12173. */
  12174. PREPACK struct htt_tx_data_hdr_information {
  12175. A_UINT32 phy_timestamp_l32; /* word 0 [31:0] */
  12176. A_UINT32 /* word 1 */
  12177. /* preamble:
  12178. * 0-OFDM,
  12179. * 1-CCk,
  12180. * 2-HT,
  12181. * 3-VHT
  12182. */
  12183. preamble: 2, /* [1:0] */
  12184. /* mcs:
  12185. * In case of HT preamble interpret
  12186. * MCS along with NSS.
  12187. * Valid values for HT are 0 to 7.
  12188. * HT mcs 0 with NSS 2 is mcs 8.
  12189. * Valid values for VHT are 0 to 9.
  12190. */
  12191. mcs: 4, /* [5:2] */
  12192. /* rate:
  12193. * This is applicable only for
  12194. * CCK and OFDM preamble type
  12195. * rate 0: OFDM 48 Mbps,
  12196. * 1: OFDM 24 Mbps,
  12197. * 2: OFDM 12 Mbps
  12198. * 3: OFDM 6 Mbps
  12199. * 4: OFDM 54 Mbps
  12200. * 5: OFDM 36 Mbps
  12201. * 6: OFDM 18 Mbps
  12202. * 7: OFDM 9 Mbps
  12203. * rate 0: CCK 11 Mbps Long
  12204. * 1: CCK 5.5 Mbps Long
  12205. * 2: CCK 2 Mbps Long
  12206. * 3: CCK 1 Mbps Long
  12207. * 4: CCK 11 Mbps Short
  12208. * 5: CCK 5.5 Mbps Short
  12209. * 6: CCK 2 Mbps Short
  12210. */
  12211. rate : 3, /* [ 8: 6] */
  12212. rssi : 8, /* [16: 9] units=dBm */
  12213. nss : 2, /* [18:17] if nss 1 means 1ss and 2 means 2ss */
  12214. bw : 3, /* [21:19] (0=>20MHz, 1=>40MHz, 2=>80MHz, 3=>160MHz) */
  12215. stbc : 1, /* [22] */
  12216. sgi : 1, /* [23] */
  12217. ldpc : 1, /* [24] */
  12218. beamformed: 1, /* [25] */
  12219. /* tx_retry_cnt:
  12220. * Indicates retry count of data tx frames provided by the host.
  12221. */
  12222. tx_retry_cnt: 6; /* [31:26] */
  12223. A_UINT32 /* word 2 */
  12224. framectrl:16, /* [15: 0] */
  12225. seqno:16; /* [31:16] */
  12226. } POSTPACK;
  12227. #define HTT_TX_COMPL_IND_STATUS_S 8
  12228. #define HTT_TX_COMPL_IND_STATUS_M 0x00000700
  12229. #define HTT_TX_COMPL_IND_TID_S 11
  12230. #define HTT_TX_COMPL_IND_TID_M 0x00007800
  12231. #define HTT_TX_COMPL_IND_TID_INV_S 15
  12232. #define HTT_TX_COMPL_IND_TID_INV_M 0x00008000
  12233. #define HTT_TX_COMPL_IND_NUM_S 16
  12234. #define HTT_TX_COMPL_IND_NUM_M 0x00ff0000
  12235. #define HTT_TX_COMPL_IND_APPEND_S 24
  12236. #define HTT_TX_COMPL_IND_APPEND_M 0x01000000
  12237. #define HTT_TX_COMPL_IND_APPEND1_S 25
  12238. #define HTT_TX_COMPL_IND_APPEND1_M 0x02000000
  12239. #define HTT_TX_COMPL_IND_TX_POWER_S 26
  12240. #define HTT_TX_COMPL_IND_TX_POWER_M 0x04000000
  12241. #define HTT_TX_COMPL_IND_APPEND2_S 27
  12242. #define HTT_TX_COMPL_IND_APPEND2_M 0x08000000
  12243. #define HTT_TX_COMPL_IND_APPEND3_S 28
  12244. #define HTT_TX_COMPL_IND_APPEND3_M 0x10000000
  12245. #define HTT_TX_COMPL_IND_APPEND4_S 29
  12246. #define HTT_TX_COMPL_IND_APPEND4_M 0x20000000
  12247. #define HTT_TX_COMPL_IND_STATUS_SET(_info, _val) \
  12248. do { \
  12249. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_STATUS, _val); \
  12250. ((_info) |= ((_val) << HTT_TX_COMPL_IND_STATUS_S)); \
  12251. } while (0)
  12252. #define HTT_TX_COMPL_IND_STATUS_GET(_info) \
  12253. (((_info) & HTT_TX_COMPL_IND_STATUS_M) >> HTT_TX_COMPL_IND_STATUS_S)
  12254. #define HTT_TX_COMPL_IND_NUM_SET(_info, _val) \
  12255. do { \
  12256. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_NUM, _val); \
  12257. ((_info) |= ((_val) << HTT_TX_COMPL_IND_NUM_S)); \
  12258. } while (0)
  12259. #define HTT_TX_COMPL_IND_NUM_GET(_info) \
  12260. (((_info) & HTT_TX_COMPL_IND_NUM_M) >> HTT_TX_COMPL_IND_NUM_S)
  12261. #define HTT_TX_COMPL_IND_TID_SET(_info, _val) \
  12262. do { \
  12263. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID, _val); \
  12264. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_S)); \
  12265. } while (0)
  12266. #define HTT_TX_COMPL_IND_TID_GET(_info) \
  12267. (((_info) & HTT_TX_COMPL_IND_TID_M) >> HTT_TX_COMPL_IND_TID_S)
  12268. #define HTT_TX_COMPL_IND_TID_INV_SET(_info, _val) \
  12269. do { \
  12270. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TID_INV, _val); \
  12271. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TID_INV_S)); \
  12272. } while (0)
  12273. #define HTT_TX_COMPL_IND_TID_INV_GET(_info) \
  12274. (((_info) & HTT_TX_COMPL_IND_TID_INV_M) >> \
  12275. HTT_TX_COMPL_IND_TID_INV_S)
  12276. #define HTT_TX_COMPL_IND_APPEND_SET(_info, _val) \
  12277. do { \
  12278. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND, _val); \
  12279. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND_S)); \
  12280. } while (0)
  12281. #define HTT_TX_COMPL_IND_APPEND_GET(_info) \
  12282. (((_info) & HTT_TX_COMPL_IND_APPEND_M) >> HTT_TX_COMPL_IND_APPEND_S)
  12283. #define HTT_TX_COMPL_IND_APPEND1_SET(_info, _val) \
  12284. do { \
  12285. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND1, _val); \
  12286. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND1_S)); \
  12287. } while (0)
  12288. #define HTT_TX_COMPL_IND_APPEND1_GET(_info) \
  12289. (((_info) & HTT_TX_COMPL_IND_APPEND1_M) >> HTT_TX_COMPL_IND_APPEND1_S)
  12290. #define HTT_TX_COMPL_IND_TX_POWER_SET(_info, _val) \
  12291. do { \
  12292. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_TX_POWER, _val); \
  12293. ((_info) |= ((_val) << HTT_TX_COMPL_IND_TX_POWER_S)); \
  12294. } while (0)
  12295. #define HTT_TX_COMPL_IND_TX_POWER_GET(_info) \
  12296. (((_info) & HTT_TX_COMPL_IND_TX_POWER_M) >> HTT_TX_COMPL_IND_TX_POWER_S)
  12297. #define HTT_TX_COMPL_IND_APPEND2_SET(_info, _val) \
  12298. do { \
  12299. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND2, _val); \
  12300. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND2_S)); \
  12301. } while (0)
  12302. #define HTT_TX_COMPL_IND_APPEND2_GET(_info) \
  12303. (((_info) & HTT_TX_COMPL_IND_APPEND2_M) >> HTT_TX_COMPL_IND_APPEND2_S)
  12304. #define HTT_TX_COMPL_IND_APPEND3_SET(_info, _val) \
  12305. do { \
  12306. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND3, _val); \
  12307. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND3_S)); \
  12308. } while (0)
  12309. #define HTT_TX_COMPL_IND_APPEND3_GET(_info) \
  12310. (((_info) & HTT_TX_COMPL_IND_APPEND3_M) >> HTT_TX_COMPL_IND_APPEND3_S)
  12311. #define HTT_TX_COMPL_IND_APPEND4_SET(_info, _val) \
  12312. do { \
  12313. HTT_CHECK_SET_VAL(HTT_TX_COMPL_IND_APPEND4, _val); \
  12314. ((_info) |= ((_val) << HTT_TX_COMPL_IND_APPEND4_S)); \
  12315. } while (0)
  12316. #define HTT_TX_COMPL_IND_APPEND4_GET(_info) \
  12317. (((_info) & HTT_TX_COMPL_IND_APPEND4_M) >> HTT_TX_COMPL_IND_APPEND4_S)
  12318. #define HTT_TX_COMPL_INV_TX_POWER 0xffff
  12319. #define HTT_TX_COMPL_CTXT_SZ sizeof(A_UINT16)
  12320. #define HTT_TX_COMPL_CTXT_NUM(_bytes) ((_bytes) >> 1)
  12321. #define HTT_TX_COMPL_INV_MSDU_ID 0xffff
  12322. #define HTT_TX_COMPL_IND_STAT_OK 0
  12323. /* DISCARD:
  12324. * current meaning:
  12325. * MSDUs were queued for transmission but filtered by HW or SW
  12326. * without any over the air attempts
  12327. * legacy meaning (HL Rome):
  12328. * MSDUs were discarded by the target FW without any over the air
  12329. * attempts due to lack of space
  12330. */
  12331. #define HTT_TX_COMPL_IND_STAT_DISCARD 1
  12332. /* NO_ACK:
  12333. * MSDUs were transmitted (repeatedly) but no ACK was received from the peer
  12334. */
  12335. #define HTT_TX_COMPL_IND_STAT_NO_ACK 2
  12336. /* POSTPONE:
  12337. * temporarily-undeliverable MSDUs were deleted to free up space, but should
  12338. * be downloaded again later (in the appropriate order), when they are
  12339. * deliverable.
  12340. */
  12341. #define HTT_TX_COMPL_IND_STAT_POSTPONE 3
  12342. /*
  12343. * The PEER_DEL tx completion status is used for HL cases
  12344. * where the peer the frame is for has been deleted.
  12345. * The host has already discarded its copy of the frame, but
  12346. * it still needs the tx completion to restore its credit.
  12347. */
  12348. #define HTT_TX_COMPL_IND_STAT_PEER_DEL 4
  12349. /* DROP: MSDUs dropped due to lack of space (congestion control) */
  12350. #define HTT_TX_COMPL_IND_STAT_DROP 5
  12351. #define HTT_TX_COMPL_IND_STAT_HOST_INSPECT 6
  12352. #define HTT_TX_COMPL_IND_APPEND_SET_MORE_RETRY(f) ((f) |= 0x1)
  12353. #define HTT_TX_COMPL_IND_APPEND_CLR_MORE_RETRY(f) ((f) &= (~0x1))
  12354. PREPACK struct htt_tx_compl_ind_base {
  12355. A_UINT32 hdr;
  12356. A_UINT16 payload[1/*or more*/];
  12357. } POSTPACK;
  12358. PREPACK struct htt_tx_compl_ind_append_retries {
  12359. A_UINT16 msdu_id;
  12360. A_UINT8 tx_retries;
  12361. A_UINT8 flag; /* Bit 0, 1: another append_retries struct is appended
  12362. 0: this is the last append_retries struct */
  12363. } POSTPACK;
  12364. PREPACK struct htt_tx_compl_ind_append_tx_tstamp {
  12365. A_UINT32 timestamp[1/*or more*/];
  12366. } POSTPACK;
  12367. PREPACK struct htt_tx_compl_ind_append_tx_tsf64 {
  12368. A_UINT32 tx_tsf64_low;
  12369. A_UINT32 tx_tsf64_high;
  12370. } POSTPACK;
  12371. /* htt_tx_data_hdr_information payload extension fields: */
  12372. /* DWORD zero */
  12373. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M 0xffffffff
  12374. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S 0
  12375. /* DWORD one */
  12376. #define HTT_FW_TX_DATA_HDR_PREAMBLE_M 0x00000003
  12377. #define HTT_FW_TX_DATA_HDR_PREAMBLE_S 0
  12378. #define HTT_FW_TX_DATA_HDR_MCS_M 0x0000003c
  12379. #define HTT_FW_TX_DATA_HDR_MCS_S 2
  12380. #define HTT_FW_TX_DATA_HDR_RATE_M 0x000001c0
  12381. #define HTT_FW_TX_DATA_HDR_RATE_S 6
  12382. #define HTT_FW_TX_DATA_HDR_RSSI_M 0x0001fe00
  12383. #define HTT_FW_TX_DATA_HDR_RSSI_S 9
  12384. #define HTT_FW_TX_DATA_HDR_NSS_M 0x00060000
  12385. #define HTT_FW_TX_DATA_HDR_NSS_S 17
  12386. #define HTT_FW_TX_DATA_HDR_BW_M 0x00380000
  12387. #define HTT_FW_TX_DATA_HDR_BW_S 19
  12388. #define HTT_FW_TX_DATA_HDR_STBC_M 0x00400000
  12389. #define HTT_FW_TX_DATA_HDR_STBC_S 22
  12390. #define HTT_FW_TX_DATA_HDR_SGI_M 0x00800000
  12391. #define HTT_FW_TX_DATA_HDR_SGI_S 23
  12392. #define HTT_FW_TX_DATA_HDR_LDPC_M 0x01000000
  12393. #define HTT_FW_TX_DATA_HDR_LDPC_S 24
  12394. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_M 0x02000000
  12395. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_S 25
  12396. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M 0xfc000000
  12397. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S 26
  12398. /* DWORD two */
  12399. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_M 0x0000ffff
  12400. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_S 0
  12401. #define HTT_FW_TX_DATA_HDR_SEQNO_M 0xffff0000
  12402. #define HTT_FW_TX_DATA_HDR_SEQNO_S 16
  12403. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_SET(word, value) \
  12404. do { \
  12405. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32, value); \
  12406. (word) |= (value) << HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S; \
  12407. } while (0)
  12408. #define HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_GET(word) \
  12409. (((word) & HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_M) >> HTT_FW_TX_DATA_HDR_PHY_TIMESTAMP_L32_S)
  12410. #define HTT_FW_TX_DATA_HDR_PREAMBLE_SET(word, value) \
  12411. do { \
  12412. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_PREAMBLE, value); \
  12413. (word) |= (value) << HTT_FW_TX_DATA_HDR_PREAMBLE_S; \
  12414. } while (0)
  12415. #define HTT_FW_TX_DATA_HDR_PREAMBLE_GET(word) \
  12416. (((word) & HTT_FW_TX_DATA_HDR_PREAMBLE_M) >> HTT_FW_TX_DATA_HDR_PREAMBLE_S)
  12417. #define HTT_FW_TX_DATA_HDR_MCS_SET(word, value) \
  12418. do { \
  12419. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_MCS, value); \
  12420. (word) |= (value) << HTT_FW_TX_DATA_HDR_MCS_S; \
  12421. } while (0)
  12422. #define HTT_FW_TX_DATA_HDR_MCS_GET(word) \
  12423. (((word) & HTT_FW_TX_DATA_HDR_MCS_M) >> HTT_FW_TX_DATA_HDR_MCS_S)
  12424. #define HTT_FW_TX_DATA_HDR_RATE_SET(word, value) \
  12425. do { \
  12426. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RATE, value); \
  12427. (word) |= (value) << HTT_FW_TX_DATA_HDR_RATE_S; \
  12428. } while (0)
  12429. #define HTT_FW_TX_DATA_HDR_RATE_GET(word) \
  12430. (((word) & HTT_FW_TX_DATA_HDR_RATE_M) >> HTT_FW_TX_DATA_HDR_RATE_S)
  12431. #define HTT_FW_TX_DATA_HDR_RSSI_SET(word, value) \
  12432. do { \
  12433. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_RSSI, value); \
  12434. (word) |= (value) << HTT_FW_TX_DATA_HDR_RSSI_S; \
  12435. } while (0)
  12436. #define HTT_FW_TX_DATA_HDR_RSSI_GET(word) \
  12437. (((word) & HTT_FW_TX_DATA_HDR_RSSI_M) >> HTT_FW_TX_DATA_HDR_RSSI_S)
  12438. #define HTT_FW_TX_DATA_HDR_NSS_SET(word, value) \
  12439. do { \
  12440. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_NSS, value); \
  12441. (word) |= (value) << HTT_FW_TX_DATA_HDR_NSS_S; \
  12442. } while (0)
  12443. #define HTT_FW_TX_DATA_HDR_NSS_GET(word) \
  12444. (((word) & HTT_FW_TX_DATA_HDR_NSS_M) >> HTT_FW_TX_DATA_HDR_NSS_S)
  12445. #define HTT_FW_TX_DATA_HDR_BW_SET(word, value) \
  12446. do { \
  12447. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BW, value); \
  12448. (word) |= (value) << HTT_FW_TX_DATA_HDR_BW_S; \
  12449. } while (0)
  12450. #define HTT_FW_TX_DATA_HDR_BW_GET(word) \
  12451. (((word) & HTT_FW_TX_DATA_HDR_BW_M) >> HTT_FW_TX_DATA_HDR_BW_S)
  12452. #define HTT_FW_TX_DATA_HDR_STBC_SET(word, value) \
  12453. do { \
  12454. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_STBC, value); \
  12455. (word) |= (value) << HTT_FW_TX_DATA_HDR_STBC_S; \
  12456. } while (0)
  12457. #define HTT_FW_TX_DATA_HDR_STBC_GET(word) \
  12458. (((word) & HTT_FW_TX_DATA_HDR_STBC_M) >> HTT_FW_TX_DATA_HDR_STBC_S)
  12459. #define HTT_FW_TX_DATA_HDR_SGI_SET(word, value) \
  12460. do { \
  12461. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SGI, value); \
  12462. (word) |= (value) << HTT_FW_TX_DATA_HDR_SGI_S; \
  12463. } while (0)
  12464. #define HTT_FW_TX_DATA_HDR_SGI_GET(word) \
  12465. (((word) & HTT_FW_TX_DATA_HDR_SGI_M) >> HTT_FW_TX_DATA_HDR_SGI_S)
  12466. #define HTT_FW_TX_DATA_HDR_LDPC_SET(word, value) \
  12467. do { \
  12468. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_LDPC, value); \
  12469. (word) |= (value) << HTT_FW_TX_DATA_HDR_LDPC_S; \
  12470. } while (0)
  12471. #define HTT_FW_TX_DATA_HDR_LDPC_GET(word) \
  12472. (((word) & HTT_FW_TX_DATA_HDR_LDPC_M) >> HTT_FW_TX_DATA_HDR_LDPC_S)
  12473. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_SET(word, value) \
  12474. do { \
  12475. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_BEAMFORMED, value); \
  12476. (word) |= (value) << HTT_FW_TX_DATA_HDR_BEAMFORMED_S; \
  12477. } while (0)
  12478. #define HTT_FW_TX_DATA_HDR_BEAMFORMED_GET(word) \
  12479. (((word) & HTT_FW_TX_DATA_HDR_BEAMFORMED_M) >> HTT_FW_TX_DATA_HDR_BEAMFORMED_S)
  12480. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_SET(word, value) \
  12481. do { \
  12482. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_TX_RETRY_CNT, value); \
  12483. (word) |= (value) << HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S; \
  12484. } while (0)
  12485. #define HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_GET(word) \
  12486. (((word) & HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_M) >> HTT_FW_TX_DATA_HDR_TX_RETRY_CNT_S)
  12487. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_SET(word, value) \
  12488. do { \
  12489. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_FRAMECTRL, value); \
  12490. (word) |= (value) << HTT_FW_TX_DATA_HDR_FRAMECTRL_S; \
  12491. } while (0)
  12492. #define HTT_FW_TX_DATA_HDR_FRAMECTRL_GET(word) \
  12493. (((word) & HTT_FW_TX_DATA_HDR_FRAMECTRL_M) >> HTT_FW_TX_DATA_HDR_FRAMECTRL_S)
  12494. #define HTT_FW_TX_DATA_HDR_SEQNO_SET(word, value) \
  12495. do { \
  12496. HTT_CHECK_SET_VAL(HTT_FW_TX_DATA_HDR_SEQNO, value); \
  12497. (word) |= (value) << HTT_FW_TX_DATA_HDR_SEQNO_S; \
  12498. } while (0)
  12499. #define HTT_FW_TX_DATA_HDR_SEQNO_GET(word) \
  12500. (((word) & HTT_FW_TX_DATA_HDR_SEQNO_M) >> HTT_FW_TX_DATA_HDR_SEQNO_S)
  12501. /**
  12502. * @brief target -> host rate-control update indication message
  12503. *
  12504. * DEPRECATED (DEPRECATED_HTT_T2H_MSG_TYPE_RC_UPDATE_IND)
  12505. *
  12506. * @details
  12507. * The following diagram shows the format of the RC Update message
  12508. * sent from the target to the host, while processing the tx-completion
  12509. * of a transmitted PPDU.
  12510. *
  12511. * |31 24|23 16|15 8|7 0|
  12512. * |-------------------------------------------------------------|
  12513. * | peer ID | vdev ID | msg_type |
  12514. * |-------------------------------------------------------------|
  12515. * | MAC addr 3 | MAC addr 2 | MAC addr 1 | MAC addr 0 |
  12516. * |-------------------------------------------------------------|
  12517. * | reserved | num elems | MAC addr 5 | MAC addr 4 |
  12518. * |-------------------------------------------------------------|
  12519. * | : |
  12520. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12521. * | : |
  12522. * |-------------------------------------------------------------|
  12523. * | : |
  12524. * : HTT_RC_TX_DONE_PARAMS (DWORD-aligned) :
  12525. * | : |
  12526. * |-------------------------------------------------------------|
  12527. * : :
  12528. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12529. *
  12530. */
  12531. typedef struct {
  12532. A_UINT32 rate_code; /* rate code, bw, chain mask sgi */
  12533. A_UINT32 rate_code_flags;
  12534. A_UINT32 flags; /* Encodes information such as excessive
  12535. retransmission, aggregate, some info
  12536. from .11 frame control,
  12537. STBC, LDPC, (SGI and Tx Chain Mask
  12538. are encoded in ptx_rc->flags field),
  12539. AMPDU truncation (BT/time based etc.),
  12540. RTS/CTS attempt */
  12541. A_UINT32 num_enqued; /* # of MPDUs (for non-AMPDU 1) for this rate */
  12542. A_UINT32 num_retries; /* Total # of transmission attempt for this rate */
  12543. A_UINT32 num_failed; /* # of failed MPDUs in A-MPDU, 0 otherwise */
  12544. A_UINT32 ack_rssi; /* ACK RSSI: b'7..b'0 avg RSSI across all chain */
  12545. A_UINT32 time_stamp ; /* ACK timestamp (helps determine age) */
  12546. A_UINT32 is_probe; /* Valid if probing. Else, 0 */
  12547. } HTT_RC_TX_DONE_PARAMS;
  12548. #define HTT_RC_UPDATE_CTXT_SZ (sizeof(HTT_RC_TX_DONE_PARAMS)) /* bytes */
  12549. #define HTT_RC_UPDATE_HDR_SZ (12) /* bytes */
  12550. #define HTT_RC_UPDATE_MAC_ADDR_OFFSET (4) /* bytes */
  12551. #define HTT_RC_UPDATE_MAC_ADDR_LENGTH IEEE80211_ADDR_LEN /* bytes */
  12552. #define HTT_RC_UPDATE_VDEVID_S 8
  12553. #define HTT_RC_UPDATE_VDEVID_M 0xff00
  12554. #define HTT_RC_UPDATE_PEERID_S 16
  12555. #define HTT_RC_UPDATE_PEERID_M 0xffff0000
  12556. #define HTT_RC_UPDATE_NUM_ELEMS_S 16
  12557. #define HTT_RC_UPDATE_NUM_ELEMS_M 0x00ff0000
  12558. #define HTT_RC_UPDATE_VDEVID_SET(_info, _val) \
  12559. do { \
  12560. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_VDEVID, _val); \
  12561. ((_info) |= ((_val) << HTT_RC_UPDATE_VDEVID_S)); \
  12562. } while (0)
  12563. #define HTT_RC_UPDATE_VDEVID_GET(_info) \
  12564. (((_info) & HTT_RC_UPDATE_VDEVID_M) >> HTT_RC_UPDATE_VDEVID_S)
  12565. #define HTT_RC_UPDATE_PEERID_SET(_info, _val) \
  12566. do { \
  12567. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_PEERID, _val); \
  12568. ((_info) |= ((_val) << HTT_RC_UPDATE_PEERID_S)); \
  12569. } while (0)
  12570. #define HTT_RC_UPDATE_PEERID_GET(_info) \
  12571. (((_info) & HTT_RC_UPDATE_PEERID_M) >> HTT_RC_UPDATE_PEERID_S)
  12572. #define HTT_RC_UPDATE_NUM_ELEMS_SET(_info, _val) \
  12573. do { \
  12574. HTT_CHECK_SET_VAL(HTT_RC_UPDATE_NUM_ELEMS, _val); \
  12575. ((_info) |= ((_val) << HTT_RC_UPDATE_NUM_ELEMS_S)); \
  12576. } while (0)
  12577. #define HTT_RC_UPDATE_NUM_ELEMS_GET(_info) \
  12578. (((_info) & HTT_RC_UPDATE_NUM_ELEMS_M) >> HTT_RC_UPDATE_NUM_ELEMS_S)
  12579. /**
  12580. * @brief target -> host rx fragment indication message definition
  12581. *
  12582. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_FRAG_IND
  12583. *
  12584. * @details
  12585. * The following field definitions describe the format of the rx fragment
  12586. * indication message sent from the target to the host.
  12587. * The rx fragment indication message shares the format of the
  12588. * rx indication message, but not all fields from the rx indication message
  12589. * are relevant to the rx fragment indication message.
  12590. *
  12591. *
  12592. * |31 24|23 18|17|16|15|14|13|12|11|10|9|8|7|6|5|4 0|
  12593. * |-----------+-------------------+---------------------+-------------|
  12594. * | peer ID | |FV| ext TID | msg type |
  12595. * |-------------------------------------------------------------------|
  12596. * | | flush | flush |
  12597. * | | end | start |
  12598. * | | seq num | seq num |
  12599. * |-------------------------------------------------------------------|
  12600. * | reserved | FW rx desc bytes |
  12601. * |-------------------------------------------------------------------|
  12602. * | | FW MSDU Rx |
  12603. * | | desc B0 |
  12604. * |-------------------------------------------------------------------|
  12605. * Header fields:
  12606. * - MSG_TYPE
  12607. * Bits 7:0
  12608. * Purpose: identifies this as an rx fragment indication message
  12609. * Value: 0xa (HTT_T2H_MSG_TYPE_RX_FRAG_IND)
  12610. * - EXT_TID
  12611. * Bits 12:8
  12612. * Purpose: identify the traffic ID of the rx data, including
  12613. * special "extended" TID values for multicast, broadcast, and
  12614. * non-QoS data frames
  12615. * Value: 0-15 for regular TIDs, or >= 16 for bcast/mcast/non-QoS
  12616. * - FLUSH_VALID (FV)
  12617. * Bit 13
  12618. * Purpose: indicate whether the flush IE (start/end sequence numbers)
  12619. * is valid
  12620. * Value:
  12621. * 1 -> flush IE is valid and needs to be processed
  12622. * 0 -> flush IE is not valid and should be ignored
  12623. * - PEER_ID
  12624. * Bits 31:16
  12625. * Purpose: Identify, by ID, which peer sent the rx data
  12626. * Value: ID of the peer who sent the rx data
  12627. * - FLUSH_SEQ_NUM_START
  12628. * Bits 5:0
  12629. * Purpose: Indicate the start of a series of MPDUs to flush
  12630. * Not all MPDUs within this series are necessarily valid - the host
  12631. * must check each sequence number within this range to see if the
  12632. * corresponding MPDU is actually present.
  12633. * This field is only valid if the FV bit is set.
  12634. * Value:
  12635. * The sequence number for the first MPDUs to check to flush.
  12636. * The sequence number is masked by 0x3f.
  12637. * - FLUSH_SEQ_NUM_END
  12638. * Bits 11:6
  12639. * Purpose: Indicate the end of a series of MPDUs to flush
  12640. * Value:
  12641. * The sequence number one larger than the sequence number of the
  12642. * last MPDU to check to flush.
  12643. * The sequence number is masked by 0x3f.
  12644. * Not all MPDUs within this series are necessarily valid - the host
  12645. * must check each sequence number within this range to see if the
  12646. * corresponding MPDU is actually present.
  12647. * This field is only valid if the FV bit is set.
  12648. * Rx descriptor fields:
  12649. * - FW_RX_DESC_BYTES
  12650. * Bits 15:0
  12651. * Purpose: Indicate how many bytes in the Rx indication are used for
  12652. * FW Rx descriptors
  12653. * Value: 1
  12654. */
  12655. #define HTT_RX_FRAG_IND_HDR_PREFIX_SIZE32 2
  12656. #define HTT_RX_FRAG_IND_FW_DESC_BYTE_OFFSET 12
  12657. #define HTT_RX_FRAG_IND_EXT_TID_SET HTT_RX_IND_EXT_TID_SET
  12658. #define HTT_RX_FRAG_IND_EXT_TID_GET HTT_RX_IND_EXT_TID_GET
  12659. #define HTT_RX_FRAG_IND_PEER_ID_SET HTT_RX_IND_PEER_ID_SET
  12660. #define HTT_RX_FRAG_IND_PEER_ID_GET HTT_RX_IND_PEER_ID_GET
  12661. #define HTT_RX_FRAG_IND_FLUSH_VALID_SET HTT_RX_IND_FLUSH_VALID_SET
  12662. #define HTT_RX_FRAG_IND_FLUSH_VALID_GET HTT_RX_IND_FLUSH_VALID_GET
  12663. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_SET \
  12664. HTT_RX_IND_FLUSH_SEQ_NUM_START_SET
  12665. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_START_GET \
  12666. HTT_RX_IND_FLUSH_SEQ_NUM_START_GET
  12667. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_SET \
  12668. HTT_RX_IND_FLUSH_SEQ_NUM_END_SET
  12669. #define HTT_RX_FRAG_IND_FLUSH_SEQ_NUM_END_GET \
  12670. HTT_RX_IND_FLUSH_SEQ_NUM_END_GET
  12671. #define HTT_RX_FRAG_IND_FW_RX_DESC_BYTES_GET HTT_RX_IND_FW_RX_DESC_BYTES_GET
  12672. #define HTT_RX_FRAG_IND_BYTES \
  12673. (4 /* msg hdr */ + \
  12674. 4 /* flush spec */ + \
  12675. 4 /* (unused) FW rx desc bytes spec */ + \
  12676. 4 /* FW rx desc */)
  12677. /**
  12678. * @brief target -> host test message definition
  12679. *
  12680. * MSG_TYPE => HTT_T2H_MSG_TYPE_TEST
  12681. *
  12682. * @details
  12683. * The following field definitions describe the format of the test
  12684. * message sent from the target to the host.
  12685. * The message consists of a 4-octet header, followed by a variable
  12686. * number of 32-bit integer values, followed by a variable number
  12687. * of 8-bit character values.
  12688. *
  12689. * |31 16|15 8|7 0|
  12690. * |-----------------------------------------------------------|
  12691. * | num chars | num ints | msg type |
  12692. * |-----------------------------------------------------------|
  12693. * | int 0 |
  12694. * |-----------------------------------------------------------|
  12695. * | int 1 |
  12696. * |-----------------------------------------------------------|
  12697. * | ... |
  12698. * |-----------------------------------------------------------|
  12699. * | char 3 | char 2 | char 1 | char 0 |
  12700. * |-----------------------------------------------------------|
  12701. * | | | ... | char 4 |
  12702. * |-----------------------------------------------------------|
  12703. * - MSG_TYPE
  12704. * Bits 7:0
  12705. * Purpose: identifies this as a test message
  12706. * Value: HTT_MSG_TYPE_TEST
  12707. * - NUM_INTS
  12708. * Bits 15:8
  12709. * Purpose: indicate how many 32-bit integers follow the message header
  12710. * - NUM_CHARS
  12711. * Bits 31:16
  12712. * Purpose: indicate how many 8-bit charaters follow the series of integers
  12713. */
  12714. #define HTT_RX_TEST_NUM_INTS_M 0xff00
  12715. #define HTT_RX_TEST_NUM_INTS_S 8
  12716. #define HTT_RX_TEST_NUM_CHARS_M 0xffff0000
  12717. #define HTT_RX_TEST_NUM_CHARS_S 16
  12718. #define HTT_RX_TEST_NUM_INTS_SET(word, value) \
  12719. do { \
  12720. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_INTS, value); \
  12721. (word) |= (value) << HTT_RX_TEST_NUM_INTS_S; \
  12722. } while (0)
  12723. #define HTT_RX_TEST_NUM_INTS_GET(word) \
  12724. (((word) & HTT_RX_TEST_NUM_INTS_M) >> HTT_RX_TEST_NUM_INTS_S)
  12725. #define HTT_RX_TEST_NUM_CHARS_SET(word, value) \
  12726. do { \
  12727. HTT_CHECK_SET_VAL(HTT_RX_TEST_NUM_CHARS, value); \
  12728. (word) |= (value) << HTT_RX_TEST_NUM_CHARS_S; \
  12729. } while (0)
  12730. #define HTT_RX_TEST_NUM_CHARS_GET(word) \
  12731. (((word) & HTT_RX_TEST_NUM_CHARS_M) >> HTT_RX_TEST_NUM_CHARS_S)
  12732. /**
  12733. * @brief target -> host packet log message
  12734. *
  12735. * MSG_TYPE => HTT_T2H_MSG_TYPE_PKTLOG
  12736. *
  12737. * @details
  12738. * The following field definitions describe the format of the packet log
  12739. * message sent from the target to the host.
  12740. * The message consists of a 4-octet header,followed by a variable number
  12741. * of 32-bit character values.
  12742. *
  12743. * |31 16|15 12|11 10|9 8|7 0|
  12744. * |------------------------------------------------------------------|
  12745. * | payload_size | rsvd |pdev_id|mac_id| msg type |
  12746. * |------------------------------------------------------------------|
  12747. * | payload |
  12748. * |------------------------------------------------------------------|
  12749. * - MSG_TYPE
  12750. * Bits 7:0
  12751. * Purpose: identifies this as a pktlog message
  12752. * Value: 0x8 (HTT_T2H_MSG_TYPE_PKTLOG)
  12753. * - mac_id
  12754. * Bits 9:8
  12755. * Purpose: identifies which MAC/PHY instance generated this pktlog info
  12756. * Value: 0-3
  12757. * - pdev_id
  12758. * Bits 11:10
  12759. * Purpose: pdev_id
  12760. * Value: 0-3
  12761. * 0 (for rings at SOC level),
  12762. * 1/2/3 PDEV -> 0/1/2
  12763. * - payload_size
  12764. * Bits 31:16
  12765. * Purpose: explicitly specify the payload size
  12766. * Value: payload size in bytes (payload size is a multiple of 4 bytes)
  12767. */
  12768. PREPACK struct htt_pktlog_msg {
  12769. A_UINT32 header;
  12770. A_UINT32 payload[1/* or more */];
  12771. } POSTPACK;
  12772. #define HTT_T2H_PKTLOG_MAC_ID_M 0x00000300
  12773. #define HTT_T2H_PKTLOG_MAC_ID_S 8
  12774. #define HTT_T2H_PKTLOG_PDEV_ID_M 0x00000C00
  12775. #define HTT_T2H_PKTLOG_PDEV_ID_S 10
  12776. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_M 0xFFFF0000
  12777. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_S 16
  12778. #define HTT_T2H_PKTLOG_MAC_ID_SET(word, value) \
  12779. do { \
  12780. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_MAC_ID, value); \
  12781. (word) |= (value) << HTT_T2H_PKTLOG_MAC_ID_S; \
  12782. } while (0)
  12783. #define HTT_T2H_PKTLOG_MAC_ID_GET(word) \
  12784. (((word) & HTT_T2H_PKTLOG_MAC_ID_M) >> \
  12785. HTT_T2H_PKTLOG_MAC_ID_S)
  12786. #define HTT_T2H_PKTLOG_PDEV_ID_SET(word, value) \
  12787. do { \
  12788. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PDEV_ID, value); \
  12789. (word) |= (value) << HTT_T2H_PKTLOG_PDEV_ID_S; \
  12790. } while (0)
  12791. #define HTT_T2H_PKTLOG_PDEV_ID_GET(word) \
  12792. (((word) & HTT_T2H_PKTLOG_PDEV_ID_M) >> \
  12793. HTT_T2H_PKTLOG_PDEV_ID_S)
  12794. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_SET(word, value) \
  12795. do { \
  12796. HTT_CHECK_SET_VAL(HTT_T2H_PKTLOG_PAYLOAD_SIZE, value); \
  12797. (word) |= (value) << HTT_T2H_PKTLOG_PAYLOAD_SIZE_S; \
  12798. } while (0)
  12799. #define HTT_T2H_PKTLOG_PAYLOAD_SIZE_GET(word) \
  12800. (((word) & HTT_T2H_PKTLOG_PAYLOAD_SIZE_M) >> \
  12801. HTT_T2H_PKTLOG_PAYLOAD_SIZE_S)
  12802. /*
  12803. * Rx reorder statistics
  12804. * NB: all the fields must be defined in 4 octets size.
  12805. */
  12806. struct rx_reorder_stats {
  12807. /* Non QoS MPDUs received */
  12808. A_UINT32 deliver_non_qos;
  12809. /* MPDUs received in-order */
  12810. A_UINT32 deliver_in_order;
  12811. /* Flush due to reorder timer expired */
  12812. A_UINT32 deliver_flush_timeout;
  12813. /* Flush due to move out of window */
  12814. A_UINT32 deliver_flush_oow;
  12815. /* Flush due to DELBA */
  12816. A_UINT32 deliver_flush_delba;
  12817. /* MPDUs dropped due to FCS error */
  12818. A_UINT32 fcs_error;
  12819. /* MPDUs dropped due to monitor mode non-data packet */
  12820. A_UINT32 mgmt_ctrl;
  12821. /* Unicast-data MPDUs dropped due to invalid peer */
  12822. A_UINT32 invalid_peer;
  12823. /* MPDUs dropped due to duplication (non aggregation) */
  12824. A_UINT32 dup_non_aggr;
  12825. /* MPDUs dropped due to processed before */
  12826. A_UINT32 dup_past;
  12827. /* MPDUs dropped due to duplicate in reorder queue */
  12828. A_UINT32 dup_in_reorder;
  12829. /* Reorder timeout happened */
  12830. A_UINT32 reorder_timeout;
  12831. /* invalid bar ssn */
  12832. A_UINT32 invalid_bar_ssn;
  12833. /* reorder reset due to bar ssn */
  12834. A_UINT32 ssn_reset;
  12835. /* Flush due to delete peer */
  12836. A_UINT32 deliver_flush_delpeer;
  12837. /* Flush due to offload*/
  12838. A_UINT32 deliver_flush_offload;
  12839. /* Flush due to out of buffer*/
  12840. A_UINT32 deliver_flush_oob;
  12841. /* MPDUs dropped due to PN check fail */
  12842. A_UINT32 pn_fail;
  12843. /* MPDUs dropped due to unable to allocate memory */
  12844. A_UINT32 store_fail;
  12845. /* Number of times the tid pool alloc succeeded */
  12846. A_UINT32 tid_pool_alloc_succ;
  12847. /* Number of times the MPDU pool alloc succeeded */
  12848. A_UINT32 mpdu_pool_alloc_succ;
  12849. /* Number of times the MSDU pool alloc succeeded */
  12850. A_UINT32 msdu_pool_alloc_succ;
  12851. /* Number of times the tid pool alloc failed */
  12852. A_UINT32 tid_pool_alloc_fail;
  12853. /* Number of times the MPDU pool alloc failed */
  12854. A_UINT32 mpdu_pool_alloc_fail;
  12855. /* Number of times the MSDU pool alloc failed */
  12856. A_UINT32 msdu_pool_alloc_fail;
  12857. /* Number of times the tid pool freed */
  12858. A_UINT32 tid_pool_free;
  12859. /* Number of times the MPDU pool freed */
  12860. A_UINT32 mpdu_pool_free;
  12861. /* Number of times the MSDU pool freed */
  12862. A_UINT32 msdu_pool_free;
  12863. /* number of MSDUs undelivered to HTT and queued to Data Rx MSDU free list*/
  12864. A_UINT32 msdu_queued;
  12865. /* Number of MSDUs released from Data Rx MSDU list to MAC ring */
  12866. A_UINT32 msdu_recycled;
  12867. /* Number of MPDUs with invalid peer but A2 found in AST */
  12868. A_UINT32 invalid_peer_a2_in_ast;
  12869. /* Number of MPDUs with invalid peer but A3 found in AST */
  12870. A_UINT32 invalid_peer_a3_in_ast;
  12871. /* Number of MPDUs with invalid peer, Broadcast or Multicast frame */
  12872. A_UINT32 invalid_peer_bmc_mpdus;
  12873. /* Number of MSDUs with err attention word */
  12874. A_UINT32 rxdesc_err_att;
  12875. /* Number of MSDUs with flag of peer_idx_invalid */
  12876. A_UINT32 rxdesc_err_peer_idx_inv;
  12877. /* Number of MSDUs with flag of peer_idx_timeout */
  12878. A_UINT32 rxdesc_err_peer_idx_to;
  12879. /* Number of MSDUs with flag of overflow */
  12880. A_UINT32 rxdesc_err_ov;
  12881. /* Number of MSDUs with flag of msdu_length_err */
  12882. A_UINT32 rxdesc_err_msdu_len;
  12883. /* Number of MSDUs with flag of mpdu_length_err */
  12884. A_UINT32 rxdesc_err_mpdu_len;
  12885. /* Number of MSDUs with flag of tkip_mic_err */
  12886. A_UINT32 rxdesc_err_tkip_mic;
  12887. /* Number of MSDUs with flag of decrypt_err */
  12888. A_UINT32 rxdesc_err_decrypt;
  12889. /* Number of MSDUs with flag of fcs_err */
  12890. A_UINT32 rxdesc_err_fcs;
  12891. /* Number of Unicast (bc_mc bit is not set in attention word)
  12892. * frames with invalid peer handler
  12893. */
  12894. A_UINT32 rxdesc_uc_msdus_inv_peer;
  12895. /* Number of unicast frame directly (direct bit is set in attention word)
  12896. * to DUT with invalid peer handler
  12897. */
  12898. A_UINT32 rxdesc_direct_msdus_inv_peer;
  12899. /* Number of Broadcast/Multicast (bc_mc bit set in attention word)
  12900. * frames with invalid peer handler
  12901. */
  12902. A_UINT32 rxdesc_bmc_msdus_inv_peer;
  12903. /* Number of MSDUs dropped due to no first MSDU flag */
  12904. A_UINT32 rxdesc_no_1st_msdu;
  12905. /* Number of MSDUs droped due to ring overflow */
  12906. A_UINT32 msdu_drop_ring_ov;
  12907. /* Number of MSDUs dropped due to FC mismatch */
  12908. A_UINT32 msdu_drop_fc_mismatch;
  12909. /* Number of MSDUs dropped due to mgt frame in Remote ring */
  12910. A_UINT32 msdu_drop_mgmt_remote_ring;
  12911. /* Number of MSDUs dropped due to errors not reported in attention word */
  12912. A_UINT32 msdu_drop_misc;
  12913. /* Number of MSDUs go to offload before reorder */
  12914. A_UINT32 offload_msdu_wal;
  12915. /* Number of data frame dropped by offload after reorder */
  12916. A_UINT32 offload_msdu_reorder;
  12917. /* Number of MPDUs with sequence number in the past and within the BA window */
  12918. A_UINT32 dup_past_within_window;
  12919. /* Number of MPDUs with sequence number in the past and outside the BA window */
  12920. A_UINT32 dup_past_outside_window;
  12921. /* Number of MSDUs with decrypt/MIC error */
  12922. A_UINT32 rxdesc_err_decrypt_mic;
  12923. /* Number of data MSDUs received on both local and remote rings */
  12924. A_UINT32 data_msdus_on_both_rings;
  12925. /* MPDUs never filled */
  12926. A_UINT32 holes_not_filled;
  12927. };
  12928. /*
  12929. * Rx Remote buffer statistics
  12930. * NB: all the fields must be defined in 4 octets size.
  12931. */
  12932. struct rx_remote_buffer_mgmt_stats {
  12933. /* Total number of MSDUs reaped for Rx processing */
  12934. A_UINT32 remote_reaped;
  12935. /* MSDUs recycled within firmware */
  12936. A_UINT32 remote_recycled;
  12937. /* MSDUs stored by Data Rx */
  12938. A_UINT32 data_rx_msdus_stored;
  12939. /* Number of HTT indications from WAL Rx MSDU */
  12940. A_UINT32 wal_rx_ind;
  12941. /* Number of unconsumed HTT indications from WAL Rx MSDU */
  12942. A_UINT32 wal_rx_ind_unconsumed;
  12943. /* Number of HTT indications from Data Rx MSDU */
  12944. A_UINT32 data_rx_ind;
  12945. /* Number of unconsumed HTT indications from Data Rx MSDU */
  12946. A_UINT32 data_rx_ind_unconsumed;
  12947. /* Number of HTT indications from ATHBUF */
  12948. A_UINT32 athbuf_rx_ind;
  12949. /* Number of remote buffers requested for refill */
  12950. A_UINT32 refill_buf_req;
  12951. /* Number of remote buffers filled by the host */
  12952. A_UINT32 refill_buf_rsp;
  12953. /* Number of times MAC hw_index = f/w write_index */
  12954. A_INT32 mac_no_bufs;
  12955. /* Number of times f/w write_index = f/w read_index for MAC Rx ring */
  12956. A_INT32 fw_indices_equal;
  12957. /* Number of times f/w finds no buffers to post */
  12958. A_INT32 host_no_bufs;
  12959. };
  12960. /*
  12961. * TXBF MU/SU packets and NDPA statistics
  12962. * NB: all the fields must be defined in 4 octets size.
  12963. */
  12964. struct rx_txbf_musu_ndpa_pkts_stats {
  12965. A_UINT32 number_mu_pkts; /* number of TXBF MU packets received */
  12966. A_UINT32 number_su_pkts; /* number of TXBF SU packets received */
  12967. A_UINT32 txbf_directed_ndpa_count; /* number of TXBF directed NDPA */
  12968. A_UINT32 txbf_ndpa_retry_count; /* number of TXBF retried NDPA */
  12969. A_UINT32 txbf_total_ndpa_count; /* total number of TXBF NDPA */
  12970. A_UINT32 reserved[3]; /* must be set to 0x0 */
  12971. };
  12972. /*
  12973. * htt_dbg_stats_status -
  12974. * present - The requested stats have been delivered in full.
  12975. * This indicates that either the stats information was contained
  12976. * in its entirety within this message, or else this message
  12977. * completes the delivery of the requested stats info that was
  12978. * partially delivered through earlier STATS_CONF messages.
  12979. * partial - The requested stats have been delivered in part.
  12980. * One or more subsequent STATS_CONF messages with the same
  12981. * cookie value will be sent to deliver the remainder of the
  12982. * information.
  12983. * error - The requested stats could not be delivered, for example due
  12984. * to a shortage of memory to construct a message holding the
  12985. * requested stats.
  12986. * invalid - The requested stat type is either not recognized, or the
  12987. * target is configured to not gather the stats type in question.
  12988. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  12989. * series_done - This special value indicates that no further stats info
  12990. * elements are present within a series of stats info elems
  12991. * (within a stats upload confirmation message).
  12992. */
  12993. enum htt_dbg_stats_status {
  12994. HTT_DBG_STATS_STATUS_PRESENT = 0,
  12995. HTT_DBG_STATS_STATUS_PARTIAL = 1,
  12996. HTT_DBG_STATS_STATUS_ERROR = 2,
  12997. HTT_DBG_STATS_STATUS_INVALID = 3,
  12998. HTT_DBG_STATS_STATUS_SERIES_DONE = 7
  12999. };
  13000. /**
  13001. * @brief target -> host statistics upload
  13002. *
  13003. * MSG_TYPE => HTT_T2H_MSG_TYPE_STATS_CONF
  13004. *
  13005. * @details
  13006. * The following field definitions describe the format of the HTT target
  13007. * to host stats upload confirmation message.
  13008. * The message contains a cookie echoed from the HTT host->target stats
  13009. * upload request, which identifies which request the confirmation is
  13010. * for, and a series of tag-length-value stats information elements.
  13011. * The tag-length header for each stats info element also includes a
  13012. * status field, to indicate whether the request for the stat type in
  13013. * question was fully met, partially met, unable to be met, or invalid
  13014. * (if the stat type in question is disabled in the target).
  13015. * A special value of all 1's in this status field is used to indicate
  13016. * the end of the series of stats info elements.
  13017. *
  13018. *
  13019. * |31 16|15 8|7 5|4 0|
  13020. * |------------------------------------------------------------|
  13021. * | reserved | msg type |
  13022. * |------------------------------------------------------------|
  13023. * | cookie LSBs |
  13024. * |------------------------------------------------------------|
  13025. * | cookie MSBs |
  13026. * |------------------------------------------------------------|
  13027. * | stats entry length | reserved | S |stat type|
  13028. * |------------------------------------------------------------|
  13029. * | |
  13030. * | type-specific stats info |
  13031. * | |
  13032. * |------------------------------------------------------------|
  13033. * | stats entry length | reserved | S |stat type|
  13034. * |------------------------------------------------------------|
  13035. * | |
  13036. * | type-specific stats info |
  13037. * | |
  13038. * |------------------------------------------------------------|
  13039. * | n/a | reserved | 111 | n/a |
  13040. * |------------------------------------------------------------|
  13041. * Header fields:
  13042. * - MSG_TYPE
  13043. * Bits 7:0
  13044. * Purpose: identifies this is a statistics upload confirmation message
  13045. * Value: 0x9 (HTT_T2H_MSG_TYPE_STATS_CONF)
  13046. * - COOKIE_LSBS
  13047. * Bits 31:0
  13048. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13049. * message with its preceding host->target stats request message.
  13050. * Value: LSBs of the opaque cookie specified by the host-side requestor
  13051. * - COOKIE_MSBS
  13052. * Bits 31:0
  13053. * Purpose: Provide a mechanism to match a target->host stats confirmation
  13054. * message with its preceding host->target stats request message.
  13055. * Value: MSBs of the opaque cookie specified by the host-side requestor
  13056. *
  13057. * Stats Information Element tag-length header fields:
  13058. * - STAT_TYPE
  13059. * Bits 4:0
  13060. * Purpose: identifies the type of statistics info held in the
  13061. * following information element
  13062. * Value: htt_dbg_stats_type
  13063. * - STATUS
  13064. * Bits 7:5
  13065. * Purpose: indicate whether the requested stats are present
  13066. * Value: htt_dbg_stats_status, including a special value (0x7) to mark
  13067. * the completion of the stats entry series
  13068. * - LENGTH
  13069. * Bits 31:16
  13070. * Purpose: indicate the stats information size
  13071. * Value: This field specifies the number of bytes of stats information
  13072. * that follows the element tag-length header.
  13073. * It is expected but not required that this length is a multiple of
  13074. * 4 bytes. Even if the length is not an integer multiple of 4, the
  13075. * subsequent stats entry header will begin on a 4-byte aligned
  13076. * boundary.
  13077. */
  13078. #define HTT_T2H_STATS_COOKIE_SIZE 8
  13079. #define HTT_T2H_STATS_CONF_TAIL_SIZE 4
  13080. #define HTT_T2H_STATS_CONF_HDR_SIZE 4
  13081. #define HTT_T2H_STATS_CONF_TLV_HDR_SIZE 4
  13082. #define HTT_T2H_STATS_CONF_TLV_TYPE_M 0x0000001f
  13083. #define HTT_T2H_STATS_CONF_TLV_TYPE_S 0
  13084. #define HTT_T2H_STATS_CONF_TLV_STATUS_M 0x000000e0
  13085. #define HTT_T2H_STATS_CONF_TLV_STATUS_S 5
  13086. #define HTT_T2H_STATS_CONF_TLV_LENGTH_M 0xffff0000
  13087. #define HTT_T2H_STATS_CONF_TLV_LENGTH_S 16
  13088. #define HTT_T2H_STATS_CONF_TLV_TYPE_SET(word, value) \
  13089. do { \
  13090. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_TYPE, value); \
  13091. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_TYPE_S; \
  13092. } while (0)
  13093. #define HTT_T2H_STATS_CONF_TLV_TYPE_GET(word) \
  13094. (((word) & HTT_T2H_STATS_CONF_TLV_TYPE_M) >> \
  13095. HTT_T2H_STATS_CONF_TLV_TYPE_S)
  13096. #define HTT_T2H_STATS_CONF_TLV_STATUS_SET(word, value) \
  13097. do { \
  13098. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_STATUS, value); \
  13099. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_STATUS_S; \
  13100. } while (0)
  13101. #define HTT_T2H_STATS_CONF_TLV_STATUS_GET(word) \
  13102. (((word) & HTT_T2H_STATS_CONF_TLV_STATUS_M) >> \
  13103. HTT_T2H_STATS_CONF_TLV_STATUS_S)
  13104. #define HTT_T2H_STATS_CONF_TLV_LENGTH_SET(word, value) \
  13105. do { \
  13106. HTT_CHECK_SET_VAL(HTT_T2H_STATS_CONF_TLV_LENGTH, value); \
  13107. (word) |= (value) << HTT_T2H_STATS_CONF_TLV_LENGTH_S; \
  13108. } while (0)
  13109. #define HTT_T2H_STATS_CONF_TLV_LENGTH_GET(word) \
  13110. (((word) & HTT_T2H_STATS_CONF_TLV_LENGTH_M) >> \
  13111. HTT_T2H_STATS_CONF_TLV_LENGTH_S)
  13112. #define HL_HTT_FW_RX_DESC_RSVD_SIZE 18
  13113. #define HTT_MAX_AGGR 64
  13114. #define HTT_HL_MAX_AGGR 18
  13115. /**
  13116. * @brief host -> target FRAG DESCRIPTOR/MSDU_EXT DESC bank
  13117. *
  13118. * MSG_TYPE => HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG
  13119. *
  13120. * @details
  13121. * The following field definitions describe the format of the HTT host
  13122. * to target frag_desc/msdu_ext bank configuration message.
  13123. * The message contains the based address and the min and max id of the
  13124. * MSDU_EXT/FRAG_DESC that will be used by the HTT to map MSDU DESC and
  13125. * MSDU_EXT/FRAG_DESC.
  13126. * HTT will use id in HTT descriptor instead sending the frag_desc_ptr.
  13127. * In peregrine the firmware will use fragment_desc_ptr but in WIFI2.0
  13128. * the hardware does the mapping/translation.
  13129. *
  13130. * Total banks that can be configured is configured to 16.
  13131. *
  13132. * This should be called before any TX has be initiated by the HTT
  13133. *
  13134. * |31 16|15 8|7 5|4 0|
  13135. * |------------------------------------------------------------|
  13136. * | DESC_SIZE | NUM_BANKS | RES |SWP|pdev| msg type |
  13137. * |------------------------------------------------------------|
  13138. * | BANK0_BASE_ADDRESS (bits 31:0) |
  13139. #if HTT_PADDR64
  13140. * | BANK0_BASE_ADDRESS (bits 63:32) |
  13141. #endif
  13142. * |------------------------------------------------------------|
  13143. * | ... |
  13144. * |------------------------------------------------------------|
  13145. * | BANK15_BASE_ADDRESS (bits 31:0) |
  13146. #if HTT_PADDR64
  13147. * | BANK15_BASE_ADDRESS (bits 63:32) |
  13148. #endif
  13149. * |------------------------------------------------------------|
  13150. * | BANK0_MAX_ID | BANK0_MIN_ID |
  13151. * |------------------------------------------------------------|
  13152. * | ... |
  13153. * |------------------------------------------------------------|
  13154. * | BANK15_MAX_ID | BANK15_MIN_ID |
  13155. * |------------------------------------------------------------|
  13156. * Header fields:
  13157. * - MSG_TYPE
  13158. * Bits 7:0
  13159. * Value: 0x6 (HTT_H2T_MSG_TYPE_FRAG_DESC_BANK_CFG)
  13160. * for systems with 64-bit format for bus addresses:
  13161. * - BANKx_BASE_ADDRESS_LO
  13162. * Bits 31:0
  13163. * Purpose: Provide a mechanism to specify the base address of the
  13164. * MSDU_EXT bank physical/bus address.
  13165. * Value: lower 4 bytes of MSDU_EXT bank physical / bus address
  13166. * - BANKx_BASE_ADDRESS_HI
  13167. * Bits 31:0
  13168. * Purpose: Provide a mechanism to specify the base address of the
  13169. * MSDU_EXT bank physical/bus address.
  13170. * Value: higher 4 bytes of MSDU_EXT bank physical / bus address
  13171. * for systems with 32-bit format for bus addresses:
  13172. * - BANKx_BASE_ADDRESS
  13173. * Bits 31:0
  13174. * Purpose: Provide a mechanism to specify the base address of the
  13175. * MSDU_EXT bank physical/bus address.
  13176. * Value: MSDU_EXT bank physical / bus address
  13177. * - BANKx_MIN_ID
  13178. * Bits 15:0
  13179. * Purpose: Provide a mechanism to specify the min index that needs to
  13180. * mapped.
  13181. * - BANKx_MAX_ID
  13182. * Bits 31:16
  13183. * Purpose: Provide a mechanism to specify the max index that needs to
  13184. * mapped.
  13185. *
  13186. */
  13187. /** @todo Compress the fields to fit MAX HTT Message size, until then configure to a
  13188. * safe value.
  13189. * @note MAX supported banks is 16.
  13190. */
  13191. #define HTT_TX_MSDU_EXT_BANK_MAX 4
  13192. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_M 0x300
  13193. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_S 8
  13194. #define HTT_H2T_FRAG_DESC_BANK_SWAP_M 0x400
  13195. #define HTT_H2T_FRAG_DESC_BANK_SWAP_S 10
  13196. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M 0xff0000
  13197. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S 16
  13198. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M 0xff000000
  13199. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S 24
  13200. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M 0xffff
  13201. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S 0
  13202. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M 0xffff0000
  13203. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S 16
  13204. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_SET(word, value) \
  13205. do { \
  13206. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_PDEVID, value); \
  13207. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_PDEVID_S); \
  13208. } while (0)
  13209. #define HTT_H2T_FRAG_DESC_BANK_PDEVID_GET(word) \
  13210. (((word) & HTT_H2T_FRAG_DESC_BANK_PDEVID_M) >> HTT_H2T_FRAG_DESC_BANK_PDEVID_S)
  13211. #define HTT_H2T_FRAG_DESC_BANK_SWAP_SET(word, value) \
  13212. do { \
  13213. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_SWAP, value); \
  13214. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_SWAP_S); \
  13215. } while (0)
  13216. #define HTT_H2T_FRAG_DESC_BANK_SWAP_GET(word) \
  13217. (((word) & HTT_H2T_FRAG_DESC_BANK_SWAP_M) >> HTT_H2T_FRAG_DESC_BANK_SWAP_S)
  13218. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_SET(word, value) \
  13219. do { \
  13220. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_NUM_BANKS, value); \
  13221. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S); \
  13222. } while (0)
  13223. #define HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_GET(word) \
  13224. (((word) & HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_M) >> HTT_H2T_FRAG_DESC_BANK_NUM_BANKS_S)
  13225. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_SET(word, value) \
  13226. do { \
  13227. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_DESC_SIZE, value); \
  13228. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S); \
  13229. } while (0)
  13230. #define HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_GET(word) \
  13231. (((word) & HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_M) >> HTT_H2T_FRAG_DESC_BANK_DESC_SIZE_S)
  13232. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_SET(word, value) \
  13233. do { \
  13234. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MIN_IDX, value); \
  13235. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S); \
  13236. } while (0)
  13237. #define HTT_H2T_FRAG_DESC_BANK_MIN_IDX_GET(word) \
  13238. (((word) & HTT_H2T_FRAG_DESC_BANK_MIN_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MIN_IDX_S)
  13239. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_SET(word, value) \
  13240. do { \
  13241. HTT_CHECK_SET_VAL(HTT_H2T_FRAG_DESC_BANK_MAX_IDX, value); \
  13242. (word) |= ((value) << HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S); \
  13243. } while (0)
  13244. #define HTT_H2T_FRAG_DESC_BANK_MAX_IDX_GET(word) \
  13245. (((word) & HTT_H2T_FRAG_DESC_BANK_MAX_IDX_M) >> HTT_H2T_FRAG_DESC_BANK_MAX_IDX_S)
  13246. /*
  13247. * TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T:
  13248. * This macro defines a htt_tx_frag_descXXX_bank_cfg_t in which any physical
  13249. * addresses are stored in a XXX-bit field.
  13250. * This macro is used to define both htt_tx_frag_desc32_bank_cfg_t and
  13251. * htt_tx_frag_desc64_bank_cfg_t structs.
  13252. */
  13253. #define TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T( \
  13254. _paddr_bits_, \
  13255. _paddr__bank_base_address_) \
  13256. PREPACK struct htt_tx_frag_desc ## _paddr_bits_ ## _bank_cfg_t { \
  13257. /** word 0 \
  13258. * msg_type: 8, \
  13259. * pdev_id: 2, \
  13260. * swap: 1, \
  13261. * reserved0: 5, \
  13262. * num_banks: 8, \
  13263. * desc_size: 8; \
  13264. */ \
  13265. A_UINT32 word0; \
  13266. /* \
  13267. * If bank_base_address is 64 bits, the upper / lower halves are stored \
  13268. * in little-endian order (bytes 0-3 in the first A_UINT32, bytes 4-7 in \
  13269. * the second A_UINT32). \
  13270. */ \
  13271. _paddr__bank_base_address_[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13272. A_UINT32 bank_info[HTT_TX_MSDU_EXT_BANK_MAX]; \
  13273. } POSTPACK
  13274. /* define htt_tx_frag_desc32_bank_cfg_t */
  13275. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(32, HTT_VAR_PADDR32(bank_base_address));
  13276. /* define htt_tx_frag_desc64_bank_cfg_t */
  13277. TEMPLATE_HTT_TX_FRAG_DESC_BANK_CFG_T(64, HTT_VAR_PADDR64_LE(bank_base_address));
  13278. /*
  13279. * Make htt_tx_frag_desc_bank_cfg_t be an alias for either
  13280. * htt_tx_frag_desc32_bank_cfg_t or htt_tx_frag_desc64_bank_cfg_t
  13281. */
  13282. #if HTT_PADDR64
  13283. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc64_bank_cfg_t
  13284. #else
  13285. #define htt_tx_frag_desc_bank_cfg_t htt_tx_frag_desc32_bank_cfg_t
  13286. #endif
  13287. /**
  13288. * @brief target -> host HTT TX Credit total count update message definition
  13289. *
  13290. * MSG_TYPE => HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND
  13291. *
  13292. *|31 16|15|14 9| 8 |7 0 |
  13293. *|---------------------+--+----------+-------+----------|
  13294. *|cur htt credit delta | Q| reserved | sign | msg type |
  13295. *|------------------------------------------------------|
  13296. *
  13297. * Header fields:
  13298. * - MSG_TYPE
  13299. * Bits 7:0
  13300. * Purpose: identifies this as a htt tx credit delta update message
  13301. * Value: 0xf (HTT_T2H_MSG_TYPE_TX_CREDIT_UPDATE_IND)
  13302. * - SIGN
  13303. * Bits 8
  13304. * identifies whether credit delta is positive or negative
  13305. * Value:
  13306. * - 0x0: credit delta is positive, rebalance in some buffers
  13307. * - 0x1: credit delta is negative, rebalance out some buffers
  13308. * - reserved
  13309. * Bits 14:9
  13310. * Value: 0x0
  13311. * - TXQ_GRP
  13312. * Bit 15
  13313. * Purpose: indicates whether any tx queue group information elements
  13314. * are appended to the tx credit update message
  13315. * Value: 0 -> no tx queue group information element is present
  13316. * 1 -> a tx queue group information element immediately follows
  13317. * - DELTA_COUNT
  13318. * Bits 31:16
  13319. * Purpose: Specify current htt credit delta absolute count
  13320. */
  13321. #define HTT_TX_CREDIT_SIGN_BIT_M 0x00000100
  13322. #define HTT_TX_CREDIT_SIGN_BIT_S 8
  13323. #define HTT_TX_CREDIT_TXQ_GRP_M 0x00008000
  13324. #define HTT_TX_CREDIT_TXQ_GRP_S 15
  13325. #define HTT_TX_CREDIT_DELTA_ABS_M 0xffff0000
  13326. #define HTT_TX_CREDIT_DELTA_ABS_S 16
  13327. #define HTT_TX_CREDIT_SIGN_BIT_SET(word, value) \
  13328. do { \
  13329. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_SIGN_BIT, value); \
  13330. (word) |= (value) << HTT_TX_CREDIT_SIGN_BIT_S; \
  13331. } while (0)
  13332. #define HTT_TX_CREDIT_SIGN_BIT_GET(word) \
  13333. (((word) & HTT_TX_CREDIT_SIGN_BIT_M) >> HTT_TX_CREDIT_SIGN_BIT_S)
  13334. #define HTT_TX_CREDIT_TXQ_GRP_SET(word, value) \
  13335. do { \
  13336. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_TXQ_GRP, value); \
  13337. (word) |= (value) << HTT_TX_CREDIT_TXQ_GRP_S; \
  13338. } while (0)
  13339. #define HTT_TX_CREDIT_TXQ_GRP_GET(word) \
  13340. (((word) & HTT_TX_CREDIT_TXQ_GRP_M) >> HTT_TX_CREDIT_TXQ_GRP_S)
  13341. #define HTT_TX_CREDIT_DELTA_ABS_SET(word, value) \
  13342. do { \
  13343. HTT_CHECK_SET_VAL(HTT_TX_CREDIT_DELTA_ABS, value); \
  13344. (word) |= (value) << HTT_TX_CREDIT_DELTA_ABS_S; \
  13345. } while (0)
  13346. #define HTT_TX_CREDIT_DELTA_ABS_GET(word) \
  13347. (((word) & HTT_TX_CREDIT_DELTA_ABS_M) >> HTT_TX_CREDIT_DELTA_ABS_S)
  13348. #define HTT_TX_CREDIT_MSG_BYTES 4
  13349. #define HTT_TX_CREDIT_SIGN_BIT_POSITIVE 0x0
  13350. #define HTT_TX_CREDIT_SIGN_BIT_NEGATIVE 0x1
  13351. /**
  13352. * @brief HTT WDI_IPA Operation Response Message
  13353. *
  13354. * MSG_TYPE => HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE
  13355. *
  13356. * @details
  13357. * HTT WDI_IPA Operation Response message is sent by target
  13358. * to host confirming suspend or resume operation.
  13359. * |31 24|23 16|15 8|7 0|
  13360. * |----------------+----------------+----------------+----------------|
  13361. * | op_code | Rsvd | msg_type |
  13362. * |-------------------------------------------------------------------|
  13363. * | Rsvd | Response len |
  13364. * |-------------------------------------------------------------------|
  13365. * | |
  13366. * | Response-type specific info |
  13367. * | |
  13368. * | |
  13369. * |-------------------------------------------------------------------|
  13370. * Header fields:
  13371. * - MSG_TYPE
  13372. * Bits 7:0
  13373. * Purpose: Identifies this as WDI_IPA Operation Response message
  13374. * value: = 0x14 (HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE)
  13375. * - OP_CODE
  13376. * Bits 31:16
  13377. * Purpose: Identifies the operation target is responding to (e.g. TX suspend)
  13378. * value: = enum htt_wdi_ipa_op_code
  13379. * - RSP_LEN
  13380. * Bits 16:0
  13381. * Purpose: length for the response-type specific info
  13382. * value: = length in bytes for response-type specific info
  13383. * For example, if OP_CODE == HTT_WDI_IPA_OPCODE_DBG_STATS, the
  13384. * length value will be sizeof(struct wlan_wdi_ipa_dbg_stats_t).
  13385. */
  13386. PREPACK struct htt_wdi_ipa_op_response_t
  13387. {
  13388. /* DWORD 0: flags and meta-data */
  13389. A_UINT32
  13390. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13391. reserved1: 8,
  13392. op_code: 16;
  13393. A_UINT32
  13394. rsp_len: 16,
  13395. reserved2: 16;
  13396. } POSTPACK;
  13397. #define HTT_WDI_IPA_OP_RESPONSE_SZ 8 /* bytes */
  13398. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M 0xffff0000
  13399. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S 16
  13400. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M 0x0000ffff
  13401. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S 0
  13402. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_GET(_var) \
  13403. (((_var) & HTT_WDI_IPA_OP_RESPONSE_OP_CODE_M) >> HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)
  13404. #define HTT_WDI_IPA_OP_RESPONSE_OP_CODE_SET(_var, _val) \
  13405. do { \
  13406. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_OP_CODE, _val); \
  13407. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_OP_CODE_S)); \
  13408. } while (0)
  13409. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_GET(_var) \
  13410. (((_var) & HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_M) >> HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)
  13411. #define HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_SET(_var, _val) \
  13412. do { \
  13413. HTT_CHECK_SET_VAL(HTT_WDI_IPA_OP_RESPONSE_RSP_LEN, _val); \
  13414. ((_var) |= ((_val) << HTT_WDI_IPA_OP_RESPONSE_RSP_LEN_S)); \
  13415. } while (0)
  13416. enum htt_phy_mode {
  13417. htt_phy_mode_11a = 0,
  13418. htt_phy_mode_11g = 1,
  13419. htt_phy_mode_11b = 2,
  13420. htt_phy_mode_11g_only = 3,
  13421. htt_phy_mode_11na_ht20 = 4,
  13422. htt_phy_mode_11ng_ht20 = 5,
  13423. htt_phy_mode_11na_ht40 = 6,
  13424. htt_phy_mode_11ng_ht40 = 7,
  13425. htt_phy_mode_11ac_vht20 = 8,
  13426. htt_phy_mode_11ac_vht40 = 9,
  13427. htt_phy_mode_11ac_vht80 = 10,
  13428. htt_phy_mode_11ac_vht20_2g = 11,
  13429. htt_phy_mode_11ac_vht40_2g = 12,
  13430. htt_phy_mode_11ac_vht80_2g = 13,
  13431. htt_phy_mode_11ac_vht80_80 = 14, /* 80+80 */
  13432. htt_phy_mode_11ac_vht160 = 15,
  13433. htt_phy_mode_max,
  13434. };
  13435. /**
  13436. * @brief target -> host HTT channel change indication
  13437. *
  13438. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CHANGE
  13439. *
  13440. * @details
  13441. * Specify when a channel change occurs.
  13442. * This allows the host to precisely determine which rx frames arrived
  13443. * on the old channel and which rx frames arrived on the new channel.
  13444. *
  13445. *|31 |7 0 |
  13446. *|-------------------------------------------+----------|
  13447. *| reserved | msg type |
  13448. *|------------------------------------------------------|
  13449. *| primary_chan_center_freq_mhz |
  13450. *|------------------------------------------------------|
  13451. *| contiguous_chan1_center_freq_mhz |
  13452. *|------------------------------------------------------|
  13453. *| contiguous_chan2_center_freq_mhz |
  13454. *|------------------------------------------------------|
  13455. *| phy_mode |
  13456. *|------------------------------------------------------|
  13457. *
  13458. * Header fields:
  13459. * - MSG_TYPE
  13460. * Bits 7:0
  13461. * Purpose: identifies this as a htt channel change indication message
  13462. * Value: 0x15 (HTT_T2H_MSG_TYPE_CHAN_CHANGE)
  13463. * - PRIMARY_CHAN_CENTER_FREQ_MHZ
  13464. * Bits 31:0
  13465. * Purpose: identify the (center of the) new 20 MHz primary channel
  13466. * Value: center frequency of the 20 MHz primary channel, in MHz units
  13467. * - CONTIG_CHAN1_CENTER_FREQ_MHZ
  13468. * Bits 31:0
  13469. * Purpose: identify the (center of the) contiguous frequency range
  13470. * comprising the new channel.
  13471. * For example, if the new channel is a 80 MHz channel extending
  13472. * 60 MHz beyond the primary channel, this field would be 30 larger
  13473. * than the primary channel center frequency field.
  13474. * Value: center frequency of the contiguous frequency range comprising
  13475. * the full channel in MHz units
  13476. * (80+80 channels also use the CONTIG_CHAN2 field)
  13477. * - CONTIG_CHAN2_CENTER_FREQ_MHZ
  13478. * Bits 31:0
  13479. * Purpose: Identify the (center of the) 80 MHz extension frequency range
  13480. * within a VHT 80+80 channel.
  13481. * This field is only relevant for VHT 80+80 channels.
  13482. * Value: center frequency of the 80 MHz extension channel in a VHT 80+80
  13483. * channel (arbitrary value for cases besides VHT 80+80)
  13484. * - PHY_MODE
  13485. * Bits 31:0
  13486. * Purpose: specify the PHY channel's type (legacy vs. HT vs. VHT), width,
  13487. * and band
  13488. * Value: htt_phy_mode enum value
  13489. */
  13490. PREPACK struct htt_chan_change_t
  13491. {
  13492. /* DWORD 0: flags and meta-data */
  13493. A_UINT32
  13494. msg_type: 8, /* HTT_T2H_MSG_TYPE_WDI_IPA_OP_RESPONSE */
  13495. reserved1: 24;
  13496. A_UINT32 primary_chan_center_freq_mhz;
  13497. A_UINT32 contig_chan1_center_freq_mhz;
  13498. A_UINT32 contig_chan2_center_freq_mhz;
  13499. A_UINT32 phy_mode;
  13500. } POSTPACK;
  13501. /*
  13502. * Due to historical / backwards-compatibility reasons, maintain the
  13503. * below htt_chan_change_msg struct definition, which needs to be
  13504. * consistent with the above htt_chan_change_t struct definition
  13505. * (aside from the htt_chan_change_t definition including the msg_type
  13506. * dword within the message, and the htt_chan_change_msg only containing
  13507. * the payload of the message that follows the msg_type dword).
  13508. */
  13509. PREPACK struct htt_chan_change_msg {
  13510. A_UINT32 chan_mhz; /* frequency in mhz */
  13511. A_UINT32 band_center_freq1; /* Center frequency 1 in MHz */
  13512. A_UINT32 band_center_freq2; /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode*/
  13513. A_UINT32 chan_mode; /* WLAN_PHY_MODE of the channel defined in wlan_defs.h */
  13514. } POSTPACK;
  13515. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M 0xffffffff
  13516. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S 0
  13517. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M 0xffffffff
  13518. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S 0
  13519. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M 0xffffffff
  13520. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S 0
  13521. #define HTT_CHAN_CHANGE_PHY_MODE_M 0xffffffff
  13522. #define HTT_CHAN_CHANGE_PHY_MODE_S 0
  13523. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_SET(word, value) \
  13524. do { \
  13525. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ, value);\
  13526. (word) |= (value) << HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S; \
  13527. } while (0)
  13528. #define HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_GET(word) \
  13529. (((word) & HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_M) \
  13530. >> HTT_CHAN_CHANGE_PRIMARY_CHAN_CENTER_FREQ_MHZ_S)
  13531. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_SET(word, value) \
  13532. do { \
  13533. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ, value);\
  13534. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S; \
  13535. } while (0)
  13536. #define HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_GET(word) \
  13537. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_M) \
  13538. >> HTT_CHAN_CHANGE_CONTIG_CHAN1_CENTER_FREQ_MHZ_S)
  13539. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_SET(word, value) \
  13540. do { \
  13541. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ, value);\
  13542. (word) |= (value) << HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S; \
  13543. } while (0)
  13544. #define HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_GET(word) \
  13545. (((word) & HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_M) \
  13546. >> HTT_CHAN_CHANGE_CONTIG_CHAN2_CENTER_FREQ_MHZ_S)
  13547. #define HTT_CHAN_CHANGE_PHY_MODE_SET(word, value) \
  13548. do { \
  13549. HTT_CHECK_SET_VAL(HTT_CHAN_CHANGE_PHY_MODE, value);\
  13550. (word) |= (value) << HTT_CHAN_CHANGE_PHY_MODE_S; \
  13551. } while (0)
  13552. #define HTT_CHAN_CHANGE_PHY_MODE_GET(word) \
  13553. (((word) & HTT_CHAN_CHANGE_PHY_MODE_M) \
  13554. >> HTT_CHAN_CHANGE_PHY_MODE_S)
  13555. #define HTT_CHAN_CHANGE_BYTES sizeof(struct htt_chan_change_t)
  13556. /**
  13557. * @brief rx offload packet error message
  13558. *
  13559. * MSG_TYPE => HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR
  13560. *
  13561. * @details
  13562. * HTT_RX_OFLD_PKT_ERR message is sent by target to host to indicate err
  13563. * of target payload like mic err.
  13564. *
  13565. * |31 24|23 16|15 8|7 0|
  13566. * |----------------+----------------+----------------+----------------|
  13567. * | tid | vdev_id | msg_sub_type | msg_type |
  13568. * |-------------------------------------------------------------------|
  13569. * : (sub-type dependent content) :
  13570. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13571. * Header fields:
  13572. * - msg_type
  13573. * Bits 7:0
  13574. * Purpose: Identifies this as HTT_RX_OFLD_PKT_ERR message
  13575. * value: 0x16 (HTT_T2H_MSG_TYPE_RX_OFLD_PKT_ERR)
  13576. * - msg_sub_type
  13577. * Bits 15:8
  13578. * Purpose: Identifies which type of rx error is reported by this message
  13579. * value: htt_rx_ofld_pkt_err_type
  13580. * - vdev_id
  13581. * Bits 23:16
  13582. * Purpose: Identifies which vdev received the erroneous rx frame
  13583. * value:
  13584. * - tid
  13585. * Bits 31:24
  13586. * Purpose: Identifies the traffic type of the rx frame
  13587. * value:
  13588. *
  13589. * - The payload fields used if the sub-type == MIC error are shown below.
  13590. * Note - MIC err is per MSDU, while PN is per MPDU.
  13591. * The FW will discard the whole MPDU if any MSDU within the MPDU is marked
  13592. * with MIC err in A-MSDU case, so FW will send only one HTT message
  13593. * with the PN of this MPDU attached to indicate MIC err for one MPDU
  13594. * instead of sending separate HTT messages for each wrong MSDU within
  13595. * the MPDU.
  13596. *
  13597. * |31 24|23 16|15 8|7 0|
  13598. * |----------------+----------------+----------------+----------------|
  13599. * | Rsvd | key_id | peer_id |
  13600. * |-------------------------------------------------------------------|
  13601. * | receiver MAC addr 31:0 |
  13602. * |-------------------------------------------------------------------|
  13603. * | Rsvd | receiver MAC addr 47:32 |
  13604. * |-------------------------------------------------------------------|
  13605. * | transmitter MAC addr 31:0 |
  13606. * |-------------------------------------------------------------------|
  13607. * | Rsvd | transmitter MAC addr 47:32 |
  13608. * |-------------------------------------------------------------------|
  13609. * | PN 31:0 |
  13610. * |-------------------------------------------------------------------|
  13611. * | Rsvd | PN 47:32 |
  13612. * |-------------------------------------------------------------------|
  13613. * - peer_id
  13614. * Bits 15:0
  13615. * Purpose: identifies which peer is frame is from
  13616. * value:
  13617. * - key_id
  13618. * Bits 23:16
  13619. * Purpose: identifies key_id of rx frame
  13620. * value:
  13621. * - RA_31_0 (receiver MAC addr 31:0)
  13622. * Bits 31:0
  13623. * Purpose: identifies by MAC address which vdev received the frame
  13624. * value: MAC address lower 4 bytes
  13625. * - RA_47_32 (receiver MAC addr 47:32)
  13626. * Bits 15:0
  13627. * Purpose: identifies by MAC address which vdev received the frame
  13628. * value: MAC address upper 2 bytes
  13629. * - TA_31_0 (transmitter MAC addr 31:0)
  13630. * Bits 31:0
  13631. * Purpose: identifies by MAC address which peer transmitted the frame
  13632. * value: MAC address lower 4 bytes
  13633. * - TA_47_32 (transmitter MAC addr 47:32)
  13634. * Bits 15:0
  13635. * Purpose: identifies by MAC address which peer transmitted the frame
  13636. * value: MAC address upper 2 bytes
  13637. * - PN_31_0
  13638. * Bits 31:0
  13639. * Purpose: Identifies pn of rx frame
  13640. * value: PN lower 4 bytes
  13641. * - PN_47_32
  13642. * Bits 15:0
  13643. * Purpose: Identifies pn of rx frame
  13644. * value:
  13645. * TKIP or CCMP: PN upper 2 bytes
  13646. * WAPI: PN bytes 6:5 (bytes 15:7 not included in this message)
  13647. */
  13648. enum htt_rx_ofld_pkt_err_type {
  13649. HTT_RX_OFLD_PKT_ERR_TYPE_NONE = 0,
  13650. HTT_RX_OFLD_PKT_ERR_TYPE_MIC_ERR,
  13651. };
  13652. /* definition for HTT_RX_OFLD_PKT_ERR msg hdr */
  13653. #define HTT_RX_OFLD_PKT_ERR_HDR_BYTES 4
  13654. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M 0x0000ff00
  13655. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S 8
  13656. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_M 0x00ff0000
  13657. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_S 16
  13658. #define HTT_RX_OFLD_PKT_ERR_TID_M 0xff000000
  13659. #define HTT_RX_OFLD_PKT_ERR_TID_S 24
  13660. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_GET(_var) \
  13661. (((_var) & HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_M) \
  13662. >> HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)
  13663. #define HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_SET(_var, _val) \
  13664. do { \
  13665. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE, _val); \
  13666. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MSG_SUB_TYPE_S)); \
  13667. } while (0)
  13668. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_GET(_var) \
  13669. (((_var) & HTT_RX_OFLD_PKT_ERR_VDEV_ID_M) >> HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)
  13670. #define HTT_RX_OFLD_PKT_ERR_VDEV_ID_SET(_var, _val) \
  13671. do { \
  13672. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_VDEV_ID, _val); \
  13673. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_VDEV_ID_S)); \
  13674. } while (0)
  13675. #define HTT_RX_OFLD_PKT_ERR_TID_GET(_var) \
  13676. (((_var) & HTT_RX_OFLD_PKT_ERR_TID_M) >> HTT_RX_OFLD_PKT_ERR_TID_S)
  13677. #define HTT_RX_OFLD_PKT_ERR_TID_SET(_var, _val) \
  13678. do { \
  13679. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_TID, _val); \
  13680. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_TID_S)); \
  13681. } while (0)
  13682. /* definition for HTT_RX_OFLD_PKT_ERR_MIC_ERR msg sub-type payload */
  13683. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_BYTES 28
  13684. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M 0x0000ffff
  13685. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S 0
  13686. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M 0x00ff0000
  13687. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S 16
  13688. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M 0xffffffff
  13689. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S 0
  13690. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M 0x0000ffff
  13691. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S 0
  13692. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M 0xffffffff
  13693. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S 0
  13694. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M 0x0000ffff
  13695. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S 0
  13696. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M 0xffffffff
  13697. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S 0
  13698. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M 0x0000ffff
  13699. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S 0
  13700. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_GET(_var) \
  13701. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_M) >> \
  13702. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)
  13703. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_SET(_var, _val) \
  13704. do { \
  13705. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID, _val); \
  13706. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PEER_ID_S)); \
  13707. } while (0)
  13708. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_GET(_var) \
  13709. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_M) >> \
  13710. HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)
  13711. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_SET(_var, _val) \
  13712. do { \
  13713. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID, _val); \
  13714. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_KEYID_S)); \
  13715. } while (0)
  13716. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_GET(_var) \
  13717. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_M) >> \
  13718. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)
  13719. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_SET(_var, _val) \
  13720. do { \
  13721. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0, _val); \
  13722. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_31_0_S)); \
  13723. } while (0)
  13724. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_GET(_var) \
  13725. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_M) >> \
  13726. HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)
  13727. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_SET(_var, _val) \
  13728. do { \
  13729. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32, _val); \
  13730. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_RA_47_32_S)); \
  13731. } while (0)
  13732. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_GET(_var) \
  13733. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_M) >> \
  13734. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)
  13735. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_SET(_var, _val) \
  13736. do { \
  13737. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0, _val); \
  13738. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_31_0_S)); \
  13739. } while (0)
  13740. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_GET(_var) \
  13741. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_M) >> \
  13742. HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)
  13743. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_SET(_var, _val) \
  13744. do { \
  13745. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32, _val); \
  13746. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_TA_47_32_S)); \
  13747. } while (0)
  13748. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_GET(_var) \
  13749. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_M) >> \
  13750. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)
  13751. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_SET(_var, _val) \
  13752. do { \
  13753. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0, _val); \
  13754. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_31_0_S)); \
  13755. } while (0)
  13756. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_GET(_var) \
  13757. (((_var) & HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_M) >> \
  13758. HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)
  13759. #define HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_SET(_var, _val) \
  13760. do { \
  13761. HTT_CHECK_SET_VAL(HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32, _val); \
  13762. ((_var) |= ((_val) << HTT_RX_OFLD_PKT_ERR_MIC_ERR_PN_47_32_S)); \
  13763. } while (0)
  13764. /**
  13765. * @brief target -> host peer rate report message
  13766. *
  13767. * MSG_TYPE => HTT_T2H_MSG_TYPE_RATE_REPORT
  13768. *
  13769. * @details
  13770. * HTT_T2H_MSG_TYPE_RATE_REPORT message is sent by target to host to indicate the
  13771. * justified rate of all the peers.
  13772. *
  13773. * |31 24|23 16|15 8|7 0|
  13774. * |----------------+----------------+----------------+----------------|
  13775. * | peer_count | | msg_type |
  13776. * |-------------------------------------------------------------------|
  13777. * : Payload (variant number of peer rate report) :
  13778. * :- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -:
  13779. * Header fields:
  13780. * - msg_type
  13781. * Bits 7:0
  13782. * Purpose: Identifies this as HTT_T2H_MSG_TYPE_RATE_REPORT message.
  13783. * value: 0x17 (HTT_T2H_MSG_TYPE_RATE_REPORT)
  13784. * - reserved
  13785. * Bits 15:8
  13786. * Purpose:
  13787. * value:
  13788. * - peer_count
  13789. * Bits 31:16
  13790. * Purpose: Specify how many peer rate report elements are present in the payload.
  13791. * value:
  13792. *
  13793. * Payload:
  13794. * There are variant number of peer rate report follow the first 32 bits.
  13795. * The peer rate report is defined as follows.
  13796. *
  13797. * |31 20|19 16|15 0|
  13798. * |-----------------------+---------+---------------------------------|-
  13799. * | reserved | phy | peer_id | \
  13800. * |-------------------------------------------------------------------| -> report #0
  13801. * | rate | /
  13802. * |-----------------------+---------+---------------------------------|-
  13803. * | reserved | phy | peer_id | \
  13804. * |-------------------------------------------------------------------| -> report #1
  13805. * | rate | /
  13806. * |-----------------------+---------+---------------------------------|-
  13807. * | reserved | phy | peer_id | \
  13808. * |-------------------------------------------------------------------| -> report #2
  13809. * | rate | /
  13810. * |-------------------------------------------------------------------|-
  13811. * : :
  13812. * : :
  13813. * : :
  13814. * :-------------------------------------------------------------------:
  13815. *
  13816. * - peer_id
  13817. * Bits 15:0
  13818. * Purpose: identify the peer
  13819. * value:
  13820. * - phy
  13821. * Bits 19:16
  13822. * Purpose: identify which phy is in use
  13823. * value: 0=11b, 1=11a/g, 2=11n, 3=11ac.
  13824. * Please see enum htt_peer_report_phy_type for detail.
  13825. * - reserved
  13826. * Bits 31:20
  13827. * Purpose:
  13828. * value:
  13829. * - rate
  13830. * Bits 31:0
  13831. * Purpose: represent the justified rate of the peer specified by peer_id
  13832. * value:
  13833. */
  13834. enum htt_peer_rate_report_phy_type {
  13835. HTT_PEER_RATE_REPORT_11B = 0,
  13836. HTT_PEER_RATE_REPORT_11A_G,
  13837. HTT_PEER_RATE_REPORT_11N,
  13838. HTT_PEER_RATE_REPORT_11AC,
  13839. };
  13840. #define HTT_PEER_RATE_REPORT_SIZE 8
  13841. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M 0xffff0000
  13842. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S 16
  13843. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_M 0x0000ffff
  13844. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_S 0
  13845. #define HTT_PEER_RATE_REPORT_MSG_PHY_M 0x000f0000
  13846. #define HTT_PEER_RATE_REPORT_MSG_PHY_S 16
  13847. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_GET(_var) \
  13848. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_M) \
  13849. >> HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)
  13850. #define HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_SET(_var, _val) \
  13851. do { \
  13852. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_COUNT, _val); \
  13853. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_COUNT_S)); \
  13854. } while (0)
  13855. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_GET(_var) \
  13856. (((_var) & HTT_PEER_RATE_REPORT_MSG_PEER_ID_M) \
  13857. >> HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)
  13858. #define HTT_PEER_RATE_REPORT_MSG_PEER_ID_SET(_var, _val) \
  13859. do { \
  13860. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PEER_ID, _val); \
  13861. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PEER_ID_S)); \
  13862. } while (0)
  13863. #define HTT_PEER_RATE_REPORT_MSG_PHY_GET(_var) \
  13864. (((_var) & HTT_PEER_RATE_REPORT_MSG_PHY_M) \
  13865. >> HTT_PEER_RATE_REPORT_MSG_PHY_S)
  13866. #define HTT_PEER_RATE_REPORT_MSG_PHY_SET(_var, _val) \
  13867. do { \
  13868. HTT_CHECK_SET_VAL(HTT_PEER_RATE_REPORT_MSG_PHY, _val); \
  13869. ((_var) |= ((_val) << HTT_PEER_RATE_REPORT_MSG_PHY_S)); \
  13870. } while (0)
  13871. /**
  13872. * @brief target -> host flow pool map message
  13873. *
  13874. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_MAP
  13875. *
  13876. * @details
  13877. * HTT_T2H_MSG_TYPE_FLOW_POOL_MAP message is sent by the target when setting up
  13878. * a flow of descriptors.
  13879. *
  13880. * This message is in TLV format and indicates the parameters to be setup a
  13881. * flow in the host. Each entry indicates that a particular flow ID is ready to
  13882. * receive descriptors from a specified pool.
  13883. *
  13884. * The message would appear as follows:
  13885. *
  13886. * |31 24|23 16|15 8|7 0|
  13887. * |----------------+----------------+----------------+----------------|
  13888. * header | reserved | num_flows | msg_type |
  13889. * |-------------------------------------------------------------------|
  13890. * | |
  13891. * : payload :
  13892. * | |
  13893. * |-------------------------------------------------------------------|
  13894. *
  13895. * The header field is one DWORD long and is interpreted as follows:
  13896. * b'0:7 - msg_type: Set to 0x18 (HTT_T2H_MSG_TYPE_FLOW_POOL_MAP)
  13897. * b'8-15 - num_flows: This will indicate the number of flows being setup in
  13898. * this message
  13899. * b'16-31 - reserved: These bits are reserved for future use
  13900. *
  13901. * Payload:
  13902. * The payload would contain multiple objects of the following structure. Each
  13903. * object represents a flow.
  13904. *
  13905. * |31 24|23 16|15 8|7 0|
  13906. * |----------------+----------------+----------------+----------------|
  13907. * header | reserved | num_flows | msg_type |
  13908. * |-------------------------------------------------------------------|
  13909. * payload0| flow_type |
  13910. * |-------------------------------------------------------------------|
  13911. * | flow_id |
  13912. * |-------------------------------------------------------------------|
  13913. * | reserved0 | flow_pool_id |
  13914. * |-------------------------------------------------------------------|
  13915. * | reserved1 | flow_pool_size |
  13916. * |-------------------------------------------------------------------|
  13917. * | reserved2 |
  13918. * |-------------------------------------------------------------------|
  13919. * payload1| flow_type |
  13920. * |-------------------------------------------------------------------|
  13921. * | flow_id |
  13922. * |-------------------------------------------------------------------|
  13923. * | reserved0 | flow_pool_id |
  13924. * |-------------------------------------------------------------------|
  13925. * | reserved1 | flow_pool_size |
  13926. * |-------------------------------------------------------------------|
  13927. * | reserved2 |
  13928. * |-------------------------------------------------------------------|
  13929. * | . |
  13930. * | . |
  13931. * | . |
  13932. * |-------------------------------------------------------------------|
  13933. *
  13934. * Each payload is 5 DWORDS long and is interpreted as follows:
  13935. * dword0 - b'0:31 - flow_type: This indicates the type of the entity to which
  13936. * this flow is associated. It can be VDEV, peer,
  13937. * or tid (AC). Based on enum htt_flow_type.
  13938. *
  13939. * dword1 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  13940. * object. For flow_type vdev it is set to the
  13941. * vdevid, for peer it is peerid and for tid, it is
  13942. * tid_num.
  13943. *
  13944. * dword2 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being used
  13945. * in the host for this flow
  13946. * b'16:31 - reserved0: This field in reserved for the future. In case
  13947. * we have a hierarchical implementation (HCM) of
  13948. * pools, it can be used to indicate the ID of the
  13949. * parent-pool.
  13950. *
  13951. * dword3 - b'0:15 - flow_pool_size: Size of the pool in number of descriptors.
  13952. * Descriptors for this flow will be
  13953. * allocated from this pool in the host.
  13954. * b'16:31 - reserved1: This field in reserved for the future. In case
  13955. * we have a hierarchical implementation of pools,
  13956. * it can be used to indicate the max number of
  13957. * descriptors in the pool. The b'0:15 can be used
  13958. * to indicate min number of descriptors in the
  13959. * HCM scheme.
  13960. *
  13961. * dword4 - b'0:31 - reserved2: This field in reserved for the future. In case
  13962. * we have a hierarchical implementation of pools,
  13963. * b'0:15 can be used to indicate the
  13964. * priority-based borrowing (PBB) threshold of
  13965. * the flow's pool. The b'16:31 are still left
  13966. * reserved.
  13967. */
  13968. enum htt_flow_type {
  13969. FLOW_TYPE_VDEV = 0,
  13970. /* Insert new flow types above this line */
  13971. };
  13972. PREPACK struct htt_flow_pool_map_payload_t {
  13973. A_UINT32 flow_type;
  13974. A_UINT32 flow_id;
  13975. A_UINT32 flow_pool_id:16,
  13976. reserved0:16;
  13977. A_UINT32 flow_pool_size:16,
  13978. reserved1:16;
  13979. A_UINT32 reserved2;
  13980. } POSTPACK;
  13981. #define HTT_FLOW_POOL_MAP_HEADER_SZ (sizeof(A_UINT32))
  13982. #define HTT_FLOW_POOL_MAP_PAYLOAD_SZ \
  13983. (sizeof(struct htt_flow_pool_map_payload_t))
  13984. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_M 0x0000ff00
  13985. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_S 8
  13986. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_M 0xffffffff
  13987. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_S 0
  13988. #define HTT_FLOW_POOL_MAP_FLOW_ID_M 0xffffffff
  13989. #define HTT_FLOW_POOL_MAP_FLOW_ID_S 0
  13990. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M 0x0000ffff
  13991. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S 0
  13992. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M 0x0000ffff
  13993. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S 0
  13994. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_GET(_var) \
  13995. (((_var) & HTT_FLOW_POOL_MAP_NUM_FLOWS_M) >> HTT_FLOW_POOL_MAP_NUM_FLOWS_S)
  13996. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_GET(_var) \
  13997. (((_var) & HTT_FLOW_POOL_MAP_FLOW_TYPE_M) >> HTT_FLOW_POOL_MAP_FLOW_TYPE_S)
  13998. #define HTT_FLOW_POOL_MAP_FLOW_ID_GET(_var) \
  13999. (((_var) & HTT_FLOW_POOL_MAP_FLOW_ID_M) >> HTT_FLOW_POOL_MAP_FLOW_ID_S)
  14000. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_GET(_var) \
  14001. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_ID_M) >> \
  14002. HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)
  14003. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_GET(_var) \
  14004. (((_var) & HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_M) >> \
  14005. HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)
  14006. #define HTT_FLOW_POOL_MAP_NUM_FLOWS_SET(_var, _val) \
  14007. do { \
  14008. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_NUM_FLOWS, _val); \
  14009. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_NUM_FLOWS_S)); \
  14010. } while (0)
  14011. #define HTT_FLOW_POOL_MAP_FLOW_TYPE_SET(_var, _val) \
  14012. do { \
  14013. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_TYPE, _val); \
  14014. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_TYPE_S)); \
  14015. } while (0)
  14016. #define HTT_FLOW_POOL_MAP_FLOW_ID_SET(_var, _val) \
  14017. do { \
  14018. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_ID, _val); \
  14019. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_ID_S)); \
  14020. } while (0)
  14021. #define HTT_FLOW_POOL_MAP_FLOW_POOL_ID_SET(_var, _val) \
  14022. do { \
  14023. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_ID, _val); \
  14024. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_ID_S)); \
  14025. } while (0)
  14026. #define HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_SET(_var, _val) \
  14027. do { \
  14028. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE, _val); \
  14029. ((_var) |= ((_val) << HTT_FLOW_POOL_MAP_FLOW_POOL_SIZE_S)); \
  14030. } while (0)
  14031. /**
  14032. * @brief target -> host flow pool unmap message
  14033. *
  14034. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP
  14035. *
  14036. * @details
  14037. * HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP message is sent by the target when tearing
  14038. * down a flow of descriptors.
  14039. * This message indicates that for the flow (whose ID is provided) is wanting
  14040. * to stop receiving descriptors. This flow ID corresponds to the ID of the
  14041. * pool of descriptors from where descriptors are being allocated for this
  14042. * flow. When a flow (and its pool) are unmapped, all the child-pools will also
  14043. * be unmapped by the host.
  14044. *
  14045. * The message would appear as follows:
  14046. *
  14047. * |31 24|23 16|15 8|7 0|
  14048. * |----------------+----------------+----------------+----------------|
  14049. * | reserved0 | msg_type |
  14050. * |-------------------------------------------------------------------|
  14051. * | flow_type |
  14052. * |-------------------------------------------------------------------|
  14053. * | flow_id |
  14054. * |-------------------------------------------------------------------|
  14055. * | reserved1 | flow_pool_id |
  14056. * |-------------------------------------------------------------------|
  14057. *
  14058. * The message is interpreted as follows:
  14059. * dword0 - b'0:7 - msg_type: This will be set to 0x19
  14060. * (HTT_T2H_MSG_TYPE_FLOW_POOL_UNMAP)
  14061. * b'8:31 - reserved0: Reserved for future use
  14062. *
  14063. * dword1 - b'0:31 - flow_type: This indicates the type of the entity to which
  14064. * this flow is associated. It can be VDEV, peer,
  14065. * or tid (AC). Based on enum htt_flow_type.
  14066. *
  14067. * dword2 - b'0:31 - flow_id: Identifier for the flow corresponding to this
  14068. * object. For flow_type vdev it is set to the
  14069. * vdevid, for peer it is peerid and for tid, it is
  14070. * tid_num.
  14071. *
  14072. * dword3 - b'0:15 - flow_pool_id: Identifier of the descriptor-pool being
  14073. * used in the host for this flow
  14074. * b'16:31 - reserved0: This field in reserved for the future.
  14075. *
  14076. */
  14077. PREPACK struct htt_flow_pool_unmap_t {
  14078. A_UINT32 msg_type:8,
  14079. reserved0:24;
  14080. A_UINT32 flow_type;
  14081. A_UINT32 flow_id;
  14082. A_UINT32 flow_pool_id:16,
  14083. reserved1:16;
  14084. } POSTPACK;
  14085. #define HTT_FLOW_POOL_UNMAP_SZ (sizeof(struct htt_flow_pool_unmap_t))
  14086. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M 0xffffffff
  14087. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S 0
  14088. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_M 0xffffffff
  14089. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_S 0
  14090. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M 0x0000ffff
  14091. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S 0
  14092. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_GET(_var) \
  14093. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_TYPE_M) >> \
  14094. HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)
  14095. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_GET(_var) \
  14096. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_ID_M) >> HTT_FLOW_POOL_UNMAP_FLOW_ID_S)
  14097. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_GET(_var) \
  14098. (((_var) & HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_M) >> \
  14099. HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)
  14100. #define HTT_FLOW_POOL_UNMAP_FLOW_TYPE_SET(_var, _val) \
  14101. do { \
  14102. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_TYPE, _val); \
  14103. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_TYPE_S)); \
  14104. } while (0)
  14105. #define HTT_FLOW_POOL_UNMAP_FLOW_ID_SET(_var, _val) \
  14106. do { \
  14107. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_ID, _val); \
  14108. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_ID_S)); \
  14109. } while (0)
  14110. #define HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_SET(_var, _val) \
  14111. do { \
  14112. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID, _val); \
  14113. ((_var) |= ((_val) << HTT_FLOW_POOL_UNMAP_FLOW_POOL_ID_S)); \
  14114. } while (0)
  14115. /**
  14116. * @brief target -> host SRING setup done message
  14117. *
  14118. * MSG_TYPE => HTT_T2H_MSG_TYPE_SRING_SETUP_DONE
  14119. *
  14120. * @details
  14121. * HTT_T2H_MSG_TYPE_SRING_SETUP_DONE message is sent by the target when
  14122. * SRNG ring setup is done
  14123. *
  14124. * This message indicates whether the last setup operation is successful.
  14125. * It will be sent to host when host set respose_required bit in
  14126. * HTT_H2T_MSG_TYPE_SRING_SETUP.
  14127. * The message would appear as follows:
  14128. *
  14129. * |31 24|23 16|15 8|7 0|
  14130. * |--------------- +----------------+----------------+----------------|
  14131. * | setup_status | ring_id | pdev_id | msg_type |
  14132. * |-------------------------------------------------------------------|
  14133. *
  14134. * The message is interpreted as follows:
  14135. * dword0 - b'0:7 - msg_type: This will be set to 0x1a
  14136. * (HTT_T2H_MSG_TYPE_SRING_SETUP_DONE)
  14137. * b'8:15 - pdev_id:
  14138. * 0 (for rings at SOC/UMAC level),
  14139. * 1/2/3 mac id (for rings at LMAC level)
  14140. * b'16:23 - ring_id: Identify the ring which is set up
  14141. * More details can be got from enum htt_srng_ring_id
  14142. * b'24:31 - setup_status: Indicate status of setup operation
  14143. * Refer to htt_ring_setup_status
  14144. */
  14145. PREPACK struct htt_sring_setup_done_t {
  14146. A_UINT32 msg_type: 8,
  14147. pdev_id: 8,
  14148. ring_id: 8,
  14149. setup_status: 8;
  14150. } POSTPACK;
  14151. enum htt_ring_setup_status {
  14152. htt_ring_setup_status_ok = 0,
  14153. htt_ring_setup_status_error,
  14154. };
  14155. #define HTT_SRING_SETUP_DONE_SZ (sizeof(struct htt_sring_setup_done_t))
  14156. #define HTT_SRING_SETUP_DONE_PDEV_ID_M 0x0000ff00
  14157. #define HTT_SRING_SETUP_DONE_PDEV_ID_S 8
  14158. #define HTT_SRING_SETUP_DONE_PDEV_ID_GET(_var) \
  14159. (((_var) & HTT_SRING_SETUP_DONE_PDEV_ID_M) >> \
  14160. HTT_SRING_SETUP_DONE_PDEV_ID_S)
  14161. #define HTT_SRING_SETUP_DONE_PDEV_ID_SET(_var, _val) \
  14162. do { \
  14163. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_PDEV_ID, _val); \
  14164. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  14165. } while (0)
  14166. #define HTT_SRING_SETUP_DONE_RING_ID_M 0x00ff0000
  14167. #define HTT_SRING_SETUP_DONE_RING_ID_S 16
  14168. #define HTT_SRING_SETUP_DONE_RING_ID_GET(_var) \
  14169. (((_var) & HTT_SRING_SETUP_DONE_RING_ID_M) >> \
  14170. HTT_SRING_SETUP_DONE_RING_ID_S)
  14171. #define HTT_SRING_SETUP_DONE_RING_ID_SET(_var, _val) \
  14172. do { \
  14173. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_RING_ID, _val); \
  14174. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_RING_ID_S)); \
  14175. } while (0)
  14176. #define HTT_SRING_SETUP_DONE_STATUS_M 0xff000000
  14177. #define HTT_SRING_SETUP_DONE_STATUS_S 24
  14178. #define HTT_SRING_SETUP_DONE_STATUS_GET(_var) \
  14179. (((_var) & HTT_SRING_SETUP_DONE_STATUS_M) >> \
  14180. HTT_SRING_SETUP_DONE_STATUS_S)
  14181. #define HTT_SRING_SETUP_DONE_STATUS_SET(_var, _val) \
  14182. do { \
  14183. HTT_CHECK_SET_VAL(HTT_SRING_SETUP_DONE_STATUS, _val); \
  14184. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_STATUS_S)); \
  14185. } while (0)
  14186. /**
  14187. * @brief target -> flow map flow info
  14188. *
  14189. * MSG_TYPE => HTT_T2H_MSG_TYPE_MAP_FLOW_INFO
  14190. *
  14191. * @details
  14192. * HTT TX map flow entry with tqm flow pointer
  14193. * Sent from firmware to host to add tqm flow pointer in corresponding
  14194. * flow search entry. Flow metadata is replayed back to host as part of this
  14195. * struct to enable host to find the specific flow search entry
  14196. *
  14197. * The message would appear as follows:
  14198. *
  14199. * |31 28|27 18|17 14|13 8|7 0|
  14200. * |-------+------------------------------------------+----------------|
  14201. * | rsvd0 | fse_hsh_idx | msg_type |
  14202. * |-------------------------------------------------------------------|
  14203. * | rsvd1 | tid | peer_id |
  14204. * |-------------------------------------------------------------------|
  14205. * | tqm_flow_pntr_lo |
  14206. * |-------------------------------------------------------------------|
  14207. * | tqm_flow_pntr_hi |
  14208. * |-------------------------------------------------------------------|
  14209. * | fse_meta_data |
  14210. * |-------------------------------------------------------------------|
  14211. *
  14212. * The message is interpreted as follows:
  14213. *
  14214. * dword0 - b'0:7 - msg_type: This will be set to 0x1b
  14215. * (HTT_T2H_MSG_TYPE_MAP_FLOW_INFO)
  14216. *
  14217. * dword0 - b'8:27 - fse_hsh_idx: Flow search table index provided by host
  14218. * for this flow entry
  14219. *
  14220. * dword0 - b'28:31 - rsvd0: Reserved for future use
  14221. *
  14222. * dword1 - b'0:13 - peer_id: Software peer id given by host during association
  14223. *
  14224. * dword1 - b'14:17 - tid
  14225. *
  14226. * dword1 - b'18:31 - rsvd1: Reserved for future use
  14227. *
  14228. * dword2 - b'0:31 - tqm_flow_pntr_lo: Lower 32 bits of TQM flow pointer
  14229. *
  14230. * dword3 - b'0:31 - tqm_flow_pntr_hi: Higher 32 bits of TQM flow pointer
  14231. *
  14232. * dword4 - b'0:31 - fse_meta_data: Replay back TX flow search metadata
  14233. * given by host
  14234. */
  14235. PREPACK struct htt_tx_map_flow_info {
  14236. A_UINT32
  14237. msg_type: 8,
  14238. fse_hsh_idx: 20,
  14239. rsvd0: 4;
  14240. A_UINT32
  14241. peer_id: 14,
  14242. tid: 4,
  14243. rsvd1: 14;
  14244. A_UINT32 tqm_flow_pntr_lo;
  14245. A_UINT32 tqm_flow_pntr_hi;
  14246. struct htt_tx_flow_metadata fse_meta_data;
  14247. } POSTPACK;
  14248. /* DWORD 0 */
  14249. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M 0x0fffff00
  14250. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S 8
  14251. /* DWORD 1 */
  14252. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_M 0x00003fff
  14253. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_S 0
  14254. #define HTT_TX_MAP_FLOW_INFO_TID_M 0x0003c000
  14255. #define HTT_TX_MAP_FLOW_INFO_TID_S 14
  14256. /* DWORD 0 */
  14257. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_GET(_var) \
  14258. (((_var) & HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_M) >> \
  14259. HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)
  14260. #define HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_SET(_var, _val) \
  14261. do { \
  14262. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX, _val); \
  14263. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_FSE_HSH_IDX_S)); \
  14264. } while (0)
  14265. /* DWORD 1 */
  14266. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_GET(_var) \
  14267. (((_var) & HTT_TX_MAP_FLOW_INFO_PEER_ID_M) >> \
  14268. HTT_TX_MAP_FLOW_INFO_PEER_ID_S)
  14269. #define HTT_TX_MAP_FLOW_INFO_PEER_ID_SET(_var, _val) \
  14270. do { \
  14271. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_PEER_ID_IDX, _val); \
  14272. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_PEER_ID_S)); \
  14273. } while (0)
  14274. #define HTT_TX_MAP_FLOW_INFO_TID_GET(_var) \
  14275. (((_var) & HTT_TX_MAP_FLOW_INFO_TID_M) >> \
  14276. HTT_TX_MAP_FLOW_INFO_TID_S)
  14277. #define HTT_TX_MAP_FLOW_INFO_TID_SET(_var, _val) \
  14278. do { \
  14279. HTT_CHECK_SET_VAL(HTT_TX_MAP_FLOW_INFO_TID_IDX, _val); \
  14280. ((_var) |= ((_val) << HTT_TX_MAP_FLOW_INFO_TID_S)); \
  14281. } while (0)
  14282. /*
  14283. * htt_dbg_ext_stats_status -
  14284. * present - The requested stats have been delivered in full.
  14285. * This indicates that either the stats information was contained
  14286. * in its entirety within this message, or else this message
  14287. * completes the delivery of the requested stats info that was
  14288. * partially delivered through earlier STATS_CONF messages.
  14289. * partial - The requested stats have been delivered in part.
  14290. * One or more subsequent STATS_CONF messages with the same
  14291. * cookie value will be sent to deliver the remainder of the
  14292. * information.
  14293. * error - The requested stats could not be delivered, for example due
  14294. * to a shortage of memory to construct a message holding the
  14295. * requested stats.
  14296. * invalid - The requested stat type is either not recognized, or the
  14297. * target is configured to not gather the stats type in question.
  14298. */
  14299. enum htt_dbg_ext_stats_status {
  14300. HTT_DBG_EXT_STATS_STATUS_PRESENT = 0,
  14301. HTT_DBG_EXT_STATS_STATUS_PARTIAL = 1,
  14302. HTT_DBG_EXT_STATS_STATUS_ERROR = 2,
  14303. HTT_DBG_EXT_STATS_STATUS_INVALID = 3,
  14304. };
  14305. /**
  14306. * @brief target -> host ppdu stats upload
  14307. *
  14308. * MSG_TYPE => HTT_T2H_MSG_TYPE_PPDU_STATS_IND
  14309. *
  14310. * @details
  14311. * The following field definitions describe the format of the HTT target
  14312. * to host ppdu stats indication message.
  14313. *
  14314. *
  14315. * |31 16|15 12|11 10|9 8|7 0 |
  14316. * |----------------------------------------------------------------------|
  14317. * | payload_size | rsvd |pdev_id|mac_id | msg type |
  14318. * |----------------------------------------------------------------------|
  14319. * | ppdu_id |
  14320. * |----------------------------------------------------------------------|
  14321. * | Timestamp in us |
  14322. * |----------------------------------------------------------------------|
  14323. * | reserved |
  14324. * |----------------------------------------------------------------------|
  14325. * | type-specific stats info |
  14326. * | (see htt_ppdu_stats.h) |
  14327. * |----------------------------------------------------------------------|
  14328. * Header fields:
  14329. * - MSG_TYPE
  14330. * Bits 7:0
  14331. * Purpose: Identifies this is a PPDU STATS indication
  14332. * message.
  14333. * Value: 0x1d (HTT_T2H_MSG_TYPE_PPDU_STATS_IND)
  14334. * - mac_id
  14335. * Bits 9:8
  14336. * Purpose: mac_id of this ppdu_id
  14337. * Value: 0-3
  14338. * - pdev_id
  14339. * Bits 11:10
  14340. * Purpose: pdev_id of this ppdu_id
  14341. * Value: 0-3
  14342. * 0 (for rings at SOC level),
  14343. * 1/2/3 PDEV -> 0/1/2
  14344. * - payload_size
  14345. * Bits 31:16
  14346. * Purpose: total tlv size
  14347. * Value: payload_size in bytes
  14348. */
  14349. #define HTT_T2H_PPDU_STATS_IND_HDR_SIZE 16
  14350. #define HTT_T2H_PPDU_STATS_MAC_ID_M 0x00000300
  14351. #define HTT_T2H_PPDU_STATS_MAC_ID_S 8
  14352. #define HTT_T2H_PPDU_STATS_PDEV_ID_M 0x00000C00
  14353. #define HTT_T2H_PPDU_STATS_PDEV_ID_S 10
  14354. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M 0xFFFF0000
  14355. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S 16
  14356. #define HTT_T2H_PPDU_STATS_PPDU_ID_M 0xFFFFFFFF
  14357. #define HTT_T2H_PPDU_STATS_PPDU_ID_S 0
  14358. #define HTT_T2H_PPDU_STATS_MAC_ID_SET(word, value) \
  14359. do { \
  14360. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_MAC_ID, value); \
  14361. (word) |= (value) << HTT_T2H_PPDU_STATS_MAC_ID_S; \
  14362. } while (0)
  14363. #define HTT_T2H_PPDU_STATS_MAC_ID_GET(word) \
  14364. (((word) & HTT_T2H_PPDU_STATS_MAC_ID_M) >> \
  14365. HTT_T2H_PPDU_STATS_MAC_ID_S)
  14366. #define HTT_T2H_PPDU_STATS_PDEV_ID_SET(word, value) \
  14367. do { \
  14368. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PDEV_ID, value); \
  14369. (word) |= (value) << HTT_T2H_PPDU_STATS_PDEV_ID_S; \
  14370. } while (0)
  14371. #define HTT_T2H_PPDU_STATS_PDEV_ID_GET(word) \
  14372. (((word) & HTT_T2H_PPDU_STATS_PDEV_ID_M) >> \
  14373. HTT_T2H_PPDU_STATS_PDEV_ID_S)
  14374. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_SET(word, value) \
  14375. do { \
  14376. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PAYLOAD_SIZE, value); \
  14377. (word) |= (value) << HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S; \
  14378. } while (0)
  14379. #define HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_GET(word) \
  14380. (((word) & HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_M) >> \
  14381. HTT_T2H_PPDU_STATS_PAYLOAD_SIZE_S)
  14382. #define HTT_T2H_PPDU_STATS_PPDU_ID_SET(word, value) \
  14383. do { \
  14384. HTT_CHECK_SET_VAL(HTT_T2H_PPDU_STATS_PPDU_ID, value); \
  14385. (word) |= (value) << HTT_T2H_PPDU_STATS_PPDU_ID_S; \
  14386. } while (0)
  14387. #define HTT_T2H_PPDU_STATS_PPDU_ID_GET(word) \
  14388. (((word) & HTT_T2H_PPDU_STATS_PPDU_ID_M) >> \
  14389. HTT_T2H_PPDU_STATS_PPDU_ID_S)
  14390. /* htt_t2h_ppdu_stats_ind_hdr_t
  14391. * This struct contains the fields within the header of the
  14392. * HTT_T2H_PPDU_STATS_IND message, preceding the type-specific
  14393. * stats info.
  14394. * This struct assumes little-endian layout, and thus is only
  14395. * suitable for use within processors known to be little-endian
  14396. * (such as the target).
  14397. * In contrast, the above macros provide endian-portable methods
  14398. * to get and set the bitfields within this PPDU_STATS_IND header.
  14399. */
  14400. typedef struct {
  14401. A_UINT32 msg_type: 8, /* bits 7:0 */
  14402. mac_id: 2, /* bits 9:8 */
  14403. pdev_id: 2, /* bits 11:10 */
  14404. reserved1: 4, /* bits 15:12 */
  14405. payload_size: 16; /* bits 31:16 */
  14406. A_UINT32 ppdu_id;
  14407. A_UINT32 timestamp_us;
  14408. A_UINT32 reserved2;
  14409. } htt_t2h_ppdu_stats_ind_hdr_t;
  14410. /**
  14411. * @brief target -> host extended statistics upload
  14412. *
  14413. * MSG_TYPE => HTT_T2H_MSG_TYPE_EXT_STATS_CONF
  14414. *
  14415. * @details
  14416. * The following field definitions describe the format of the HTT target
  14417. * to host stats upload confirmation message.
  14418. * The message contains a cookie echoed from the HTT host->target stats
  14419. * upload request, which identifies which request the confirmation is
  14420. * for, and a single stats can span over multiple HTT stats indication
  14421. * due to the HTT message size limitation so every HTT ext stats indication
  14422. * will have tag-length-value stats information elements.
  14423. * The tag-length header for each HTT stats IND message also includes a
  14424. * status field, to indicate whether the request for the stat type in
  14425. * question was fully met, partially met, unable to be met, or invalid
  14426. * (if the stat type in question is disabled in the target).
  14427. * A Done bit 1's indicate the end of the of stats info elements.
  14428. *
  14429. *
  14430. * |31 16|15 12|11|10 8|7 5|4 0|
  14431. * |--------------------------------------------------------------|
  14432. * | reserved | msg type |
  14433. * |--------------------------------------------------------------|
  14434. * | cookie LSBs |
  14435. * |--------------------------------------------------------------|
  14436. * | cookie MSBs |
  14437. * |--------------------------------------------------------------|
  14438. * | stats entry length | rsvd | D| S | stat type |
  14439. * |--------------------------------------------------------------|
  14440. * | type-specific stats info |
  14441. * | (see htt_stats.h) |
  14442. * |--------------------------------------------------------------|
  14443. * Header fields:
  14444. * - MSG_TYPE
  14445. * Bits 7:0
  14446. * Purpose: Identifies this is a extended statistics upload confirmation
  14447. * message.
  14448. * Value: 0x1c (HTT_T2H_MSG_TYPE_EXT_STATS_CONF)
  14449. * - COOKIE_LSBS
  14450. * Bits 31:0
  14451. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14452. * message with its preceding host->target stats request message.
  14453. * Value: LSBs of the opaque cookie specified by the host-side requestor
  14454. * - COOKIE_MSBS
  14455. * Bits 31:0
  14456. * Purpose: Provide a mechanism to match a target->host stats confirmation
  14457. * message with its preceding host->target stats request message.
  14458. * Value: MSBs of the opaque cookie specified by the host-side requestor
  14459. *
  14460. * Stats Information Element tag-length header fields:
  14461. * - STAT_TYPE
  14462. * Bits 7:0
  14463. * Purpose: identifies the type of statistics info held in the
  14464. * following information element
  14465. * Value: htt_dbg_ext_stats_type
  14466. * - STATUS
  14467. * Bits 10:8
  14468. * Purpose: indicate whether the requested stats are present
  14469. * Value: htt_dbg_ext_stats_status
  14470. * - DONE
  14471. * Bits 11
  14472. * Purpose:
  14473. * Indicates the completion of the stats entry, this will be the last
  14474. * stats conf HTT segment for the requested stats type.
  14475. * Value:
  14476. * 0 -> the stats retrieval is ongoing
  14477. * 1 -> the stats retrieval is complete
  14478. * - LENGTH
  14479. * Bits 31:16
  14480. * Purpose: indicate the stats information size
  14481. * Value: This field specifies the number of bytes of stats information
  14482. * that follows the element tag-length header.
  14483. * It is expected but not required that this length is a multiple of
  14484. * 4 bytes.
  14485. */
  14486. #define HTT_T2H_EXT_STATS_COOKIE_SIZE 8
  14487. #define HTT_T2H_EXT_STATS_CONF_HDR_SIZE 4
  14488. #define HTT_T2H_EXT_STATS_CONF_TLV_HDR_SIZE 4
  14489. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M 0x000000ff
  14490. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S 0
  14491. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M 0x00000700
  14492. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S 8
  14493. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_M 0x00000800
  14494. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_S 11
  14495. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M 0xffff0000
  14496. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S 16
  14497. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_SET(word, value) \
  14498. do { \
  14499. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_TYPE, value); \
  14500. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S; \
  14501. } while (0)
  14502. #define HTT_T2H_EXT_STATS_CONF_TLV_TYPE_GET(word) \
  14503. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_TYPE_M) >> \
  14504. HTT_T2H_EXT_STATS_CONF_TLV_TYPE_S)
  14505. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_SET(word, value) \
  14506. do { \
  14507. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_STATUS, value); \
  14508. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S; \
  14509. } while (0)
  14510. #define HTT_T2H_EXT_STATS_CONF_TLV_STATUS_GET(word) \
  14511. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_STATUS_M) >> \
  14512. HTT_T2H_EXT_STATS_CONF_TLV_STATUS_S)
  14513. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_SET(word, value) \
  14514. do { \
  14515. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_DONE, value); \
  14516. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_DONE_S; \
  14517. } while (0)
  14518. #define HTT_T2H_EXT_STATS_CONF_TLV_DONE_GET(word) \
  14519. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_DONE_M) >> \
  14520. HTT_T2H_EXT_STATS_CONF_TLV_DONE_S)
  14521. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_SET(word, value) \
  14522. do { \
  14523. HTT_CHECK_SET_VAL(HTT_T2H_EXT_STATS_CONF_TLV_LENGTH, value); \
  14524. (word) |= (value) << HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S; \
  14525. } while (0)
  14526. #define HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_GET(word) \
  14527. (((word) & HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_M) >> \
  14528. HTT_T2H_EXT_STATS_CONF_TLV_LENGTH_S)
  14529. /**
  14530. * @brief target -> host streaming statistics upload
  14531. *
  14532. * MSG_TYPE => HTT_T2H_MSG_TYPE_STREAMING_STATS_IND
  14533. *
  14534. * @details
  14535. * The following field definitions describe the format of the HTT target
  14536. * to host streaming stats upload indication message.
  14537. * The host can use a STREAMING_STATS_REQ message to enable the target to
  14538. * produce an ongoing series of STREAMING_STATS_IND messages, and can also
  14539. * use the STREAMING_STATS_REQ message to halt the target's production of
  14540. * STREAMING_STATS_IND messages.
  14541. * The STREAMING_STATS_IND message contains a payload of TLVs containing
  14542. * the stats enabled by the host's STREAMING_STATS_REQ message.
  14543. *
  14544. * |31 8|7 0|
  14545. * |--------------------------------------------------------------|
  14546. * | reserved | msg type |
  14547. * |--------------------------------------------------------------|
  14548. * | type-specific stats info |
  14549. * | (see htt_stats.h) |
  14550. * |--------------------------------------------------------------|
  14551. * Header fields:
  14552. * - MSG_TYPE
  14553. * Bits 7:0
  14554. * Purpose: Identifies this as a streaming statistics upload indication
  14555. * message.
  14556. * Value: 0x2f (HTT_T2H_MSG_TYPE_STREAMING_STATS_IND)
  14557. */
  14558. #define HTT_T2H_STREAMING_STATS_IND_HDR_SIZE 4
  14559. typedef enum {
  14560. HTT_PEER_TYPE_DEFAULT = 0, /* Generic/Non-BSS/Self Peer */
  14561. HTT_PEER_TYPE_BSS = 1, /* Peer is BSS Peer entry */
  14562. HTT_PEER_TYPE_TDLS = 2, /* Peer is a TDLS Peer */
  14563. HTT_PEER_TYPE_OCB = 3, /* Peer is a OCB Peer */
  14564. HTT_PEER_TYPE_NAN_DATA = 4, /* Peer is NAN DATA */
  14565. HTT_PEER_TYPE_HOST_MAX = 127, /* Host <-> Target Peer type is assigned up to 127 */
  14566. /* Reserved from 128 - 255 for target internal use.*/
  14567. HTT_PEER_TYPE_ROAMOFFLOAD_TEMP = 128, /* Temporarily created during offload roam */
  14568. } HTT_PEER_TYPE;
  14569. /** macro to convert MAC address from char array to HTT word format */
  14570. #define HTT_CHAR_ARRAY_TO_MAC_ADDR(c_macaddr, phtt_mac_addr) do { \
  14571. (phtt_mac_addr)->mac_addr31to0 = \
  14572. (((c_macaddr)[0] << 0) | \
  14573. ((c_macaddr)[1] << 8) | \
  14574. ((c_macaddr)[2] << 16) | \
  14575. ((c_macaddr)[3] << 24)); \
  14576. (phtt_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\
  14577. } while (0)
  14578. /**
  14579. * @brief target -> host monitor mac header indication message
  14580. *
  14581. * MSG_TYPE => HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND
  14582. *
  14583. * @details
  14584. * The following diagram shows the format of the monitor mac header message
  14585. * sent from the target to the host.
  14586. * This message is primarily sent when promiscuous rx mode is enabled.
  14587. * One message is sent per rx PPDU.
  14588. *
  14589. * |31 24|23 16|15 8|7 0|
  14590. * |-------------------------------------------------------------|
  14591. * | peer_id | reserved0 | msg_type |
  14592. * |-------------------------------------------------------------|
  14593. * | reserved1 | num_mpdu |
  14594. * |-------------------------------------------------------------|
  14595. * | struct hw_rx_desc |
  14596. * | (see wal_rx_desc.h) |
  14597. * |-------------------------------------------------------------|
  14598. * | struct ieee80211_frame_addr4 |
  14599. * | (see ieee80211_defs.h) |
  14600. * |-------------------------------------------------------------|
  14601. * | struct ieee80211_frame_addr4 |
  14602. * | (see ieee80211_defs.h) |
  14603. * |-------------------------------------------------------------|
  14604. * | ...... |
  14605. * |-------------------------------------------------------------|
  14606. *
  14607. * Header fields:
  14608. * - msg_type
  14609. * Bits 7:0
  14610. * Purpose: Identifies this is a monitor mac header indication message.
  14611. * Value: 0x20 (HTT_T2H_MSG_TYPE_MONITOR_MAC_HEADER_IND)
  14612. * - peer_id
  14613. * Bits 31:16
  14614. * Purpose: Software peer id given by host during association,
  14615. * During promiscuous mode, the peer ID will be invalid (0xFF)
  14616. * for rx PPDUs received from unassociated peers.
  14617. * Value: peer ID (for associated peers) or 0xFF (for unassociated peers)
  14618. * - num_mpdu
  14619. * Bits 15:0
  14620. * Purpose: The number of MPDU frame headers (struct ieee80211_frame_addr4)
  14621. * delivered within the message.
  14622. * Value: 1 to 32
  14623. * num_mpdu is limited to a maximum value of 32, due to buffer
  14624. * size limits. For PPDUs with more than 32 MPDUs, only the
  14625. * ieee80211_frame_addr4 headers from the first 32 MPDUs within
  14626. * the PPDU will be provided.
  14627. */
  14628. #define HTT_T2H_MONITOR_MAC_HEADER_IND_HDR_SIZE 8
  14629. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M 0xFFFF0000
  14630. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S 16
  14631. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M 0x0000FFFF
  14632. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S 0
  14633. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_SET(word, value) \
  14634. do { \
  14635. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_PEER_ID, value); \
  14636. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S; \
  14637. } while (0)
  14638. #define HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_GET(word) \
  14639. (((word) & HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_M) >> \
  14640. HTT_T2H_MONITOR_MAC_HEADER_PEER_ID_S)
  14641. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_SET(word, value) \
  14642. do { \
  14643. HTT_CHECK_SET_VAL(HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU, value); \
  14644. (word) |= (value) << HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S; \
  14645. } while (0)
  14646. #define HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_GET(word) \
  14647. (((word) & HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_M) >> \
  14648. HTT_T2H_MONITOR_MAC_HEADER_NUM_MPDU_S)
  14649. /**
  14650. * @brief target -> host flow pool resize Message
  14651. *
  14652. * MSG_TYPE => HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE
  14653. *
  14654. * @details
  14655. * HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE message is sent by the target when
  14656. * the flow pool associated with the specified ID is resized
  14657. *
  14658. * The message would appear as follows:
  14659. *
  14660. * |31 16|15 8|7 0|
  14661. * |---------------------------------+----------------+----------------|
  14662. * | reserved0 | Msg type |
  14663. * |-------------------------------------------------------------------|
  14664. * | flow pool new size | flow pool ID |
  14665. * |-------------------------------------------------------------------|
  14666. *
  14667. * The message is interpreted as follows:
  14668. * b'0:7 - msg_type: This will be set to 0x21
  14669. * (HTT_T2H_MSG_TYPE_FLOW_POOL_RESIZE)
  14670. *
  14671. * b'0:15 - flow pool ID: Existing flow pool ID
  14672. *
  14673. * b'16:31 - flow pool new size: new pool size for exisiting flow pool ID
  14674. *
  14675. */
  14676. PREPACK struct htt_flow_pool_resize_t {
  14677. A_UINT32 msg_type:8,
  14678. reserved0:24;
  14679. A_UINT32 flow_pool_id:16,
  14680. flow_pool_new_size:16;
  14681. } POSTPACK;
  14682. #define HTT_FLOW_POOL_RESIZE_SZ (sizeof(struct htt_flow_pool_resize_t))
  14683. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M 0x0000ffff
  14684. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S 0
  14685. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M 0xffff0000
  14686. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S 16
  14687. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_GET(_var) \
  14688. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_M) >> \
  14689. HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)
  14690. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_SET(_var, _val) \
  14691. do { \
  14692. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID, _val); \
  14693. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_ID_S)); \
  14694. } while (0)
  14695. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_GET(_var) \
  14696. (((_var) & HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_M) >> \
  14697. HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)
  14698. #define HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_SET(_var, _val) \
  14699. do { \
  14700. HTT_CHECK_SET_VAL(HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE, _val); \
  14701. ((_var) |= ((_val) << HTT_FLOW_POOL_RESIZE_FLOW_POOL_NEW_SIZE_S)); \
  14702. } while (0)
  14703. #define HTT_CFR_CAPTURE_MAGIC_PATTERN 0xCCCCCCCC
  14704. #define HTT_CFR_CAPTURE_READ_INDEX_OFFSET 0 /* bytes */
  14705. #define HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES 4
  14706. #define HTT_CFR_CAPTURE_WRITE_INDEX_OFFSET /* bytes */ \
  14707. (HTT_CFR_CAPTURE_READ_INDEX_OFFSET + HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES)
  14708. #define HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES 4
  14709. #define HTT_CFR_CAPTURE_SIZEOF_MAGIC_PATTERN_BYTES 4
  14710. /*
  14711. * The read and write indices point to the data within the host buffer.
  14712. * Because the first 4 bytes of the host buffer is used for the read index and
  14713. * the next 4 bytes for the write index, the data itself starts at offset 8.
  14714. * The read index and write index are the byte offsets from the base of the
  14715. * meta-data buffer, and thus have a minimum value of 8 rather than 0.
  14716. * Refer the ASCII text picture below.
  14717. */
  14718. #define HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX \
  14719. (HTT_CFR_CAPTURE_SIZEOF_READ_INDEX_BYTES + \
  14720. HTT_CFR_CAPTURE_SIZEOF_WRITE_INDEX_BYTES)
  14721. /*
  14722. ***************************************************************************
  14723. *
  14724. * Layout when CFR capture message type is 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14725. *
  14726. ***************************************************************************
  14727. *
  14728. * The memory allocated by WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID is used
  14729. * in the below format. The HTT message 'htt_cfr_dump_compl_ind' is sent by
  14730. * FW to Host whenever a CFR capture (CFR data1 or CFR data2 etc.,) is
  14731. * written into the Host memory region mentioned below.
  14732. *
  14733. * Read index is updated by the Host. At any point of time, the read index will
  14734. * indicate the index that will next be read by the Host. The read index is
  14735. * in units of bytes offset from the base of the meta-data buffer.
  14736. *
  14737. * Write index is updated by the FW. At any point of time, the write index will
  14738. * indicate from where the FW can start writing any new data. The write index is
  14739. * in units of bytes offset from the base of the meta-data buffer.
  14740. *
  14741. * If the Host is not fast enough in reading the CFR data, any new capture data
  14742. * would be dropped if there is no space left to write the new captures.
  14743. *
  14744. * The last 4 bytes of the memory region will have the magic pattern
  14745. * HTT_CFR_CAPTURE_MAGIC_PATTERN. This can be used to ensure that the FW does
  14746. * not overrun the host buffer.
  14747. *
  14748. * ,--------------------. read and write indices store the
  14749. * | | byte offset from the base of the
  14750. * | ,--------+--------. meta-data buffer to the next
  14751. * | | | | location within the data buffer
  14752. * | | v v that will be read / written
  14753. * ************************************************************************
  14754. * * Read * Write * * Magic *
  14755. * * index * index * CFR data1 ...... CFR data N * pattern *
  14756. * * (4 bytes) * (4 bytes) * * (4 bytes)*
  14757. * ************************************************************************
  14758. * |<---------- data buffer ---------->|
  14759. *
  14760. * |<----------------- meta-data buffer allocated in Host ----------------|
  14761. *
  14762. * Note:
  14763. * - Considering the 4 bytes needed to store the Read index (R) and the
  14764. * Write index (W), the initial value is as follows:
  14765. * R = W = HTT_CFR_CAPTURE_INITIAL_RW_START_INDEX
  14766. * - Buffer empty condition:
  14767. * R = W
  14768. *
  14769. * Regarding CFR data format:
  14770. * --------------------------
  14771. *
  14772. * Each CFR tone is stored in HW as 16-bits with the following format:
  14773. * {bits[15:12], bits[11:6], bits[5:0]} =
  14774. * {unsigned exponent (4 bits),
  14775. * signed mantissa_real (6 bits),
  14776. * signed mantissa_imag (6 bits)}
  14777. *
  14778. * CFR_real = mantissa_real * 2^(exponent-5)
  14779. * CFR_imag = mantissa_imag * 2^(exponent-5)
  14780. *
  14781. *
  14782. * The CFR data is written to the 16-bit unsigned output array (buff) in
  14783. * ascending tone order. For example, the Legacy20 CFR is output as follows:
  14784. *
  14785. * buff[0]: [CFR_exp[-26], CFR_mant_real[-26], CFR_mant_imag[-26]]
  14786. * buff[1]: [CFR_exp[-25], CFR_mant_real[-25], CFR_mant_imag[-25]]
  14787. * .
  14788. * .
  14789. * .
  14790. * buff[N-2]: [CFR_exp[25], CFR_mant_real[25], CFR_mant_imag[25]]
  14791. * buff[N-1]: [CFR_exp[26], CFR_mant_real[26], CFR_mant_imag[26]]
  14792. */
  14793. /* Bandwidth of peer CFR captures */
  14794. typedef enum {
  14795. HTT_PEER_CFR_CAPTURE_BW_20MHZ = 0,
  14796. HTT_PEER_CFR_CAPTURE_BW_40MHZ = 1,
  14797. HTT_PEER_CFR_CAPTURE_BW_80MHZ = 2,
  14798. HTT_PEER_CFR_CAPTURE_BW_160MHZ = 3,
  14799. HTT_PEER_CFR_CAPTURE_BW_80_80MHZ = 4,
  14800. HTT_PEER_CFR_CAPTURE_BW_MAX,
  14801. } HTT_PEER_CFR_CAPTURE_BW;
  14802. /* Mode of the peer CFR captures. The type of RX frame for which the CFR
  14803. * was captured
  14804. */
  14805. typedef enum {
  14806. HTT_PEER_CFR_CAPTURE_MODE_LEGACY = 0,
  14807. HTT_PEER_CFR_CAPTURE_MODE_DUP_LEGACY = 1,
  14808. HTT_PEER_CFR_CAPTURE_MODE_HT = 2,
  14809. HTT_PEER_CFR_CAPTURE_MODE_VHT = 3,
  14810. HTT_PEER_CFR_CAPTURE_MODE_MAX,
  14811. } HTT_PEER_CFR_CAPTURE_MODE;
  14812. typedef enum {
  14813. /* This message type is currently used for the below purpose:
  14814. *
  14815. * - capture_method = WMI_PEER_CFR_CAPTURE_METHOD_NULL_FRAME in the
  14816. * wmi_peer_cfr_capture_cmd.
  14817. * If payload_present bit is set to 0 then the associated memory region
  14818. * gets allocated through WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID.
  14819. * If payload_present bit is set to 1 then CFR dump is part of the HTT
  14820. * message; the CFR dump will be present at the end of the message,
  14821. * after the chan_phy_mode.
  14822. */
  14823. HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 = 0x1,
  14824. /* Always keep this last */
  14825. HTT_PEER_CFR_CAPTURE_MSG_TYPE_MAX,
  14826. } HTT_PEER_CFR_CAPTURE_MSG_TYPE;
  14827. /**
  14828. * @brief target -> host CFR dump completion indication message definition
  14829. * htt_cfr_dump_compl_ind when the version is HTT_PEER_CFR_CAPTURE_MSG_TYPE_1.
  14830. *
  14831. * MSG_TYPE => HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND
  14832. *
  14833. * @details
  14834. * The following diagram shows the format of the Channel Frequency Response
  14835. * (CFR) dump completion indication. This inidcation is sent to the Host when
  14836. * the channel capture of a peer is copied by Firmware into the Host memory
  14837. *
  14838. * **************************************************************************
  14839. *
  14840. * Message format when the CFR capture message type is
  14841. * 'HTT_PEER_CFR_CAPTURE_MSG_TYPE_1'
  14842. *
  14843. * **************************************************************************
  14844. *
  14845. * |31 16|15 |8|7 0|
  14846. * |----------------------------------------------------------------|
  14847. * header: | reserved |P| msg_type |
  14848. * word 0 | | | |
  14849. * |----------------------------------------------------------------|
  14850. * payload: | cfr_capture_msg_type |
  14851. * word 1 | |
  14852. * |----------------------------------------------------------------|
  14853. * | vdev_id | captype | chbw | sts | mode | capbw |S| req_id |
  14854. * word 2 | | | | | | | | |
  14855. * |----------------------------------------------------------------|
  14856. * | mac_addr31to0 |
  14857. * word 3 | |
  14858. * |----------------------------------------------------------------|
  14859. * | unused / reserved | mac_addr47to32 |
  14860. * word 4 | | |
  14861. * |----------------------------------------------------------------|
  14862. * | index |
  14863. * word 5 | |
  14864. * |----------------------------------------------------------------|
  14865. * | length |
  14866. * word 6 | |
  14867. * |----------------------------------------------------------------|
  14868. * | timestamp |
  14869. * word 7 | |
  14870. * |----------------------------------------------------------------|
  14871. * | counter |
  14872. * word 8 | |
  14873. * |----------------------------------------------------------------|
  14874. * | chan_mhz |
  14875. * word 9 | |
  14876. * |----------------------------------------------------------------|
  14877. * | band_center_freq1 |
  14878. * word 10 | |
  14879. * |----------------------------------------------------------------|
  14880. * | band_center_freq2 |
  14881. * word 11 | |
  14882. * |----------------------------------------------------------------|
  14883. * | chan_phy_mode |
  14884. * word 12 | |
  14885. * |----------------------------------------------------------------|
  14886. * where,
  14887. * P - payload present bit (payload_present explained below)
  14888. * req_id - memory request id (mem_req_id explained below)
  14889. * S - status field (status explained below)
  14890. * capbw - capture bandwidth (capture_bw explained below)
  14891. * mode - mode of capture (mode explained below)
  14892. * sts - space time streams (sts_count explained below)
  14893. * chbw - channel bandwidth (channel_bw explained below)
  14894. * captype - capture type (cap_type explained below)
  14895. *
  14896. * The following field definitions describe the format of the CFR dump
  14897. * completion indication sent from the target to the host
  14898. *
  14899. * Header fields:
  14900. *
  14901. * Word 0
  14902. * - msg_type
  14903. * Bits 7:0
  14904. * Purpose: Identifies this as CFR TX completion indication
  14905. * Value: 0x22 (HTT_T2H_MSG_TYPE_CFR_DUMP_COMPL_IND)
  14906. * - payload_present
  14907. * Bit 8
  14908. * Purpose: Identifies how CFR data is sent to host
  14909. * Value: 0 - If CFR Payload is written to host memory
  14910. * 1 - If CFR Payload is sent as part of HTT message
  14911. * (This is the requirement for SDIO/USB where it is
  14912. * not possible to write CFR data to host memory)
  14913. * - reserved
  14914. * Bits 31:9
  14915. * Purpose: Reserved
  14916. * Value: 0
  14917. *
  14918. * Payload fields:
  14919. *
  14920. * Word 1
  14921. * - cfr_capture_msg_type
  14922. * Bits 31:0
  14923. * Purpose: Contains the type of the message HTT_PEER_CFR_CAPTURE_MSG_TYPE
  14924. * to specify the format used for the remainder of the message
  14925. * Value: HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  14926. * (currently only MSG_TYPE_1 is defined)
  14927. *
  14928. * Word 2
  14929. * - mem_req_id
  14930. * Bits 6:0
  14931. * Purpose: Contain the mem request id of the region where the CFR capture
  14932. * has been stored - of type WMI_HOST_MEM_REQ_ID
  14933. * Value: WMI_CHANNEL_CAPTURE_HOST_MEM_REQ_ID (if payload_present is 1,
  14934. this value is invalid)
  14935. * - status
  14936. * Bit 7
  14937. * Purpose: Boolean value carrying the status of the CFR capture of the peer
  14938. * Value: 1 (True) - Successful; 0 (False) - Not successful
  14939. * - capture_bw
  14940. * Bits 10:8
  14941. * Purpose: Carry the bandwidth of the CFR capture
  14942. * Value: Bandwidth of the CFR capture of type HTT_PEER_CFR_CAPTURE_BW
  14943. * - mode
  14944. * Bits 13:11
  14945. * Purpose: Carry the mode of the rx frame for which the CFR was captured
  14946. * Value: Mode of the CFR capture of type HTT_PEER_CFR_CAPTURE_MODE
  14947. * - sts_count
  14948. * Bits 16:14
  14949. * Purpose: Carry the number of space time streams
  14950. * Value: Number of space time streams
  14951. * - channel_bw
  14952. * Bits 19:17
  14953. * Purpose: Carry the bandwidth of the channel of the vdev performing the
  14954. * measurement
  14955. * Value: Bandwidth of the channel (of type HTT_PEER_CFR_CAPTURE_BW)
  14956. * - cap_type
  14957. * Bits 23:20
  14958. * Purpose: Carry the type of the capture
  14959. * Value: Capture type (of type WMI_PEER_CFR_CAPTURE_METHOD)
  14960. * - vdev_id
  14961. * Bits 31:24
  14962. * Purpose: Carry the virtual device id
  14963. * Value: vdev ID
  14964. *
  14965. * Word 3
  14966. * - mac_addr31to0
  14967. * Bits 31:0
  14968. * Purpose: Contain the bits 31:0 of the peer MAC address
  14969. * Value: Bits 31:0 of the peer MAC address
  14970. *
  14971. * Word 4
  14972. * - mac_addr47to32
  14973. * Bits 15:0
  14974. * Purpose: Contain the bits 47:32 of the peer MAC address
  14975. * Value: Bits 47:32 of the peer MAC address
  14976. *
  14977. * Word 5
  14978. * - index
  14979. * Bits 31:0
  14980. * Purpose: Contain the index at which this CFR dump was written in the Host
  14981. * allocated memory. This index is the number of bytes from the base address.
  14982. * Value: Index position
  14983. *
  14984. * Word 6
  14985. * - length
  14986. * Bits 31:0
  14987. * Purpose: Carry the length of the CFR capture of the peer, in bytes
  14988. * Value: Length of the CFR capture of the peer
  14989. *
  14990. * Word 7
  14991. * - timestamp
  14992. * Bits 31:0
  14993. * Purpose: Carry the time at which the CFR was captured in the hardware. The
  14994. * clock used for this timestamp is private to the target and not visible to
  14995. * the host i.e., Host can interpret only the relative timestamp deltas from
  14996. * one message to the next, but can't interpret the absolute timestamp from a
  14997. * single message.
  14998. * Value: Timestamp in microseconds
  14999. *
  15000. * Word 8
  15001. * - counter
  15002. * Bits 31:0
  15003. * Purpose: Carry the count of the current CFR capture from FW. This is
  15004. * helpful to identify any drops in FW in any scenario (e.g., lack of space
  15005. * in host memory)
  15006. * Value: Count of the current CFR capture
  15007. *
  15008. * Word 9
  15009. * - chan_mhz
  15010. * Bits 31:0
  15011. * Purpose: Carry the primary 20 MHz channel frequency in MHz of the VDEV
  15012. * Value: Primary 20 channel frequency
  15013. *
  15014. * Word 10
  15015. * - band_center_freq1
  15016. * Bits 31:0
  15017. * Purpose: Carry the center frequency 1 in MHz of the VDEV
  15018. * Value: Center frequency 1 in MHz
  15019. *
  15020. * Word 11
  15021. * - band_center_freq2
  15022. * Bits 31:0
  15023. * Purpose: Carry the center frequency 2 in MHz. valid only for 11acvht of
  15024. * the VDEV
  15025. * 80plus80 mode
  15026. * Value: Center frequency 2 in MHz
  15027. *
  15028. * Word 12
  15029. * - chan_phy_mode
  15030. * Bits 31:0
  15031. * Purpose: Carry the phy mode of the channel, of the VDEV
  15032. * Value: WLAN_PHY_MODE of the channel defined in wlan_defs.h
  15033. */
  15034. PREPACK struct htt_cfr_dump_ind_type_1 {
  15035. A_UINT32 mem_req_id:7,
  15036. status:1,
  15037. capture_bw:3,
  15038. mode:3,
  15039. sts_count:3,
  15040. channel_bw:3,
  15041. cap_type:4,
  15042. vdev_id:8;
  15043. htt_mac_addr addr;
  15044. A_UINT32 index;
  15045. A_UINT32 length;
  15046. A_UINT32 timestamp;
  15047. A_UINT32 counter;
  15048. struct htt_chan_change_msg chan;
  15049. } POSTPACK;
  15050. PREPACK struct htt_cfr_dump_compl_ind {
  15051. A_UINT32 msg_type; /* HTT_PEER_CFR_CAPTURE_MSG_TYPE */
  15052. union {
  15053. /* Message format when msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1 */
  15054. struct htt_cfr_dump_ind_type_1 htt_cfr_dump_compl_ind_type_1;
  15055. /* If there is a need to change the memory layout and its associated
  15056. * HTT indication format, a new CFR capture message type can be
  15057. * introduced and added into this union.
  15058. */
  15059. };
  15060. } POSTPACK;
  15061. /*
  15062. * Get / set macros for the bit fields within WORD-1 of htt_cfr_dump_compl_ind,
  15063. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15064. */
  15065. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M 0x00000100
  15066. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S 8
  15067. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_SET(word, value) \
  15068. do { \
  15069. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID, value); \
  15070. (word) |= (value) << HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S; \
  15071. } while(0)
  15072. #define HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_GET(word) \
  15073. (((word) & HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_M) >> \
  15074. HTT_T2H_CFR_DUMP_PAYLOAD_PRESENT_ID_S)
  15075. /*
  15076. * Get / set macros for the bit fields within WORD-2 of htt_cfr_dump_compl_ind,
  15077. * msg_type = HTT_PEER_CFR_CAPTURE_MSG_TYPE_1
  15078. */
  15079. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M 0X0000007F
  15080. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S 0
  15081. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_M 0X00000080
  15082. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_S 7
  15083. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M 0X00000700
  15084. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S 8
  15085. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_M 0X00003800
  15086. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_S 11
  15087. #define HTT_T2H_CFR_DUMP_TYPE1_STS_M 0X0001C000
  15088. #define HTT_T2H_CFR_DUMP_TYPE1_STS_S 14
  15089. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M 0X000E0000
  15090. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S 17
  15091. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M 0X00F00000
  15092. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S 20
  15093. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M 0XFF000000
  15094. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S 24
  15095. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_SET(word, value) \
  15096. do { \
  15097. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID, value); \
  15098. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S; \
  15099. } while (0)
  15100. #define HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_GET(word) \
  15101. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_M) >> \
  15102. HTT_T2H_CFR_DUMP_TYPE1_MEM_REQ_ID_S)
  15103. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_SET(word, value) \
  15104. do { \
  15105. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STATUS, value); \
  15106. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STATUS_S; \
  15107. } while (0)
  15108. #define HTT_T2H_CFR_DUMP_TYPE1_STATUS_GET(word) \
  15109. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STATUS_M) >> \
  15110. HTT_T2H_CFR_DUMP_TYPE1_STATUS_S)
  15111. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_SET(word, value) \
  15112. do { \
  15113. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_BW, value); \
  15114. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S; \
  15115. } while (0)
  15116. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_GET(word) \
  15117. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_M) >> \
  15118. HTT_T2H_CFR_DUMP_TYPE1_CAP_BW_S)
  15119. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_SET(word, value) \
  15120. do { \
  15121. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_MODE, value); \
  15122. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_MODE_S; \
  15123. } while (0)
  15124. #define HTT_T2H_CFR_DUMP_TYPE1_MODE_GET(word) \
  15125. (((word) & HTT_T2H_CFR_DUMP_TYPE1_MODE_M) >> \
  15126. HTT_T2H_CFR_DUMP_TYPE1_MODE_S)
  15127. #define HTT_T2H_CFR_DUMP_TYPE1_STS_SET(word, value) \
  15128. do { \
  15129. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_STS, value); \
  15130. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_STS_S; \
  15131. } while (0)
  15132. #define HTT_T2H_CFR_DUMP_TYPE1_STS_GET(word) \
  15133. (((word) & HTT_T2H_CFR_DUMP_TYPE1_STS_M) >> \
  15134. HTT_T2H_CFR_DUMP_TYPE1_STS_S)
  15135. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_SET(word, value) \
  15136. do { \
  15137. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW, value); \
  15138. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S; \
  15139. } while (0)
  15140. #define HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_GET(word) \
  15141. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_M) >> \
  15142. HTT_T2H_CFR_DUMP_TYPE1_CHAN_BW_S)
  15143. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_SET(word, value) \
  15144. do { \
  15145. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE, value); \
  15146. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S; \
  15147. } while (0)
  15148. #define HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_GET(word) \
  15149. (((word) & HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_M) >> \
  15150. HTT_T2H_CFR_DUMP_TYPE1_CAP_TYPE_S)
  15151. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_SET(word, value) \
  15152. do { \
  15153. HTT_CHECK_SET_VAL(HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID, value); \
  15154. (word) |= (value) << HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S; \
  15155. } while (0)
  15156. #define HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_GET(word) \
  15157. (((word) & HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_M) >> \
  15158. HTT_T2H_CFR_DUMP_TYPE1_VDEV_ID_S)
  15159. /**
  15160. * @brief target -> host peer (PPDU) stats message
  15161. *
  15162. * MSG_TYPE => HTT_T2H_MSG_TYPE_PEER_STATS_IND
  15163. *
  15164. * @details
  15165. * This message is generated by FW when FW is sending stats to host
  15166. * about one or more PPDUs that the FW has transmitted to one or more peers.
  15167. * This message is sent autonomously by the target rather than upon request
  15168. * by the host.
  15169. * The following field definitions describe the format of the HTT target
  15170. * to host peer stats indication message.
  15171. *
  15172. * The HTT_T2H PPDU_STATS_IND message has a header followed by one
  15173. * or more PPDU stats records.
  15174. * Each PPDU stats record uses a htt_tx_ppdu_stats_info TLV.
  15175. * If the details of N PPDUS are sent in one PEER_STATS_IND message,
  15176. * then the message would start with the
  15177. * header, followed by N htt_tx_ppdu_stats_info structures, as depicted
  15178. * below.
  15179. *
  15180. * |31 16|15|14|13 11|10 9|8|7 0|
  15181. * |-------------------------------------------------------------|
  15182. * | reserved |MSG_TYPE |
  15183. * |-------------------------------------------------------------|
  15184. * rec 0 | TLV header |
  15185. * rec 0 |-------------------------------------------------------------|
  15186. * rec 0 | ppdu successful bytes |
  15187. * rec 0 |-------------------------------------------------------------|
  15188. * rec 0 | ppdu retry bytes |
  15189. * rec 0 |-------------------------------------------------------------|
  15190. * rec 0 | ppdu failed bytes |
  15191. * rec 0 |-------------------------------------------------------------|
  15192. * rec 0 | peer id | S|SG| BW | BA |A|rate code|
  15193. * rec 0 |-------------------------------------------------------------|
  15194. * rec 0 | retried MSDUs | successful MSDUs |
  15195. * rec 0 |-------------------------------------------------------------|
  15196. * rec 0 | TX duration | failed MSDUs |
  15197. * rec 0 |-------------------------------------------------------------|
  15198. * ...
  15199. * |-------------------------------------------------------------|
  15200. * rec N | TLV header |
  15201. * rec N |-------------------------------------------------------------|
  15202. * rec N | ppdu successful bytes |
  15203. * rec N |-------------------------------------------------------------|
  15204. * rec N | ppdu retry bytes |
  15205. * rec N |-------------------------------------------------------------|
  15206. * rec N | ppdu failed bytes |
  15207. * rec N |-------------------------------------------------------------|
  15208. * rec N | peer id | S|SG| BW | BA |A|rate code|
  15209. * rec N |-------------------------------------------------------------|
  15210. * rec N | retried MSDUs | successful MSDUs |
  15211. * rec N |-------------------------------------------------------------|
  15212. * rec N | TX duration | failed MSDUs |
  15213. * rec N |-------------------------------------------------------------|
  15214. *
  15215. * where:
  15216. * A = is A-MPDU flag
  15217. * BA = block-ack failure flags
  15218. * BW = bandwidth spec
  15219. * SG = SGI enabled spec
  15220. * S = skipped rate ctrl
  15221. * One htt_tx_ppdu_stats_info instance will have stats for one PPDU
  15222. *
  15223. * Header
  15224. * ------
  15225. * dword0 - b'0:7 - msg_type : 0x23 (HTT_T2H_MSG_TYPE_PEER_STATS_IND)
  15226. * dword0 - b'8:31 - reserved : Reserved for future use
  15227. *
  15228. * payload include below peer_stats information
  15229. * --------------------------------------------
  15230. * @TLV : HTT_PPDU_STATS_INFO_TLV
  15231. * @tx_success_bytes : total successful bytes in the PPDU.
  15232. * @tx_retry_bytes : total retried bytes in the PPDU.
  15233. * @tx_failed_bytes : total failed bytes in the PPDU.
  15234. * @tx_ratecode : rate code used for the PPDU.
  15235. * @is_ampdu : Indicates PPDU is AMPDU or not.
  15236. * @ba_ack_failed : BA/ACK failed for this PPDU
  15237. * b00 -> BA received
  15238. * b01 -> BA failed once
  15239. * b10 -> BA failed twice, when HW retry is enabled.
  15240. * @bw : BW
  15241. * b00 -> 20 MHz
  15242. * b01 -> 40 MHz
  15243. * b10 -> 80 MHz
  15244. * b11 -> 160 MHz (or 80+80)
  15245. * @sg : SGI enabled
  15246. * @s : skipped ratectrl
  15247. * @peer_id : peer id
  15248. * @tx_success_msdus : successful MSDUs
  15249. * @tx_retry_msdus : retried MSDUs
  15250. * @tx_failed_msdus : MSDUs dropped in FW after max retry
  15251. * @tx_duration : Tx duration for the PPDU (microsecond units)
  15252. */
  15253. /**
  15254. * @brief target -> host backpressure event
  15255. *
  15256. * MSG_TYPE => HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND
  15257. *
  15258. * @details
  15259. * HTT_T2H_MSG_TYPE_BKPRESSURE_EVENTID message is sent by the target when
  15260. * continuous backpressure is seen in the LMAC/ UMAC rings software rings.
  15261. * This message will only be sent if the backpressure condition has existed
  15262. * continuously for an initial period (100 ms).
  15263. * Repeat messages with updated information will be sent after each
  15264. * subsequent period (100 ms) as long as the backpressure remains unabated.
  15265. * This message indicates the ring id along with current head and tail index
  15266. * locations (i.e. write and read indices).
  15267. * The backpressure time indicates the time in ms for which continous
  15268. * backpressure has been observed in the ring.
  15269. *
  15270. * The message format is as follows:
  15271. *
  15272. * |31 24|23 16|15 8|7 0|
  15273. * |----------------+----------------+----------------+----------------|
  15274. * | ring_id | ring_type | pdev_id | msg_type |
  15275. * |-------------------------------------------------------------------|
  15276. * | tail_idx | head_idx |
  15277. * |-------------------------------------------------------------------|
  15278. * | backpressure_time_ms |
  15279. * |-------------------------------------------------------------------|
  15280. *
  15281. * The message is interpreted as follows:
  15282. * dword0 - b'0:7 - msg_type: This will be set to 0x24
  15283. * (HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND)
  15284. * b'8:15 - pdev_id: 0 indicates msg is for UMAC ring.
  15285. * 1, 2, 3 indicates pdev_id 0,1,2 and
  15286. the msg is for LMAC ring.
  15287. * b'16:23 - ring_type: Refer to enum htt_backpressure_ring_type.
  15288. * b'24:31 - ring_id: Refer enum htt_backpressure_umac_ring_id/
  15289. * htt_backpressure_lmac_ring_id. This represents
  15290. * the ring id for which continous backpressure is seen
  15291. *
  15292. * dword1 - b'0:15 - head_idx: This indicates the current head index of
  15293. * the ring indicated by the ring_id
  15294. *
  15295. * dword1 - b'16:31 - tail_idx: This indicates the current tail index of
  15296. * the ring indicated by the ring id
  15297. *
  15298. * dword2 - b'0:31 - backpressure_time_ms: Indicates how long continous
  15299. * backpressure has been seen in the ring
  15300. * indicated by the ring_id.
  15301. * Units = milliseconds
  15302. */
  15303. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_M 0x0000ff00
  15304. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_S 8
  15305. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_M 0x00ff0000
  15306. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_S 16
  15307. #define HTT_T2H_RX_BKPRESSURE_RINGID_M 0xff000000
  15308. #define HTT_T2H_RX_BKPRESSURE_RINGID_S 24
  15309. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M 0x0000ffff
  15310. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S 0
  15311. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M 0xffff0000
  15312. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S 16
  15313. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_M 0xffffffff
  15314. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_S 0
  15315. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_SET(word, value) \
  15316. do { \
  15317. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_PDEV_ID, value); \
  15318. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_PDEV_ID_S; \
  15319. } while (0)
  15320. #define HTT_T2H_RX_BKPRESSURE_PDEV_ID_GET(word) \
  15321. (((word) & HTT_T2H_RX_BKPRESSURE_PDEV_ID_M) >> \
  15322. HTT_T2H_RX_BKPRESSURE_PDEV_ID_S)
  15323. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_SET(word, value) \
  15324. do { \
  15325. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RING_TYPE, value); \
  15326. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RING_TYPE_S; \
  15327. } while (0)
  15328. #define HTT_T2H_RX_BKPRESSURE_RING_TYPE_GET(word) \
  15329. (((word) & HTT_T2H_RX_BKPRESSURE_RING_TYPE_M) >> \
  15330. HTT_T2H_RX_BKPRESSURE_RING_TYPE_S)
  15331. #define HTT_T2H_RX_BKPRESSURE_RINGID_SET(word, value) \
  15332. do { \
  15333. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_RINGID, value); \
  15334. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_RINGID_S; \
  15335. } while (0)
  15336. #define HTT_T2H_RX_BKPRESSURE_RINGID_GET(word) \
  15337. (((word) & HTT_T2H_RX_BKPRESSURE_RINGID_M) >> \
  15338. HTT_T2H_RX_BKPRESSURE_RINGID_S)
  15339. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_SET(word, value) \
  15340. do { \
  15341. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_HEAD_IDX, value); \
  15342. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S; \
  15343. } while (0)
  15344. #define HTT_T2H_RX_BKPRESSURE_HEAD_IDX_GET(word) \
  15345. (((word) & HTT_T2H_RX_BKPRESSURE_HEAD_IDX_M) >> \
  15346. HTT_T2H_RX_BKPRESSURE_HEAD_IDX_S)
  15347. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_SET(word, value) \
  15348. do { \
  15349. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TAIL_IDX, value); \
  15350. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S; \
  15351. } while (0)
  15352. #define HTT_T2H_RX_BKPRESSURE_TAIL_IDX_GET(word) \
  15353. (((word) & HTT_T2H_RX_BKPRESSURE_TAIL_IDX_M) >> \
  15354. HTT_T2H_RX_BKPRESSURE_TAIL_IDX_S)
  15355. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_SET(word, value) \
  15356. do { \
  15357. HTT_CHECK_SET_VAL(HTT_T2H_RX_BKPRESSURE_TIME_MS, value); \
  15358. (word) |= (value) << HTT_T2H_RX_BKPRESSURE_TIME_MS_S; \
  15359. } while (0)
  15360. #define HTT_T2H_RX_BKPRESSURE_TIME_MS_GET(word) \
  15361. (((word) & HTT_T2H_RX_BKPRESSURE_TIME_MS_M) >> \
  15362. HTT_T2H_RX_BKPRESSURE_TIME_MS_S)
  15363. enum htt_backpressure_ring_type {
  15364. HTT_SW_RING_TYPE_UMAC,
  15365. HTT_SW_RING_TYPE_LMAC,
  15366. HTT_SW_RING_TYPE_MAX,
  15367. };
  15368. /* Ring id for which the message is sent to host */
  15369. enum htt_backpressure_umac_ringid {
  15370. HTT_SW_RING_IDX_REO_REO2SW1_RING,
  15371. HTT_SW_RING_IDX_REO_REO2SW2_RING,
  15372. HTT_SW_RING_IDX_REO_REO2SW3_RING,
  15373. HTT_SW_RING_IDX_REO_REO2SW4_RING,
  15374. HTT_SW_RING_IDX_REO_WBM2REO_LINK_RING,
  15375. HTT_SW_RING_IDX_REO_REO2TCL_RING,
  15376. HTT_SW_RING_IDX_REO_REO2FW_RING,
  15377. HTT_SW_RING_IDX_REO_REO_RELEASE_RING,
  15378. HTT_SW_RING_IDX_WBM_PPE_RELEASE_RING,
  15379. HTT_SW_RING_IDX_TCL_TCL2TQM_RING,
  15380. HTT_SW_RING_IDX_WBM_TQM_RELEASE_RING,
  15381. HTT_SW_RING_IDX_WBM_REO_RELEASE_RING,
  15382. HTT_SW_RING_IDX_WBM_WBM2SW0_RELEASE_RING,
  15383. HTT_SW_RING_IDX_WBM_WBM2SW1_RELEASE_RING,
  15384. HTT_SW_RING_IDX_WBM_WBM2SW2_RELEASE_RING,
  15385. HTT_SW_RING_IDX_WBM_WBM2SW3_RELEASE_RING,
  15386. HTT_SW_RING_IDX_REO_REO_CMD_RING,
  15387. HTT_SW_RING_IDX_REO_REO_STATUS_RING,
  15388. HTT_SW_UMAC_RING_IDX_MAX,
  15389. };
  15390. enum htt_backpressure_lmac_ringid {
  15391. HTT_SW_RING_IDX_FW2RXDMA_BUF_RING,
  15392. HTT_SW_RING_IDX_FW2RXDMA_STATUS_RING,
  15393. HTT_SW_RING_IDX_FW2RXDMA_LINK_RING,
  15394. HTT_SW_RING_IDX_SW2RXDMA_BUF_RING,
  15395. HTT_SW_RING_IDX_WBM2RXDMA_LINK_RING,
  15396. HTT_SW_RING_IDX_RXDMA2FW_RING,
  15397. HTT_SW_RING_IDX_RXDMA2SW_RING,
  15398. HTT_SW_RING_IDX_RXDMA2RELEASE_RING,
  15399. HTT_SW_RING_IDX_RXDMA2REO_RING,
  15400. HTT_SW_RING_IDX_MONITOR_STATUS_RING,
  15401. HTT_SW_RING_IDX_MONITOR_BUF_RING,
  15402. HTT_SW_RING_IDX_MONITOR_DESC_RING,
  15403. HTT_SW_RING_IDX_MONITOR_DEST_RING,
  15404. HTT_SW_LMAC_RING_IDX_MAX,
  15405. };
  15406. PREPACK struct htt_t2h_msg_bkpressure_event_ind_t {
  15407. A_UINT32 msg_type: 8, /* HTT_T2H_MSG_TYPE_BKPRESSURE_EVENT_IND */
  15408. pdev_id: 8,
  15409. ring_type: 8, /* htt_backpressure_ring_type */
  15410. /*
  15411. * ring_id holds an enum value from either
  15412. * htt_backpressure_umac_ringid or
  15413. * htt_backpressure_lmac_ringid, based on
  15414. * the ring_type setting.
  15415. */
  15416. ring_id: 8;
  15417. A_UINT16 head_idx;
  15418. A_UINT16 tail_idx;
  15419. A_UINT32 backpressure_time_ms; /* Time in milliseconds for which backpressure is seen continuously */
  15420. } POSTPACK;
  15421. /*
  15422. * Defines two 32 bit words that can be used by the target to indicate a per
  15423. * user RU allocation and rate information.
  15424. *
  15425. * This information is currently provided in the "sw_response_reference_ptr"
  15426. * (word 0) and "sw_response_reference_ptr_ext" (word 1) fields of the
  15427. * "rx_ppdu_end_user_stats" TLV.
  15428. *
  15429. * VALID:
  15430. * The consumer of these words must explicitly check the valid bit,
  15431. * and only attempt interpretation of any of the remaining fields if
  15432. * the valid bit is set to 1.
  15433. *
  15434. * VERSION:
  15435. * The consumer of these words must also explicitly check the version bit,
  15436. * and only use the V0 definition if the VERSION field is set to 0.
  15437. *
  15438. * Version 1 is currently undefined, with the exception of the VALID and
  15439. * VERSION fields.
  15440. *
  15441. * Version 0:
  15442. *
  15443. * The fields below are duplicated per BW.
  15444. *
  15445. * The consumer must determine which BW field to use, based on the UL OFDMA
  15446. * PPDU BW indicated by HW.
  15447. *
  15448. * RU_START: RU26 start index for the user.
  15449. * Note that this is always using the RU26 index, regardless
  15450. * of the actual RU assigned to the user
  15451. * (i.e. the second RU52 is RU_START 2, RU_SIZE
  15452. * HTT_UL_OFDMA_V0_RU_SIZE_RU_52)
  15453. *
  15454. * For example, 20MHz (the value in the top row is RU_START)
  15455. *
  15456. * RU Size 0 (26): |0|1|2|3|4|5|6|7|8|
  15457. * RU Size 1 (52): | | | | | |
  15458. * RU Size 2 (106): | | | |
  15459. * RU Size 3 (242): | |
  15460. *
  15461. * RU_SIZE: Indicates the RU size, as defined by enum
  15462. * htt_ul_ofdma_user_info_ru_size.
  15463. *
  15464. * LDPC: LDPC enabled (if 0, BCC is used)
  15465. *
  15466. * DCM: DCM enabled
  15467. *
  15468. * |31 | 30|29 23|22 19|18 16|15 9| 8 | 7 |6 3|2 0|
  15469. * |---------------------------------+--------------------------------|
  15470. * |Ver|Valid| FW internal |
  15471. * |---------------------------------+--------------------------------|
  15472. * | reserved |Trig Type|RU SIZE| RU START |DCM|LDPC|MCS |NSS|
  15473. * |---------------------------------+--------------------------------|
  15474. */
  15475. enum htt_ul_ofdma_user_info_ru_size {
  15476. HTT_UL_OFDMA_V0_RU_SIZE_RU_26,
  15477. HTT_UL_OFDMA_V0_RU_SIZE_RU_52,
  15478. HTT_UL_OFDMA_V0_RU_SIZE_RU_106,
  15479. HTT_UL_OFDMA_V0_RU_SIZE_RU_242,
  15480. HTT_UL_OFDMA_V0_RU_SIZE_RU_484,
  15481. HTT_UL_OFDMA_V0_RU_SIZE_RU_996,
  15482. HTT_UL_OFDMA_V0_RU_SIZE_RU_996x2
  15483. };
  15484. /* htt_up_ofdma_user_info_v0 provides an abstract view of the info */
  15485. struct htt_ul_ofdma_user_info_v0 {
  15486. A_UINT32 word0;
  15487. A_UINT32 word1;
  15488. };
  15489. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0 \
  15490. A_UINT32 w0_fw_rsvd:30; \
  15491. A_UINT32 w0_valid:1; \
  15492. A_UINT32 w0_version:1;
  15493. struct htt_ul_ofdma_user_info_v0_bitmap_w0 {
  15494. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15495. };
  15496. #define HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1 \
  15497. A_UINT32 w1_nss:3; \
  15498. A_UINT32 w1_mcs:4; \
  15499. A_UINT32 w1_ldpc:1; \
  15500. A_UINT32 w1_dcm:1; \
  15501. A_UINT32 w1_ru_start:7; \
  15502. A_UINT32 w1_ru_size:3; \
  15503. A_UINT32 w1_trig_type:4; \
  15504. A_UINT32 w1_unused:9;
  15505. struct htt_ul_ofdma_user_info_v0_bitmap_w1 {
  15506. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15507. };
  15508. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0 \
  15509. A_UINT32 w0_fw_rsvd:27; \
  15510. A_UINT32 w0_sub_version:3; /* set to a value of “0” on WKK/Beryllium targets (future expansion) */ \
  15511. A_UINT32 w0_valid:1; /* field aligns with V0 definition */ \
  15512. 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) */
  15513. struct htt_ul_ofdma_user_info_v1_bitmap_w0 {
  15514. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15515. };
  15516. #define HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1 \
  15517. A_UINT32 w1_unused_0_to_18:19; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */ \
  15518. A_UINT32 w1_trig_type:4; \
  15519. A_UINT32 w1_unused_23_to_31:9; /* Guaranteed to be set to 0, can be used for future expansion without bumping version again. */
  15520. struct htt_ul_ofdma_user_info_v1_bitmap_w1 {
  15521. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15522. };
  15523. /* htt_ul_ofdma_user_info_v0_bitmap shows what bitfields are within the info */
  15524. PREPACK struct htt_ul_ofdma_user_info_v0_bitmap {
  15525. union {
  15526. A_UINT32 word0;
  15527. struct {
  15528. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W0
  15529. };
  15530. };
  15531. union {
  15532. A_UINT32 word1;
  15533. struct {
  15534. HTT_UL_OFDMA_USER_INFO_V0_BITMAP_W1
  15535. };
  15536. };
  15537. } POSTPACK;
  15538. /*
  15539. * htt_ul_ofdma_user_info_v1_bitmap bits are aligned to
  15540. * htt_ul_ofdma_user_info_v0_bitmap, based on the w0_version
  15541. * this should be picked.
  15542. */
  15543. PREPACK struct htt_ul_ofdma_user_info_v1_bitmap {
  15544. union {
  15545. A_UINT32 word0;
  15546. struct {
  15547. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W0
  15548. };
  15549. };
  15550. union {
  15551. A_UINT32 word1;
  15552. struct {
  15553. HTT_UL_OFDMA_USER_INFO_V1_BITMAP_W1
  15554. };
  15555. };
  15556. } POSTPACK;
  15557. enum HTT_UL_OFDMA_TRIG_TYPE {
  15558. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BASIC = 0,
  15559. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BFRP,
  15560. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_BAR,
  15561. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_MU_RTS_CTS,
  15562. HTT_UL_OFDMA_USER_INFO_V0_TRIG_TYPE_BSR,
  15563. };
  15564. #define HTT_UL_OFDMA_USER_INFO_V0_SZ (sizeof(struct htt_ul_ofdma_user_info_v0))
  15565. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M 0x0000ffff
  15566. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S 0
  15567. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M 0x40000000
  15568. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S 30
  15569. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M 0x80000000
  15570. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S 31
  15571. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M 0x00000007
  15572. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S 0
  15573. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M 0x00000078
  15574. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S 3
  15575. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M 0x00000080
  15576. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S 7
  15577. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M 0x00000100
  15578. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S 8
  15579. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M 0x0000fe00
  15580. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S 9
  15581. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M 0x00070000
  15582. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S 16
  15583. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M 0x00780000
  15584. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S 19
  15585. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_M 0xff800000
  15586. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RESERVED1_S 23
  15587. /*--- word 0 ---*/
  15588. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_GET(word) \
  15589. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)
  15590. #define HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_SET(word, _val) \
  15591. do { \
  15592. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL, _val); \
  15593. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_FW_INTERNAL_S)); \
  15594. } while (0)
  15595. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_GET(word) \
  15596. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)
  15597. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_SET(word, _val) \
  15598. do { \
  15599. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VALID, _val); \
  15600. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VALID_S)); \
  15601. } while (0)
  15602. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_GET(word) \
  15603. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W0_VER_M) >> HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)
  15604. #define HTT_UL_OFDMA_USER_INFO_V0_W0_VER_SET(word, _val) \
  15605. do { \
  15606. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W0_VER, _val); \
  15607. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W0_VER_S)); \
  15608. } while (0)
  15609. /*--- word 1 ---*/
  15610. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_GET(word) \
  15611. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)
  15612. #define HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_SET(word, _val) \
  15613. do { \
  15614. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_NSS, _val); \
  15615. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_NSS_S)); \
  15616. } while (0)
  15617. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_GET(word) \
  15618. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)
  15619. #define HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_SET(word, _val) \
  15620. do { \
  15621. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_MCS, _val); \
  15622. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_MCS_S)); \
  15623. } while (0)
  15624. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_GET(word) \
  15625. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)
  15626. #define HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_SET(word, _val) \
  15627. do { \
  15628. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC, _val); \
  15629. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_LDPC_S)); \
  15630. } while (0)
  15631. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_GET(word) \
  15632. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)
  15633. #define HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_SET(word, _val) \
  15634. do { \
  15635. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_DCM, _val); \
  15636. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_DCM_S)); \
  15637. } while (0)
  15638. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_GET(word) \
  15639. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)
  15640. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_SET(word, _val) \
  15641. do { \
  15642. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START, _val); \
  15643. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_START_S)); \
  15644. } while (0)
  15645. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_GET(word) \
  15646. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)
  15647. #define HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_SET(word, _val) \
  15648. do { \
  15649. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE, _val); \
  15650. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_SIZE_S)); \
  15651. } while (0)
  15652. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_GET(word) \
  15653. (((word) & HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_M) >> HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_S)
  15654. #define HTT_UL_OFDMA_USER_INFO_V0_W1_TRIG_TYP_SET(word, _val) \
  15655. do { \
  15656. HTT_CHECK_SET_VAL(HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP, _val); \
  15657. ((word) |= ((_val) << HTT_UL_OFDMA_USER_INFO_V0_W1_RU_TRIG_TYP_S)); \
  15658. } while (0)
  15659. /**
  15660. * @brief target -> host channel calibration data message
  15661. *
  15662. * MSG_TYPE => HTT_T2H_MSG_TYPE_CHAN_CALDATA
  15663. *
  15664. * @brief host -> target channel calibration data message
  15665. *
  15666. * MSG_TYPE => HTT_H2T_MSG_TYPE_CHAN_CALDATA
  15667. *
  15668. * @details
  15669. * The following field definitions describe the format of the channel
  15670. * calibration data message sent from the target to the host when
  15671. * MSG_TYPE is HTT_T2H_MSG_TYPE_CHAN_CALDATA, and sent from the host
  15672. * to the target when MSG_TYPE is HTT_H2T_MSG_TYPE_CHAN_CALDATA.
  15673. * The message is defined as htt_chan_caldata_msg followed by a variable
  15674. * number of 32-bit character values.
  15675. *
  15676. * |31 21|20|19 16|15 13| 12|11 8|7 0|
  15677. * |------------------------------------------------------------------|
  15678. * | rsv | A| frag | rsv |ck_v| sub_type| msg type |
  15679. * |------------------------------------------------------------------|
  15680. * | payload size | mhz |
  15681. * |------------------------------------------------------------------|
  15682. * | center frequency 2 | center frequency 1 |
  15683. * |------------------------------------------------------------------|
  15684. * | check sum |
  15685. * |------------------------------------------------------------------|
  15686. * | payload |
  15687. * |------------------------------------------------------------------|
  15688. * message info field:
  15689. * - MSG_TYPE
  15690. * Bits 7:0
  15691. * Purpose: identifies this as a channel calibration data message
  15692. * Value: 0x25 (HTT_T2H_MSG_TYPE_CHAN_CALDATA)
  15693. * 0x14 (HTT_H2T_MSG_TYPE_CHAN_CALDATA)
  15694. * - SUB_TYPE
  15695. * Bits 11:8
  15696. * Purpose: T2H: indicates whether target is providing chan cal data
  15697. * to the host to store, or requesting that the host
  15698. * download previously-stored data.
  15699. * H2T: indicates whether the host is providing the requested
  15700. * channel cal data, or if it is rejecting the data
  15701. * request because it does not have the requested data.
  15702. * Value: see HTT_T2H_MSG_CHAN_CALDATA_xxx defs
  15703. * - CHKSUM_VALID
  15704. * Bit 12
  15705. * Purpose: indicates if the checksum field is valid
  15706. * value:
  15707. * - FRAG
  15708. * Bit 19:16
  15709. * Purpose: indicates the fragment index for message
  15710. * value: 0 for first fragment, 1 for second fragment, ...
  15711. * - APPEND
  15712. * Bit 20
  15713. * Purpose: indicates if this is the last fragment
  15714. * value: 0 = final fragment, 1 = more fragments will be appended
  15715. *
  15716. * channel and payload size field
  15717. * - MHZ
  15718. * Bits 15:0
  15719. * Purpose: indicates the channel primary frequency
  15720. * Value:
  15721. * - PAYLOAD_SIZE
  15722. * Bits 31:16
  15723. * Purpose: indicates the bytes of calibration data in payload
  15724. * Value:
  15725. *
  15726. * center frequency field
  15727. * - CENTER FREQUENCY 1
  15728. * Bits 15:0
  15729. * Purpose: indicates the channel center frequency
  15730. * Value: channel center frequency, in MHz units
  15731. * - CENTER FREQUENCY 2
  15732. * Bits 31:16
  15733. * Purpose: indicates the secondary channel center frequency,
  15734. * only for 11acvht 80plus80 mode
  15735. * Value: secondary channel center frequeny, in MHz units, if applicable
  15736. *
  15737. * checksum field
  15738. * - CHECK_SUM
  15739. * Bits 31:0
  15740. * Purpose: check the payload data, it is just for this fragment.
  15741. * This is intended for the target to check that the channel
  15742. * calibration data returned by the host is the unmodified data
  15743. * that was previously provided to the host by the target.
  15744. * value: checksum of fragment payload
  15745. */
  15746. PREPACK struct htt_chan_caldata_msg {
  15747. /* DWORD 0: message info */
  15748. A_UINT32
  15749. msg_type: 8,
  15750. sub_type: 4 ,
  15751. chksum_valid: 1, /** 1:valid, 0:invalid */
  15752. reserved1: 3,
  15753. frag_idx: 4, /** fragment index for calibration data */
  15754. appending: 1, /** 0: no fragment appending,
  15755. * 1: extra fragment appending */
  15756. reserved2: 11;
  15757. /* DWORD 1: channel and payload size */
  15758. A_UINT32
  15759. mhz: 16, /** primary 20 MHz channel frequency in mhz */
  15760. payload_size: 16; /** unit: bytes */
  15761. /* DWORD 2: center frequency */
  15762. A_UINT32
  15763. band_center_freq1: 16, /** Center frequency 1 in MHz */
  15764. band_center_freq2: 16; /** Center frequency 2 in MHz,
  15765. * valid only for 11acvht 80plus80 mode */
  15766. /* DWORD 3: check sum */
  15767. A_UINT32 chksum;
  15768. /* variable length for calibration data */
  15769. A_UINT32 payload[1/* or more */];
  15770. } POSTPACK;
  15771. /* T2H SUBTYPE */
  15772. #define HTT_T2H_MSG_CHAN_CALDATA_REQ 0
  15773. #define HTT_T2H_MSG_CHAN_CALDATA_UPLOAD 1
  15774. /* H2T SUBTYPE */
  15775. #define HTT_H2T_MSG_CHAN_CALDATA_REJ 0
  15776. #define HTT_H2T_MSG_CHAN_CALDATA_DOWNLOAD 1
  15777. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_S 8
  15778. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_M 0x00000f00
  15779. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_GET(_var) \
  15780. (((_var) & HTT_CHAN_CALDATA_MSG_SUB_TYPE_M) >> HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)
  15781. #define HTT_CHAN_CALDATA_MSG_SUB_TYPE_SET(_var, _val) \
  15782. do { \
  15783. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_SUB_TYPE, _val); \
  15784. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_SUB_TYPE_S)); \
  15785. } while (0)
  15786. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_S 12
  15787. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_M 0x00001000
  15788. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_GET(_var) \
  15789. (((_var) & HTT_CHAN_CALDATA_MSG_CHKSUM_V_M) >> HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)
  15790. #define HTT_CHAN_CALDATA_MSG_CHKSUM_V_SET(_var, _val) \
  15791. do { \
  15792. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_CHKSUM_V, _val); \
  15793. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_CHKSUM_V_S)); \
  15794. } while (0)
  15795. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_S 16
  15796. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_M 0x000f0000
  15797. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_GET(_var) \
  15798. (((_var) & HTT_CHAN_CALDATA_MSG_FRAG_IDX_M) >> HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)
  15799. #define HTT_CHAN_CALDATA_MSG_FRAG_IDX_SET(_var, _val) \
  15800. do { \
  15801. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FRAG_IDX, _val); \
  15802. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FRAG_IDX_S)); \
  15803. } while (0)
  15804. #define HTT_CHAN_CALDATA_MSG_APPENDING_S 20
  15805. #define HTT_CHAN_CALDATA_MSG_APPENDING_M 0x00100000
  15806. #define HTT_CHAN_CALDATA_MSG_APPENDING_GET(_var) \
  15807. (((_var) & HTT_CHAN_CALDATA_MSG_APPENDING_M) >> HTT_CHAN_CALDATA_MSG_APPENDING_S)
  15808. #define HTT_CHAN_CALDATA_MSG_APPENDING_SET(_var, _val) \
  15809. do { \
  15810. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_APPENDING, _val); \
  15811. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_APPENDING_S)); \
  15812. } while (0)
  15813. #define HTT_CHAN_CALDATA_MSG_MHZ_S 0
  15814. #define HTT_CHAN_CALDATA_MSG_MHZ_M 0x0000ffff
  15815. #define HTT_CHAN_CALDATA_MSG_MHZ_GET(_var) \
  15816. (((_var) & HTT_CHAN_CALDATA_MSG_MHZ_M) >> HTT_CHAN_CALDATA_MSG_MHZ_S)
  15817. #define HTT_CHAN_CALDATA_MSG_MHZ_SET(_var, _val) \
  15818. do { \
  15819. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_MHZ, _val); \
  15820. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_MHZ_S)); \
  15821. } while (0)
  15822. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_S 16
  15823. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_M 0xffff0000
  15824. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_GET(_var) \
  15825. (((_var) & HTT_CHAN_CALDATA_MSG_PLD_SIZE_M) >> HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)
  15826. #define HTT_CHAN_CALDATA_MSG_PLD_SIZE_SET(_var, _val) \
  15827. do { \
  15828. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_PLD_SIZE, _val); \
  15829. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_PLD_SIZE_S)); \
  15830. } while (0)
  15831. #define HTT_CHAN_CALDATA_MSG_FREQ1_S 0
  15832. #define HTT_CHAN_CALDATA_MSG_FREQ1_M 0x0000ffff
  15833. #define HTT_CHAN_CALDATA_MSG_FREQ1_GET(_var) \
  15834. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ1_M) >> HTT_CHAN_CALDATA_MSG_FREQ1_S)
  15835. #define HTT_CHAN_CALDATA_MSG_FREQ1_SET(_var, _val) \
  15836. do { \
  15837. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ1, _val); \
  15838. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ1_S)); \
  15839. } while (0)
  15840. #define HTT_CHAN_CALDATA_MSG_FREQ2_S 16
  15841. #define HTT_CHAN_CALDATA_MSG_FREQ2_M 0xffff0000
  15842. #define HTT_CHAN_CALDATA_MSG_FREQ2_GET(_var) \
  15843. (((_var) & HTT_CHAN_CALDATA_MSG_FREQ2_M) >> HTT_CHAN_CALDATA_MSG_FREQ2_S)
  15844. #define HTT_CHAN_CALDATA_MSG_FREQ2_SET(_var, _val) \
  15845. do { \
  15846. HTT_CHECK_SET_VAL(HTT_CHAN_CALDATA_MSG_FREQ2, _val); \
  15847. ((_var) |= ((_val) << HTT_CHAN_CALDATA_MSG_FREQ2_S)); \
  15848. } while (0)
  15849. /**
  15850. * @brief target -> host FSE CMEM based send
  15851. *
  15852. * MSG_TYPE => HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND
  15853. *
  15854. * @details
  15855. * HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND message is sent by the target when
  15856. * FSE placement in CMEM is enabled.
  15857. *
  15858. * This message sends the non-secure CMEM base address.
  15859. * It will be sent to host in response to message
  15860. * HTT_H2T_MSG_TYPE_RX_FSE_SETUP_CFG.
  15861. * The message would appear as follows:
  15862. *
  15863. * |31 24|23 16|15 8|7 0|
  15864. * |----------------+----------------+----------------+----------------|
  15865. * | reserved | num_entries | msg_type |
  15866. * |----------------+----------------+----------------+----------------|
  15867. * | base_address_lo |
  15868. * |----------------+----------------+----------------+----------------|
  15869. * | base_address_hi |
  15870. * |-------------------------------------------------------------------|
  15871. *
  15872. * The message is interpreted as follows:
  15873. * dword0 - b'0:7 - msg_type: This will be set to 0x27
  15874. * (HTT_T2H_MSG_TYPE_FSE_CMEM_BASE_SEND)
  15875. * b'8:15 - number_entries: Indicated the number of entries
  15876. * programmed.
  15877. * b'16:31 - reserved.
  15878. * dword1 - b'0:31 - base_address_lo: Indicate lower 32 bits of
  15879. * CMEM base address
  15880. * dword2 - b'0:31 - base_address_hi: Indicate upper 32 bits of
  15881. * CMEM base address
  15882. */
  15883. PREPACK struct htt_cmem_base_send_t {
  15884. A_UINT32 msg_type: 8,
  15885. num_entries: 8,
  15886. reserved: 16;
  15887. A_UINT32 base_address_lo;
  15888. A_UINT32 base_address_hi;
  15889. } POSTPACK;
  15890. #define HTT_CMEM_BASE_SEND_SIZE (sizeof(struct htt_cmem_base_send_t))
  15891. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_M 0x0000FF00
  15892. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_S 8
  15893. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_GET(_var) \
  15894. (((_var) & HTT_CMEM_BASE_SEND_NUM_ENTRIES_M) >> \
  15895. HTT_CMEM_BASE_SEND_NUM_ENTRIES_S)
  15896. #define HTT_CMEM_BASE_SEND_NUM_ENTRIES_SET(_var, _val) \
  15897. do { \
  15898. HTT_CHECK_SET_VAL(HTT_CMEM_BASE_SEND_NUM_ENTRIES, _val); \
  15899. ((_var) |= ((_val) << HTT_SRING_SETUP_DONE_PDEV_ID_S)); \
  15900. } while (0)
  15901. /**
  15902. * @brief - HTT PPDU ID format
  15903. *
  15904. * @details
  15905. * The following field definitions describe the format of the PPDU ID.
  15906. * The PPDU ID is truncated to 24 bits for TLVs from TQM.
  15907. *
  15908. * |31 30|29 24| 23|22 21|20 19|18 17|16 12|11 0|
  15909. * +--------------------------------------------------------------------------
  15910. * |rsvd |seq_cmd_type|tqm_cmd|rsvd |seq_idx|mac_id| hwq_ id | sch id |
  15911. * +--------------------------------------------------------------------------
  15912. *
  15913. * sch id :Schedule command id
  15914. * Bits [11 : 0] : monotonically increasing counter to track the
  15915. * PPDU posted to a specific transmit queue.
  15916. *
  15917. * hwq_id: Hardware Queue ID.
  15918. * Bits [16 : 12] : Indicates the queue id in the hardware transmit queue.
  15919. *
  15920. * mac_id: MAC ID
  15921. * Bits [18 : 17] : LMAC ID obtained from the whal_mac_struct
  15922. *
  15923. * seq_idx: Sequence index.
  15924. * Bits [21 : 19] : Sequence index indicates all the PPDU belonging to
  15925. * a particular TXOP.
  15926. *
  15927. * tqm_cmd: HWSCH/TQM flag.
  15928. * Bit [23] : Always set to 0.
  15929. *
  15930. * seq_cmd_type: Sequence command type.
  15931. * Bit [29 : 24] : Indicates the frame type for the current sequence.
  15932. * Refer to enum HTT_STATS_FTYPE for values.
  15933. */
  15934. PREPACK struct htt_ppdu_id {
  15935. A_UINT32
  15936. sch_id: 12,
  15937. hwq_id: 5,
  15938. mac_id: 2,
  15939. seq_idx: 2,
  15940. reserved1: 2,
  15941. tqm_cmd: 1,
  15942. seq_cmd_type: 6,
  15943. reserved2: 2;
  15944. } POSTPACK;
  15945. #define HTT_PPDU_ID_SCH_ID_S 0
  15946. #define HTT_PPDU_ID_SCH_ID_M 0x00000fff
  15947. #define HTT_PPDU_ID_SCH_ID_GET(_var) \
  15948. (((_var) & HTT_PPDU_ID_SCH_ID_M) >> HTT_PPDU_ID_SCH_ID_S)
  15949. #define HTT_PPDU_ID_SCH_ID_SET(_var, _val) \
  15950. do { \
  15951. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SCH_ID, _val); \
  15952. ((_var) |= ((_val) << HTT_PPDU_ID_SCH_ID_S)); \
  15953. } while (0)
  15954. #define HTT_PPDU_ID_HWQ_ID_S 12
  15955. #define HTT_PPDU_ID_HWQ_ID_M 0x0001f000
  15956. #define HTT_PPDU_ID_HWQ_ID_GET(_var) \
  15957. (((_var) & HTT_PPDU_ID_HWQ_ID_M) >> HTT_PPDU_ID_HWQ_ID_S)
  15958. #define HTT_PPDU_ID_HWQ_ID_SET(_var, _val) \
  15959. do { \
  15960. HTT_CHECK_SET_VAL(HTT_PPDU_ID_HWQ_ID, _val); \
  15961. ((_var) |= ((_val) << HTT_PPDU_ID_HWQ_ID_S)); \
  15962. } while (0)
  15963. #define HTT_PPDU_ID_MAC_ID_S 17
  15964. #define HTT_PPDU_ID_MAC_ID_M 0x00060000
  15965. #define HTT_PPDU_ID_MAC_ID_GET(_var) \
  15966. (((_var) & HTT_PPDU_ID_MAC_ID_M) >> HTT_PPDU_ID_MAC_ID_S)
  15967. #define HTT_PPDU_ID_MAC_ID_SET(_var, _val) \
  15968. do { \
  15969. HTT_CHECK_SET_VAL(HTT_PPDU_ID_MAC_ID, _val); \
  15970. ((_var) |= ((_val) << HTT_PPDU_ID_MAC_ID_S)); \
  15971. } while (0)
  15972. #define HTT_PPDU_ID_SEQ_IDX_S 19
  15973. #define HTT_PPDU_ID_SEQ_IDX_M 0x00180000
  15974. #define HTT_PPDU_ID_SEQ_IDX_GET(_var) \
  15975. (((_var) & HTT_PPDU_ID_SEQ_IDX_M) >> HTT_PPDU_ID_SEQ_IDX_S)
  15976. #define HTT_PPDU_ID_SEQ_IDX_SET(_var, _val) \
  15977. do { \
  15978. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_IDX, _val); \
  15979. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_IDX_S)); \
  15980. } while (0)
  15981. #define HTT_PPDU_ID_TQM_CMD_S 23
  15982. #define HTT_PPDU_ID_TQM_CMD_M 0x00800000
  15983. #define HTT_PPDU_ID_TQM_CMD_GET(_var) \
  15984. (((_var) & HTT_PPDU_ID_TQM_CMD_M) >> HTT_PPDU_ID_TQM_CMD_S)
  15985. #define HTT_PPDU_ID_TQM_CMD_SET(_var, _val) \
  15986. do { \
  15987. HTT_CHECK_SET_VAL(HTT_PPDU_ID_TQM_CMD, _val); \
  15988. ((_var) |= ((_val) << HTT_PPDU_ID_TQM_CMD_S)); \
  15989. } while (0)
  15990. #define HTT_PPDU_ID_SEQ_CMD_TYPE_S 24
  15991. #define HTT_PPDU_ID_SEQ_CMD_TYPE_M 0x3f000000
  15992. #define HTT_PPDU_ID_SEQ_CMD_TYPE_GET(_var) \
  15993. (((_var) & HTT_PPDU_ID_SEQ_CMD_TYPE_M) >> HTT_PPDU_ID_SEQ_CMD_TYPE_S)
  15994. #define HTT_PPDU_ID_SEQ_CMD_TYPE_SET(_var, _val) \
  15995. do { \
  15996. HTT_CHECK_SET_VAL(HTT_PPDU_ID_SEQ_CMD_TYPE, _val); \
  15997. ((_var) |= ((_val) << HTT_PPDU_ID_SEQ_CMD_TYPE_S)); \
  15998. } while (0)
  15999. /**
  16000. * @brief target -> RX PEER METADATA V0 format
  16001. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16002. * message from target, and will confirm to the target which peer metadata
  16003. * version to use in the wmi_init message.
  16004. *
  16005. * The following diagram shows the format of the RX PEER METADATA.
  16006. *
  16007. * |31 24|23 16|15 8|7 0|
  16008. * |-----------------------------------------------------------------------|
  16009. * | Reserved | VDEV ID | PEER ID |
  16010. * |-----------------------------------------------------------------------|
  16011. */
  16012. PREPACK struct htt_rx_peer_metadata_v0 {
  16013. A_UINT32
  16014. peer_id: 16,
  16015. vdev_id: 8,
  16016. reserved1: 8;
  16017. } POSTPACK;
  16018. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_S 0
  16019. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_M 0x0000ffff
  16020. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_GET(_var) \
  16021. (((_var) & HTT_RX_PEER_META_DATA_V0_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V0_PEER_ID_S)
  16022. #define HTT_RX_PEER_META_DATA_V0_PEER_ID_SET(_var, _val) \
  16023. do { \
  16024. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_PEER_ID, _val); \
  16025. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_PEER_ID_S)); \
  16026. } while (0)
  16027. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_S 16
  16028. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_M 0x00ff0000
  16029. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_GET(_var) \
  16030. (((_var) & HTT_RX_PEER_META_DATA_V0_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)
  16031. #define HTT_RX_PEER_META_DATA_V0_VDEV_ID_SET(_var, _val) \
  16032. do { \
  16033. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V0_VDEV_ID, _val); \
  16034. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V0_VDEV_ID_S)); \
  16035. } while (0)
  16036. /**
  16037. * @brief target -> RX PEER METADATA V1 format
  16038. * Host will know the peer metadata version from the wmi_service_ready_ext2
  16039. * message from target, and will confirm to the target which peer metadata
  16040. * version to use in the wmi_init message.
  16041. *
  16042. * The following diagram shows the format of the RX PEER METADATA V1 format.
  16043. *
  16044. * |31 29|28 26|25 24|23 16|15 14| 13 |12 0|
  16045. * |-----------------------------------------------------------------------|
  16046. * |Rsvd2|CHIP ID|LMAC ID| VDEV ID |Rsvd1|ML PEER| SW PEER ID/ML PEER ID|
  16047. * |-----------------------------------------------------------------------|
  16048. */
  16049. PREPACK struct htt_rx_peer_metadata_v1 {
  16050. A_UINT32
  16051. peer_id: 13,
  16052. ml_peer_valid: 1,
  16053. reserved1: 2,
  16054. vdev_id: 8,
  16055. lmac_id: 2,
  16056. chip_id: 3,
  16057. reserved2: 3;
  16058. } POSTPACK;
  16059. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_S 0
  16060. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_M 0x00001fff
  16061. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_GET(_var) \
  16062. (((_var) & HTT_RX_PEER_META_DATA_V1_PEER_ID_M) >> HTT_RX_PEER_META_DATA_V1_PEER_ID_S)
  16063. #define HTT_RX_PEER_META_DATA_V1_PEER_ID_SET(_var, _val) \
  16064. do { \
  16065. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_PEER_ID, _val); \
  16066. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_PEER_ID_S)); \
  16067. } while (0)
  16068. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S 13
  16069. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M 0x00002000
  16070. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_GET(_var) \
  16071. (((_var) & HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_M) >> HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)
  16072. #define HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_SET(_var, _val) \
  16073. do { \
  16074. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID, _val); \
  16075. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_ML_PEER_VALID_S)); \
  16076. } while (0)
  16077. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_S 16
  16078. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_M 0x00ff0000
  16079. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_GET(_var) \
  16080. (((_var) & HTT_RX_PEER_META_DATA_V1_VDEV_ID_M) >> HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)
  16081. #define HTT_RX_PEER_META_DATA_V1_VDEV_ID_SET(_var, _val) \
  16082. do { \
  16083. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_VDEV_ID, _val); \
  16084. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_VDEV_ID_S)); \
  16085. } while (0)
  16086. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_S 24
  16087. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_M 0x03000000
  16088. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_GET(_var) \
  16089. (((_var) & HTT_RX_PEER_META_DATA_V1_LMAC_ID_M) >> HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)
  16090. #define HTT_RX_PEER_META_DATA_V1_LMAC_ID_SET(_var, _val) \
  16091. do { \
  16092. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_LMAC_ID, _val); \
  16093. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_LMAC_ID_S)); \
  16094. } while (0)
  16095. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_S 26
  16096. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_M 0x1c000000
  16097. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_GET(_var) \
  16098. (((_var) & HTT_RX_PEER_META_DATA_V1_CHIP_ID_M) >> HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)
  16099. #define HTT_RX_PEER_META_DATA_V1_CHIP_ID_SET(_var, _val) \
  16100. do { \
  16101. HTT_CHECK_SET_VAL(HTT_RX_PEER_META_DATA_V1_CHIP_ID, _val); \
  16102. ((_var) |= ((_val) << HTT_RX_PEER_META_DATA_V1_CHIP_ID_S)); \
  16103. } while (0)
  16104. /*
  16105. * In some systems, the host SW wants to specify priorities between
  16106. * different MSDU / flow queues within the same peer-TID.
  16107. * The below enums are used for the host to identify to the target
  16108. * which MSDU queue's priority it wants to adjust.
  16109. */
  16110. /*
  16111. * The MSDUQ index describe index of TCL HW, where each index is
  16112. * used for queuing particular types of MSDUs.
  16113. * The different MSDU queue types are defined in HTT_MSDU_QTYPE.
  16114. */
  16115. enum HTT_MSDUQ_INDEX {
  16116. HTT_MSDUQ_INDEX_NON_UDP, /* NON UDP MSDUQ index */
  16117. HTT_MSDUQ_INDEX_UDP, /* UDP MSDUQ index */
  16118. HTT_MSDUQ_INDEX_CUSTOM_PRIO_0, /* Latency priority 0 index */
  16119. HTT_MSDUQ_INDEX_CUSTOM_PRIO_1, /* Latency priority 1 index */
  16120. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_0, /* High num TID cases/ MLO dedicate link cases */
  16121. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_1, /* High num TID cases/ MLO dedicate link cases */
  16122. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_2, /* High num TID cases/ MLO dedicate link cases */
  16123. HTT_MSDUQ_INDEX_CUSTOM_EXT_PRIO_3, /* High num TID cases/ MLO dedicate link cases */
  16124. HTT_MSDUQ_MAX_INDEX,
  16125. };
  16126. /* MSDU qtype definition */
  16127. enum HTT_MSDU_QTYPE {
  16128. /*
  16129. * The LATENCY_CRIT_0 and LATENCY_CRIT_1 queue types don't have a fixed
  16130. * relative priority. Instead, the relative priority of CRIT_0 versus
  16131. * CRIT_1 is controlled by the FW, through the configuration parameters
  16132. * it applies to the queues.
  16133. */
  16134. HTT_MSDU_QTYPE_LATENCY_CRIT_0, /* Specified MSDUQ index used for latency critical 0 */
  16135. HTT_MSDU_QTYPE_LATENCY_CRIT_1, /* Specified MSDUQ index used for latency critical 1 */
  16136. HTT_MSDU_QTYPE_UDP, /* Specifies MSDUQ index used for UDP flow */
  16137. HTT_MSDU_QTYPE_NON_UDP, /* Specifies MSDUQ index used for non-udp flow */
  16138. HTT_MSDU_QTYPE_HOL, /* Specified MSDUQ index used for Head of Line */
  16139. HTT_MSDU_QTYPE_USER_SPECIFIED, /* Specifies MSDUQ index used for advertising changeable flow type */
  16140. HTT_MSDU_QTYPE_HI_PRIO, /* Specifies MSDUQ index used for high priority flow type */
  16141. HTT_MSDU_QTYPE_LO_PRIO, /* Specifies MSDUQ index used for low priority flow type */
  16142. /* New MSDU_QTYPE should be added above this line */
  16143. /*
  16144. * Below QTYPE_MAX will increase if additional QTYPEs are defined
  16145. * in the future. Hence HTT_MSDU_QTYPE_MAX can't be used in
  16146. * any host/target message definitions. The QTYPE_MAX value can
  16147. * only be used internally within the host or within the target.
  16148. * If host or target find a qtype value is >= HTT_MSDU_QTYPE_MAX
  16149. * it must regard the unexpected value as a default qtype value,
  16150. * or ignore it.
  16151. */
  16152. HTT_MSDU_QTYPE_MAX,
  16153. HTT_MSDU_QTYPE_NOT_IN_USE = 255, /* corresponding MSDU index is not in use */
  16154. };
  16155. enum HTT_MSDUQ_LEGACY_FLOW_INDEX {
  16156. HTT_MSDUQ_LEGACY_HI_PRI_FLOW_INDEX = 0,
  16157. HTT_MSDUQ_LEGACY_LO_PRI_FLOW_INDEX = 1,
  16158. HTT_MSDUQ_LEGACY_UDP_FLOW_INDEX = 2,
  16159. HTT_MSDUQ_LEGACY_NON_UDP_FLOW_INDEX = 3,
  16160. };
  16161. /**
  16162. * @brief target -> host mlo timestamp offset indication
  16163. *
  16164. * MSG_TYPE => HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16165. *
  16166. * @details
  16167. * The following field definitions describe the format of the HTT target
  16168. * to host mlo timestamp offset indication message.
  16169. *
  16170. *
  16171. * |31 16|15 12|11 10|9 8|7 0 |
  16172. * |----------------------------------------------------------------------|
  16173. * | mac_clk_freq_mhz | rsvd |chip_id|pdev_id| msg type |
  16174. * |----------------------------------------------------------------------|
  16175. * | Sync time stamp lo in us |
  16176. * |----------------------------------------------------------------------|
  16177. * | Sync time stamp hi in us |
  16178. * |----------------------------------------------------------------------|
  16179. * | mlo time stamp offset lo in us |
  16180. * |----------------------------------------------------------------------|
  16181. * | mlo time stamp offset hi in us |
  16182. * |----------------------------------------------------------------------|
  16183. * | mlo time stamp offset clocks in clock ticks |
  16184. * |----------------------------------------------------------------------|
  16185. * |31 26|25 16|15 0 |
  16186. * |rsvd2 | mlo time stamp | mlo time stamp compensation in us |
  16187. * | | compensation in clks | |
  16188. * |----------------------------------------------------------------------|
  16189. * |31 22|21 0 |
  16190. * | rsvd 3 | mlo time stamp comp timer period |
  16191. * |----------------------------------------------------------------------|
  16192. * The message is interpreted as follows:
  16193. *
  16194. * dword0 - b'0:7 - msg_type: This will be set to
  16195. * HTT_T2H_MSG_TYPE_MLO_TIMESTAMP_OFFSET_IND
  16196. * value: 0x28
  16197. *
  16198. * dword0 - b'9:8 - pdev_id
  16199. *
  16200. * dword0 - b'11:10 - chip_id
  16201. *
  16202. * dword0 - b'15:12 - rsvd1: Reserved for future use
  16203. *
  16204. * dword0 - b'31:16 - mac clock frequency of the mac HW block in MHz
  16205. *
  16206. * dword1 - b'31:0 - lower 32 bits of the WLAN global time stamp (in us) at
  16207. * which last sync interrupt was received
  16208. *
  16209. * dword2 - b'31:0 - upper 32 bits of the WLAN global time stamp (in us) at
  16210. * which last sync interrupt was received
  16211. *
  16212. * dword3 - b'31:0 - lower 32 bits of the MLO time stamp offset in us
  16213. *
  16214. * dword4 - b'31:0 - upper 32 bits of the MLO time stamp offset in us
  16215. *
  16216. * dword5 - b'31:0 - MLO time stamp offset in clock ticks for sub us
  16217. *
  16218. * dword6 - b'15:0 - MLO time stamp compensation applied in us
  16219. *
  16220. * dword6 - b'25:16 - MLO time stamp compensation applied in clock ticks
  16221. * for sub us resolution
  16222. *
  16223. * dword6 - b'31:26 - rsvd2: Reserved for future use
  16224. *
  16225. * dword7 - b'21:0 - period of MLO compensation timer at which compensation
  16226. * is applied, in us
  16227. *
  16228. * dword7 - b'31:22 - rsvd3: Reserved for future use
  16229. */
  16230. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M 0x000000FF
  16231. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S 0
  16232. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M 0x00000300
  16233. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S 8
  16234. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M 0x00000C00
  16235. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S 10
  16236. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M 0xFFFF0000
  16237. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S 16
  16238. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M 0x0000FFFF
  16239. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S 0
  16240. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M 0x03FF0000
  16241. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S 16
  16242. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M 0x003FFFFF
  16243. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S 0
  16244. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_GET(_var) \
  16245. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)
  16246. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_SET(_var, _val) \
  16247. do { \
  16248. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE, _val); \
  16249. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MSG_TYPE_S)); \
  16250. } while (0)
  16251. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_GET(_var) \
  16252. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)
  16253. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_SET(_var, _val) \
  16254. do { \
  16255. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID, _val); \
  16256. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_PDEV_ID_S)); \
  16257. } while (0)
  16258. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_GET(_var) \
  16259. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_M) >> HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)
  16260. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_SET(_var, _val) \
  16261. do { \
  16262. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID, _val); \
  16263. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_CHIP_ID_S)); \
  16264. } while (0)
  16265. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_GET(_var) \
  16266. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_M) >> \
  16267. HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)
  16268. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_SET(_var, _val) \
  16269. do { \
  16270. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ, _val); \
  16271. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MAC_CLK_FREQ_MHZ_S)); \
  16272. } while (0)
  16273. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_GET(_var) \
  16274. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_M) >> \
  16275. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)
  16276. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_SET(_var, _val) \
  16277. do { \
  16278. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US, _val); \
  16279. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_US_S)); \
  16280. } while (0)
  16281. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_GET(_var) \
  16282. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_M) >> \
  16283. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)
  16284. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_SET(_var, _val) \
  16285. do { \
  16286. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS, _val); \
  16287. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_CLKS_S)); \
  16288. } while (0)
  16289. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_GET(_var) \
  16290. (((_var) & HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_M) >> \
  16291. HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)
  16292. #define HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_SET(_var, _val) \
  16293. do { \
  16294. HTT_CHECK_SET_VAL(HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US, _val); \
  16295. ((_var) |= ((_val) << HTT_T2H_MLO_TIMESTAMP_OFFSET_MLO_TIMESTAMP_COMP_PERIOD_US_S)); \
  16296. } while (0)
  16297. typedef struct {
  16298. A_UINT32 msg_type: 8, /* bits 7:0 */
  16299. pdev_id: 2, /* bits 9:8 */
  16300. chip_id: 2, /* bits 11:10 */
  16301. reserved1: 4, /* bits 15:12 */
  16302. mac_clk_freq_mhz: 16; /* bits 31:16 */
  16303. A_UINT32 sync_timestamp_lo_us;
  16304. A_UINT32 sync_timestamp_hi_us;
  16305. A_UINT32 mlo_timestamp_offset_lo_us;
  16306. A_UINT32 mlo_timestamp_offset_hi_us;
  16307. A_UINT32 mlo_timestamp_offset_clks;
  16308. A_UINT32 mlo_timestamp_comp_us: 16, /* bits 15:0 */
  16309. mlo_timestamp_comp_clks: 10, /* bits 25:16 */
  16310. reserved2: 6; /* bits 31:26 */
  16311. A_UINT32 mlo_timestamp_comp_timer_period_us: 22, /* bits 21:0 */
  16312. reserved3: 10; /* bits 31:22 */
  16313. } htt_t2h_mlo_offset_ind_t;
  16314. /*
  16315. * @brief target -> host VDEV TX RX STATS
  16316. *
  16317. * MSG_TYPE => HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND
  16318. *
  16319. * @details
  16320. * HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message is sent by the target
  16321. * every periodic interval programmed in HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG.
  16322. * After the host sends an initial HTT_H2T_MSG_TYPE_VDEVS_TXRX_STATS_CFG,
  16323. * this HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND message will be sent
  16324. * periodically by target even in the absence of any further HTT request
  16325. * messages from host.
  16326. *
  16327. * The message is formatted as follows:
  16328. *
  16329. * |31 16|15 8|7 0|
  16330. * |---------------------------------+----------------+----------------|
  16331. * | payload_size | pdev_id | msg_type |
  16332. * |---------------------------------+----------------+----------------|
  16333. * | reserved0 |
  16334. * |-------------------------------------------------------------------|
  16335. * | reserved1 |
  16336. * |-------------------------------------------------------------------|
  16337. * | reserved2 |
  16338. * |-------------------------------------------------------------------|
  16339. * | |
  16340. * | VDEV specific Tx Rx stats info |
  16341. * | |
  16342. * |-------------------------------------------------------------------|
  16343. *
  16344. * The message is interpreted as follows:
  16345. * dword0 - b'0:7 - msg_type: This will be set to 0x2c
  16346. * (HTT_T2H_MSG_TYPE_VDEVS_TXRX_STATS_PERIODIC_IND)
  16347. * b'8:15 - pdev_id
  16348. * b'16:31 - size in bytes of the payload that follows the 16-byte
  16349. * message header fields (msg_type through reserved2)
  16350. * dword1 - b'0:31 - reserved0.
  16351. * dword2 - b'0:31 - reserved1.
  16352. * dword3 - b'0:31 - reserved2.
  16353. */
  16354. typedef struct {
  16355. A_UINT32 msg_type: 8,
  16356. pdev_id: 8,
  16357. payload_size: 16;
  16358. A_UINT32 reserved0;
  16359. A_UINT32 reserved1;
  16360. A_UINT32 reserved2;
  16361. } htt_t2h_vdevs_txrx_stats_periodic_hdr_t;
  16362. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_HDR_SIZE 16
  16363. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M 0x0000FF00
  16364. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S 8
  16365. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_GET(_var) \
  16366. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)
  16367. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_SET(_var, _val) \
  16368. do { \
  16369. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID, _val); \
  16370. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PDEV_ID_S)); \
  16371. } while (0)
  16372. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M 0xFFFF0000
  16373. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S 16
  16374. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_GET(_var) \
  16375. (((_var) & HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_M) >> HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)
  16376. #define HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_SET(_var, _val) \
  16377. do { \
  16378. HTT_CHECK_SET_VAL(HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE, _val); \
  16379. ((_var) |= ((_val) << HTT_T2H_VDEVS_TXRX_STATS_PERIODIC_IND_PAYLOAD_SIZE_S)); \
  16380. } while (0)
  16381. /* SOC related stats */
  16382. typedef struct {
  16383. htt_tlv_hdr_t tlv_hdr;
  16384. /* When TQM is not able to find the peers during Tx, then it drops the packets
  16385. * This can be due to either the peer is deleted or deletion is ongoing
  16386. * */
  16387. A_UINT32 inv_peers_msdu_drop_count_lo;
  16388. A_UINT32 inv_peers_msdu_drop_count_hi;
  16389. } htt_t2h_soc_txrx_stats_common_tlv;
  16390. /* VDEV HW Tx/Rx stats */
  16391. typedef struct {
  16392. htt_tlv_hdr_t tlv_hdr;
  16393. A_UINT32 vdev_id;
  16394. /* Rx msdu byte cnt */
  16395. A_UINT32 rx_msdu_byte_cnt_lo;
  16396. A_UINT32 rx_msdu_byte_cnt_hi;
  16397. /* Rx msdu cnt */
  16398. A_UINT32 rx_msdu_cnt_lo;
  16399. A_UINT32 rx_msdu_cnt_hi;
  16400. /* tx msdu byte cnt */
  16401. A_UINT32 tx_msdu_byte_cnt_lo;
  16402. A_UINT32 tx_msdu_byte_cnt_hi;
  16403. /* tx msdu cnt */
  16404. A_UINT32 tx_msdu_cnt_lo;
  16405. A_UINT32 tx_msdu_cnt_hi;
  16406. /* tx excessive retry discarded msdu cnt */
  16407. A_UINT32 tx_msdu_excessive_retry_discard_cnt_lo;
  16408. A_UINT32 tx_msdu_excessive_retry_discard_cnt_hi;
  16409. /* TX congestion ctrl msdu drop cnt */
  16410. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_lo;
  16411. A_UINT32 tx_msdu_cong_ctrl_drop_cnt_hi;
  16412. /* discarded tx msdus cnt coz of time to live expiry */
  16413. A_UINT32 tx_msdu_ttl_expire_drop_cnt_lo;
  16414. A_UINT32 tx_msdu_ttl_expire_drop_cnt_hi;
  16415. /* tx excessive retry discarded msdu byte cnt */
  16416. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_lo;
  16417. A_UINT32 tx_msdu_excessive_retry_discard_byte_cnt_hi;
  16418. /* TX congestion ctrl msdu drop byte cnt */
  16419. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_lo;
  16420. A_UINT32 tx_msdu_cong_ctrl_drop_byte_cnt_hi;
  16421. /* discarded tx msdus byte cnt coz of time to live expiry */
  16422. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_lo;
  16423. A_UINT32 tx_msdu_ttl_expire_drop_byte_cnt_hi;
  16424. /* TQM bypass frame cnt */
  16425. A_UINT32 tqm_bypass_frame_cnt_lo;
  16426. A_UINT32 tqm_bypass_frame_cnt_hi;
  16427. /* TQM bypass byte cnt */
  16428. A_UINT32 tqm_bypass_byte_cnt_lo;
  16429. A_UINT32 tqm_bypass_byte_cnt_hi;
  16430. } htt_t2h_vdev_txrx_stats_hw_stats_tlv;
  16431. /*
  16432. * MSG_TYPE => HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF
  16433. *
  16434. * @details
  16435. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF message is sent by the target in
  16436. * response to a SAWF_DEF_QUEUES_MAP_REPORT_REQ from the host.
  16437. * The SAWF_DEF_QUEUES_MAP_REPORT_CONF will show which service class
  16438. * the default MSDU queues of each of the specified TIDs for the peer
  16439. * specified in the SAWF_DEF_QUEUES_MAP_REPORT_REQ message are linked to.
  16440. * If the default MSDU queues of a given TID within the peer are not linked
  16441. * to a service class, the svc_class_id field for that TID will have a
  16442. * 0xff HTT_SAWF_SVC_CLASS_INVALID_ID value to indicate the default MSDU
  16443. * queues for that TID are not mapped to any service class.
  16444. *
  16445. * |31 16|15 8|7 0|
  16446. * |------------------------------+--------------+--------------|
  16447. * | peer ID | reserved | msg type |
  16448. * |------------------------------+--------------+------+-------|
  16449. * | reserved | svc class ID | TID |
  16450. * |------------------------------------------------------------|
  16451. * ...
  16452. * |------------------------------------------------------------|
  16453. * | reserved | svc class ID | TID |
  16454. * |------------------------------------------------------------|
  16455. * Header fields:
  16456. * dword0 - b'7:0 - msg_type: This will be set to
  16457. * 0x2d (HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF)
  16458. * b'31:16 - peer ID
  16459. * dword1 - b'7:0 - TID
  16460. * b'15:8 - svc class ID
  16461. * (dword2, etc. same format as dword1)
  16462. */
  16463. #define HTT_SAWF_SVC_CLASS_INVALID_ID 0xff
  16464. PREPACK struct htt_t2h_sawf_def_queues_map_report_conf {
  16465. A_UINT32 msg_type :8,
  16466. reserved0 :8,
  16467. peer_id :16;
  16468. struct {
  16469. A_UINT32 tid :8,
  16470. svc_class_id :8,
  16471. reserved1 :16;
  16472. } tid_reports[1/*or more*/];
  16473. } POSTPACK;
  16474. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_HDR_BYTES 4 /* msg_type, peer_id */
  16475. #define HTT_SAWF_DEF_QUEUES_MAP_REPORT_CONF_ELEM_BYTES 4 /* TID, svc_class_id */
  16476. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M 0xFFFF0000
  16477. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S 16
  16478. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_GET(_var) \
  16479. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_M) >> \
  16480. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)
  16481. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_SET(_var, _val) \
  16482. do { \
  16483. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID, _val); \
  16484. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_PEER_ID_S)); \
  16485. } while (0)
  16486. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M 0x000000FF
  16487. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S 0
  16488. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_GET(_var) \
  16489. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_M) >> \
  16490. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)
  16491. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_SET(_var, _val) \
  16492. do { \
  16493. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID, _val); \
  16494. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_TID_S)); \
  16495. } while (0)
  16496. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M 0x0000FF00
  16497. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S 8
  16498. #define HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_GET(_var) \
  16499. (((_var) & HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_M) >> \
  16500. HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)
  16501. #define HTT_RX_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_SET(_var, _val) \
  16502. do { \
  16503. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID, _val); \
  16504. ((_var) |= ((_val) << HTT_T2H_SAWF_DEF_QUEUES_MAP_REPORT_CONF_SVC_CLASS_ID_S)); \
  16505. } while (0)
  16506. /*
  16507. * MSG_TYPE => HTT_T2H_SAWF_MSDUQ_INFO_IND
  16508. *
  16509. * @details
  16510. * When SAWF is enabled and a flow is mapped to a policy during the traffic
  16511. * flow if the flow is seen the associated service class is conveyed to the
  16512. * target via TCL Data Command. Target on the other hand internally creates the
  16513. * MSDUQ. Once the target creates the MSDUQ the target sends the information
  16514. * of the newly created MSDUQ and some other identifiers to uniquely identity
  16515. * the newly created MSDUQ
  16516. *
  16517. * |31 27| 24|23 16|15|14 11|10|9 8|7 4|3 0|
  16518. * |------------------------------+------------------------+--------------|
  16519. * | peer ID | HTT qtype | msg type |
  16520. * |---------------------------------+--------------+--+---+-------+------|
  16521. * | reserved |AST list index|FO|WC | HLOS | remap|
  16522. * | | | | | TID | TID |
  16523. * |---------------------+------------------------------------------------|
  16524. * | reserved1 | tgt_opaque_id |
  16525. * |---------------------+------------------------------------------------|
  16526. *
  16527. * Header fields:
  16528. *
  16529. * dword0 - b'7:0 - msg_type: This will be set to
  16530. * 0x2e (HTT_T2H_SAWF_MSDUQ_INFO_IND)
  16531. * b'15:8 - HTT qtype
  16532. * b'31:16 - peer ID
  16533. *
  16534. * dword1 - b'3:0 - remap TID, as assigned in firmware
  16535. * b'7:4 - HLOS TID, as sent by host in TCL Data Command
  16536. * hlos_tid : Common to Lithium and Beryllium
  16537. * b'9:8 - who_classify_info_sel (WC), as sent by host in
  16538. * TCL Data Command : Beryllium
  16539. * b10 - flow_override (FO), as sent by host in
  16540. * TCL Data Command: Beryllium
  16541. * b11:14 - ast_list_idx
  16542. * Array index into the list of extension AST entries
  16543. * (not the actual AST 16-bit index).
  16544. * The ast_list_idx is one-based, with the following
  16545. * range of values:
  16546. * - legacy targets supporting 16 user-defined
  16547. * MSDU queues: 1-2
  16548. * - legacy targets supporting 48 user-defined
  16549. * MSDU queues: 1-6
  16550. * - new targets: 0 (peer_id is used instead)
  16551. * Note that since ast_list_idx is one-based,
  16552. * the host will need to subtract 1 to use it as an
  16553. * index into a list of extension AST entries.
  16554. * b15:31 - reserved
  16555. *
  16556. * dword2 - b'23:0 - tgt_opaque_id Opaque Tx flow number which is a
  16557. * unique MSDUQ id in firmware
  16558. * b'24:31 - reserved1
  16559. */
  16560. PREPACK struct htt_t2h_sawf_msduq_event {
  16561. A_UINT32 msg_type : 8,
  16562. htt_qtype : 8,
  16563. peer_id :16;
  16564. A_UINT32 remap_tid : 4,
  16565. hlos_tid : 4,
  16566. who_classify_info_sel : 2,
  16567. flow_override : 1,
  16568. ast_list_idx : 4,
  16569. reserved :17;
  16570. A_UINT32 tgt_opaque_id :24,
  16571. reserved1 : 8;
  16572. } POSTPACK;
  16573. #define HTT_SAWF_MSDUQ_INFO_SIZE (sizeof(struct htt_t2h_sawf_msduq_event))
  16574. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M 0x0000FF00
  16575. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S 8
  16576. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_GET(_var) \
  16577. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_M) >> \
  16578. HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S)
  16579. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_SET(_var, _val) \
  16580. do { \
  16581. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE, _val); \
  16582. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_QTYPE_S));\
  16583. } while (0)
  16584. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M 0xFFFF0000
  16585. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S 16
  16586. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_GET(_var) \
  16587. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_M) >> \
  16588. HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)
  16589. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_SET(_var, _val) \
  16590. do { \
  16591. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID, _val); \
  16592. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_PEER_ID_S)); \
  16593. } while (0)
  16594. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M 0x0000000F
  16595. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S 0
  16596. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_GET(_var) \
  16597. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_M) >> \
  16598. HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)
  16599. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_SET(_var, _val) \
  16600. do { \
  16601. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID, _val); \
  16602. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_REMAP_TID_S)); \
  16603. } while (0)
  16604. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M 0x000000F0
  16605. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S 4
  16606. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_GET(_var) \
  16607. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_M) >> \
  16608. HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)
  16609. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_SET(_var, _val) \
  16610. do { \
  16611. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID, _val); \
  16612. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_HLOS_TID_S)); \
  16613. } while (0)
  16614. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M 0x00000300
  16615. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S 8
  16616. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_GET(_var) \
  16617. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_M) >> \
  16618. HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)
  16619. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_SET(_var, _val) \
  16620. do { \
  16621. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL, _val); \
  16622. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_WHO_CLASS_INFO_SEL_S)); \
  16623. } while (0)
  16624. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M 0x00000400
  16625. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S 10
  16626. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_GET(_var) \
  16627. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_M) >> \
  16628. HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)
  16629. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_SET(_var, _val) \
  16630. do { \
  16631. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE, _val); \
  16632. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_FLOW_OVERRIDE_S)); \
  16633. } while (0)
  16634. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M 0x00007800
  16635. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S 11
  16636. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_GET(_var) \
  16637. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_M) >> \
  16638. HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)
  16639. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_SET(_var, _val) \
  16640. do { \
  16641. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX, _val); \
  16642. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_AST_LIST_IDX_S)); \
  16643. } while (0)
  16644. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_M 0x00FFFFFF
  16645. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S 0
  16646. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_GET(_var) \
  16647. (((_var) & HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID) >> \
  16648. HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)
  16649. #define HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_SET(_var, _val) \
  16650. do { \
  16651. HTT_CHECK_SET_VAL(HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID, _val); \
  16652. ((_var) |= ((_val) << HTT_T2H_SAWF_MSDUQ_INFO_HTT_TGT_OPAQUE_ID_S)); \
  16653. } while (0)
  16654. /**
  16655. * @brief target -> PPDU id format indication
  16656. *
  16657. * MSG_TYPE => HTT_T2H_PPDU_ID_FMT_IND
  16658. *
  16659. * @details
  16660. * The following field definitions describe the format of the HTT target
  16661. * to host PPDU ID format indication message.
  16662. * hwsch_cmd_id :- A number per ring, increases by one with each HWSCH command.
  16663. * ring_id :- HWSCH ring id in which this PPDU was enqueued.
  16664. * seq_idx :- Sequence control index of this PPDU.
  16665. * link_id :- HW link ID of the link in which the PPDU was enqueued.
  16666. * seq_cmd_type:- WHAL_TXSEND_FTYPE (SU Data, MU Data, SGEN frames etc.)
  16667. * tqm_cmd:-
  16668. *
  16669. * |31 27|26 22|21 17| 16 |15 11|10 8|7 6|5 1| 0 |
  16670. * |--------------------------------------------------+------------------------|
  16671. * | rsvd0 | msg type |
  16672. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16673. * |rsvd2|ring_id OF|ring_id NB|ring_id V|rsvd1|cmd_id OF |cmd_id NB |cmd_id V |
  16674. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16675. * |rsvd4|link_id OF|link_id NB|link_id V|rsvd3|seq_idx OF|seq_idx NB|seq_idx V|
  16676. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16677. * |rsvd6|tqm_cmd OF|tqm_cmd NB|tqm_cmd V|rsvd5|seq_cmd OF|seq_cmd NB|seq_cmd V|
  16678. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16679. * |rsvd8| crc OF | crc NB | crc V |rsvd7|mac_id OF |mac_id NB |mac_id V |
  16680. * |-----+----------+----------+---------+-----+----------+----------+---------|
  16681. * Where: OF = bit offset, NB = number of bits, V = valid
  16682. * The message is interpreted as follows:
  16683. *
  16684. * dword0 - b'7:0 - msg_type: This will be set to
  16685. * HTT_T2H_PPDU_ID_FMT_IND
  16686. * value: 0x30
  16687. *
  16688. * dword0 - b'31:8 - reserved
  16689. *
  16690. * dword1 - b'0:0 - field to indicate whether hwsch_cmd_id is valid or not
  16691. *
  16692. * dword1 - b'5:1 - number of bits in hwsch_cmd_id
  16693. *
  16694. * dword1 - b'10:6 - offset of hwsch_cmd_id (in number of bits)
  16695. *
  16696. * dword1 - b'15:11 - reserved for future use
  16697. *
  16698. * dword1 - b'16:16 - field to indicate whether ring_id is valid or not
  16699. *
  16700. * dword1 - b'21:17 - number of bits in ring_id
  16701. *
  16702. * dword1 - b'26:22 - offset of ring_id (in number of bits)
  16703. *
  16704. * dword1 - b'31:27 - reserved for future use
  16705. *
  16706. * dword2 - b'0:0 - field to indicate whether sequence index is valid or not
  16707. *
  16708. * dword2 - b'5:1 - number of bits in sequence index
  16709. *
  16710. * dword2 - b'10:6 - offset of sequence index (in number of bits)
  16711. *
  16712. * dword2 - b'15:11 - reserved for future use
  16713. *
  16714. * dword2 - b'16:16 - field to indicate whether link_id is valid or not
  16715. *
  16716. * dword2 - b'21:17 - number of bits in link_id
  16717. *
  16718. * dword2 - b'26:22 - offset of link_id (in number of bits)
  16719. *
  16720. * dword2 - b'31:27 - reserved for future use
  16721. *
  16722. * dword3 - b'0:0 - field to indicate whether seq_cmd_type is valid or not
  16723. *
  16724. * dword3 - b'5:1 - number of bits in seq_cmd_type
  16725. *
  16726. * dword3 - b'10:6 - offset of seq_cmd_type (in number of bits)
  16727. *
  16728. * dword3 - b'15:11 - reserved for future use
  16729. *
  16730. * dword3 - b'16:16 - field to indicate whether tqm_cmd is valid or not
  16731. *
  16732. * dword3 - b'21:17 - number of bits in tqm_cmd
  16733. *
  16734. * dword3 - b'26:22 - offset of tqm_cmd (in number of bits)
  16735. *
  16736. * dword3 - b'31:27 - reserved for future use
  16737. *
  16738. * dword4 - b'0:0 - field to indicate whether mac_id is valid or not
  16739. *
  16740. * dword4 - b'5:1 - number of bits in mac_id
  16741. *
  16742. * dword4 - b'10:6 - offset of mac_id (in number of bits)
  16743. *
  16744. * dword4 - b'15:11 - reserved for future use
  16745. *
  16746. * dword4 - b'16:16 - field to indicate whether crc is valid or not
  16747. *
  16748. * dword4 - b'21:17 - number of bits in crc
  16749. *
  16750. * dword4 - b'26:22 - offset of crc (in number of bits)
  16751. *
  16752. * dword4 - b'31:27 - reserved for future use
  16753. *
  16754. */
  16755. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M 0x00000001
  16756. #define HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S 0
  16757. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M 0x0000003E
  16758. #define HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S 1
  16759. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M 0x000007C0
  16760. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S 6
  16761. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M 0x00010000
  16762. #define HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S 16
  16763. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M 0x003E0000
  16764. #define HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S 17
  16765. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M 0x07C00000
  16766. #define HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S 22
  16767. /* macros for accessing lower 16 bits in dword */
  16768. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0(word, value) \
  16769. do { \
  16770. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS15_0, value); \
  16771. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S; \
  16772. } while (0)
  16773. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS15_0(word) \
  16774. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS15_0_S)
  16775. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0(word, value) \
  16776. do { \
  16777. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS15_0, value); \
  16778. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S; \
  16779. } while (0)
  16780. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS15_0(word) \
  16781. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS15_0_S)
  16782. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0(word, value) \
  16783. do { \
  16784. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0, value); \
  16785. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S; \
  16786. } while (0)
  16787. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS15_0(word) \
  16788. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS15_0_S)
  16789. /* macros for accessing upper 16 bits in dword */
  16790. #define HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16(word, value) \
  16791. do { \
  16792. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_VALID_BITS31_16, value); \
  16793. (word) |= (value) << HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S; \
  16794. } while (0)
  16795. #define HTT_PPDU_ID_FMT_IND_VALID_GET_BITS31_16(word) \
  16796. (((word) & HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_VALID_BITS31_16_S)
  16797. #define HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16(word, value) \
  16798. do { \
  16799. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_BITS_BITS31_16, value); \
  16800. (word) |= (value) << HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S; \
  16801. } while (0)
  16802. #define HTT_PPDU_ID_FMT_IND_BITS_GET_BITS31_16(word) \
  16803. (((word) & HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_BITS_BITS31_16_S)
  16804. #define HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16(word, value) \
  16805. do { \
  16806. HTT_CHECK_SET_VAL(HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16, value); \
  16807. (word) |= (value) << HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S; \
  16808. } while (0)
  16809. #define HTT_PPDU_ID_FMT_IND_OFFSET_GET_BITS31_16(word) \
  16810. (((word) & HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_M) >> HTT_PPDU_ID_FMT_IND_OFFSET_BITS31_16_S)
  16811. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_VALID_SET \
  16812. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  16813. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_BITS_SET \
  16814. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  16815. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET_SET \
  16816. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  16817. #define HTT_PPDU_ID_FMT_IND_RING_ID_VALID_SET \
  16818. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  16819. #define HTT_PPDU_ID_FMT_IND_RING_ID_BITS_SET \
  16820. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  16821. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET_SET \
  16822. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  16823. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_VALID_SET \
  16824. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  16825. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_BITS_SET \
  16826. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  16827. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET_SET \
  16828. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  16829. #define HTT_PPDU_ID_FMT_IND_LINK_ID_VALID_SET \
  16830. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  16831. #define HTT_PPDU_ID_FMT_IND_LINK_ID_BITS_SET \
  16832. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  16833. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET_SET \
  16834. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  16835. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_VALID_SET \
  16836. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  16837. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_BITS_SET \
  16838. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  16839. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET_SET \
  16840. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  16841. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_VALID_SET \
  16842. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  16843. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_BITS_SET \
  16844. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  16845. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET_SET \
  16846. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  16847. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_VALID_SET \
  16848. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS15_0
  16849. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_BITS_SET \
  16850. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS15_0
  16851. #define HTT_PPDU_ID_FMT_IND_MAC_ID_TYPE_OFFSET_SET \
  16852. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS15_0
  16853. #define HTT_PPDU_ID_FMT_IND_CRC_VALID_SET \
  16854. HTT_PPDU_ID_FMT_IND_VALID_SET_BITS31_16
  16855. #define HTT_PPDU_ID_FMT_IND_CRC_BITS_SET \
  16856. HTT_PPDU_ID_FMT_IND_BITS_SET_BITS31_16
  16857. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET_SET \
  16858. HTT_PPDU_ID_FMT_IND_OFFSET_SET_BITS31_16
  16859. /* offsets in number dwords */
  16860. #define HTT_PPDU_ID_FMT_IND_HWSCH_CMD_ID_OFFSET 1
  16861. #define HTT_PPDU_ID_FMT_IND_RING_ID_OFFSET 1
  16862. #define HTT_PPDU_ID_FMT_IND_SEQ_IDX_OFFSET 2
  16863. #define HTT_PPDU_ID_FMT_IND_LINK_ID_OFFSET 2
  16864. #define HTT_PPDU_ID_FMT_IND_SEQ_CMD_TYPE_OFFSET 3
  16865. #define HTT_PPDU_ID_FMT_IND_TQM_CMD_OFFSET 3
  16866. #define HTT_PPDU_ID_FMT_IND_MAC_ID_OFFSET 4
  16867. #define HTT_PPDU_ID_FMT_IND_CRC_OFFSET 4
  16868. typedef struct {
  16869. A_UINT32 msg_type: 8, /* bits 7:0 */
  16870. rsvd0: 24;/* bits 31:8 */
  16871. A_UINT32 hwsch_cmd_id_valid: 1, /* bits 0:0 */
  16872. hwsch_cmd_id_bits: 5, /* bits 5:1 */
  16873. hwsch_cmd_id_offset: 5, /* bits 10:6 */
  16874. rsvd1: 5, /* bits 15:11 */
  16875. ring_id_valid: 1, /* bits 16:16 */
  16876. ring_id_bits: 5, /* bits 21:17 */
  16877. ring_id_offset: 5, /* bits 26:22 */
  16878. rsvd2: 5; /* bits 31:27 */
  16879. A_UINT32 seq_idx_valid: 1, /* bits 0:0 */
  16880. seq_idx_bits: 5, /* bits 5:1 */
  16881. seq_idx_offset: 5, /* bits 10:6 */
  16882. rsvd3: 5, /* bits 15:11 */
  16883. link_id_valid: 1, /* bits 16:16 */
  16884. link_id_bits: 5, /* bits 21:17 */
  16885. link_id_offset: 5, /* bits 26:22 */
  16886. rsvd4: 5; /* bits 31:27 */
  16887. A_UINT32 seq_cmd_type_valid: 1, /* bits 0:0 */
  16888. seq_cmd_type_bits: 5, /* bits 5:1 */
  16889. seq_cmd_type_offset: 5, /* bits 10:6 */
  16890. rsvd5: 5, /* bits 15:11 */
  16891. tqm_cmd_valid: 1, /* bits 16:16 */
  16892. tqm_cmd_bits: 5, /* bits 21:17 */
  16893. tqm_cmd_offset: 5, /* bits 26:12 */
  16894. rsvd6: 5; /* bits 31:27 */
  16895. A_UINT32 mac_id_valid: 1, /* bits 0:0 */
  16896. mac_id_bits: 5, /* bits 5:1 */
  16897. mac_id_offset: 5, /* bits 10:6 */
  16898. rsvd8: 5, /* bits 15:11 */
  16899. crc_valid: 1, /* bits 16:16 */
  16900. crc_bits: 5, /* bits 21:17 */
  16901. crc_offset: 5, /* bits 26:12 */
  16902. rsvd9: 5; /* bits 31:27 */
  16903. } htt_t2h_ppdu_id_fmt_ind_t;
  16904. #endif